-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI-1181: [pull:code] disable scripts for build branches #1614
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -507,14 +507,21 @@ | |
} | ||
|
||
protected function runComposerScripts(callable $outputCallback = NULL): void { | ||
if (file_exists($this->dir . '/composer.json') && $this->localMachineHelper->commandExists('composer')) { | ||
$this->checklist->addItem("Installing Composer dependencies"); | ||
$this->composerInstall($outputCallback); | ||
$this->checklist->completePreviousItem(); | ||
if (!file_exists(Path::join($this->dir, 'composer.json'))) { | ||
$this->io->note('composer.json file not found. Skipping composer install.'); | ||
return; | ||
} | ||
else { | ||
$this->logger->notice('composer or composer.json file not found. Skipping composer install.'); | ||
if (!$this->localMachineHelper->commandExists('composer')) { | ||
$this->io->note('Composer not found. Skipping composer install.'); | ||
return; | ||
} | ||
if (file_exists(Path::join($this->dir, 'vendor'))) { | ||
$this->io->note('Composer dependencies already installed. Skipping composer install.'); | ||
return; | ||
} | ||
$this->checklist->addItem("Installing Composer dependencies"); | ||
Check warning on line 522 in src/Command/Pull/PullCommandBase.php GitHub Actions / Mutation Testing
|
||
$this->composerInstall($outputCallback); | ||
$this->checklist->completePreviousItem(); | ||
Check warning on line 524 in src/Command/Pull/PullCommandBase.php GitHub Actions / Mutation Testing
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if the mutation tests are catching something here or if they just need to be updated. It seems it's the latter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to idiosyncrasies with how the Symfony Command Tester class handles output, our test cases can't verify that these checklist items appear in the command output. Hence the escaped mutant. But it's not caused by this PR, so we can ignore it. |
||
} | ||
|
||
private function determineSite(string|\AcquiaCloudApi\Response\EnvironmentResponse|array $environment, InputInterface $input): mixed { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative exists logic here seems to make sense, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to do any validation at the start of the method, hence the negative logic. I'm open to alternatives.