-
Notifications
You must be signed in to change notification settings - Fork 399
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
DT-669: Deploy command continues despite composer failure #3796
Comments
This might be related to #1807? Though, there's not much info on that ticket. The part in the code that seems suspicious to me is here: https://github.com/acquia/blt/blob/10.x/src/Robo/Commands/Deploy/DeployCommand.php#L421
I would assume that something should be done with the returned result on each task? But, digging through Robo and BLT I see there are some exceptions thrown/caught, so I might be looking at this wrong. |
Thanks for the detailed testing steps and report, it makes this much easier to reproduce. I can confirm this is a bug and will add it to the backlog. It looks like to fix it in just this spot, we should check the return code Composer (which is |
@danepowell Are you able to help me set expectations on if and when a resolution will be made for this issue? Given the frequency of this issue and the severity of it (site outage requiring rollback), it is critical for me and the projects my team is working on. So, the reason I ask is because if this is lower priority I assume a fix won't be available soon and we'll need to work towards a solution. In the event this is lower priority or no one is available to work on it, I am interested and willing to collaborate on remediation of this issue. But, to increase the likelihood the work gets committed back, I do ask for some guidance on what the changes should look like. |
We just destroyed an enviroment with exact the same issue. This is super critical. Commiting and deploying an artifact without an autoloader kills every environment. |
I certainly understand the frustration, but I don't have any information on priority or timelines, sorry. The best ways to support this issue would be to do one or more of the following:
|
Here's a related issue that would solve the problem in the robo task runner library consolidation/robo#891. |
We will be working on this today. If anyone is interested in collaborating on this, please reach out to |
Maybe my implementation is of interest. Anyways looking forward to having this in blt 🎉 |
As guidance for implementation: if you just want to follow the pattern established elsewhere of checking if the task exited successfully, that's totally fine and should only take a few minutes to implement. Something like this: blt/src/Robo/Commands/Deploy/DeployCommand.php Lines 153 to 155 in 219da38
Longer term failed tasks should probably throw an exception automatically but that's a much bigger lift / refactor. |
@danepowell I've reviewed #3809 and it matches your suggestion. I spoke with @nhmbounteous and he was able to test / verify it locally. Should I create a follow up ticket to address other areas where this type of issue would occur? |
I've already created such a ticket: #3811 Feel free to add anything missing to that. Thanks again for the contributions. |
* Made the deploy command fail and stop on `composer install` exception. * Made the deploy command fail and stop on `composer install` exception. * Update DeployCommand.php Added space in between if statement for code standards * Update DeployCommand.php Updated composer error message
Thank you @danepowell for helping work towards a solution here! |
Just a reflection to share: while this didn't fix all cases, I suspect it solved the most prone-to-error case due to the likelihood of network related errors on composer install. Thanks again! |
* Made the deploy command fail and stop on `composer install` exception. * Made the deploy command fail and stop on `composer install` exception. * Update DeployCommand.php Added space in between if statement for code standards * Update DeployCommand.php Updated composer error message
Describe the bug
The
blt artifact:deploy
command will deploy artifacts even if a step in the build process fails. The specific example used is a patch that fails to apply to a contrib module, while fails the composer step, which fails to generate thevendor/autoload.php
, which causes the deployed artifact to crash the environment with an error similar to this:To Reproduce
Steps to reproduce the behavior, ideally starting from a fresh install of BLT:
composer create-project acquia/blt-project --no-interaction
composer require drupal/svg_image_field
blt artifact:deploy
a. Error that the patch does not apply:
[Exception] Cannot apply patch This doesn't apply (https://www.drupal.org/files/issues/entity-browser-view-context-2865928-14.patch)!
b. The ExecStack attempts to exit the script:
[ExecStack] Exit code 1 Time 16.434s
c. The script continues:
Sanitizing artifact...
Expected behavior
At step 6 in the steps above the expected behavior is that if the patch does not apply the entire
artifact:deploy
script fails and exits. It should NOT push commits to Acquia.Detailed error output
BLT doctor output
System information
Additional context
In practice, this appears to happen composer requests a patch from drupal.org and gets a non-200 or corrupted response which results in composer not being able to apply the patch. It seems like it would be rare, but it has happened twice in the last week:
The text was updated successfully, but these errors were encountered: