-
Notifications
You must be signed in to change notification settings - Fork 575
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
Digger reports success even though Terraform apply fails #1658
Comments
can I work on this issue or its solved |
Hi @Kamalesh-Seervi Current workaround used is that I itemize the steps of a workflow's apply step as:
Even though Digger reports "success" it will not execute the
And so I can make a match from the pipeline to see if the run has |
Just noticed this issue in v0.6.44. To me this is a blocker since it would allow someone to merge a PR even tough the apply is failing. Preventing this use case is the core purpose of digger so I don't understand that it hasn't been addressed since v0.6.33. It would be nice if there would be a |
Hi folks just realised this issue made it to the top upvotes, I didn't realise it was an issue of high severity. Thanks @fleroux514 for the blocker idea I think that will adopt this strategy. I will try to take a look at this soon |
For some reason when I read this issue previously I thought it was related to the one I linked of posting the error back to the comment, did not realise that the pipeline was succeeding |
@motatoes I tested and found it's been an issue since at least v0.5.x - was working back with v0.3.22. Had to update to vLatest though for OpenTofu to work, however in order to catch whether a |
Fixes diggerhq#1658 Error handling in backendless mode was incorrect, resulting in the workflow exit status to be success even if the command execution failed. This patch addresses this issue. The following are some additional notes of this fix: - When `allAppliesSuccessful` is false, we need to call `ReportErrorAndExit()` to ensure that the workflow fails with a non-zero exit status. - Since `ReportErrorAndExit()` invokes `os.Exit()` immediately, it should be called after setting the status of the pull request. - Contrary to intuition, `atLeastOneApply` is counted even if plan command, so we need to use `scheduler.IsPlanJobs()` to determine if the current workflow is plan or apply.
Fixes diggerhq#1658 Error handling in backendless mode was incorrect, resulting in the workflow exit status to be success even if the command execution failed. This patch addresses this issue. The following are some additional notes of this fix: - When `allAppliesSuccessful` is false, we need to call `ReportErrorAndExit()` to ensure that the workflow fails with a non-zero exit status. - Since `ReportErrorAndExit()` invokes `os.Exit()` immediately, it should be called after setting the status of the pull request. - Contrary to intuition, `atLeastOneApply` is counted even if plan command, so we need to use `scheduler.IsPlanJobs()` to determine if the current workflow is plan or apply.
Fixed in v0.6.50 🚀 |
Problem:
Terraform apply reports error/exit code 1, but pipeline won't fail as Digger saying "success"
Setup:
Flow:
Using version v0.3.22 I get the expected fail:
The text was updated successfully, but these errors were encountered: