Repository navigation
Fail put step when saving output fails - #9658
Merged
Merged
Conversation
- propagate SaveOutput errors so put steps do not succeed when their resource version cannot be persisted.
Kump3r
approved these changes
Jul 27, 2026
Contributor
There was a problem hiding this comment.
Clean, minimal fix for a real correctness bug - SaveOutput errors were previously swallowed silently, causing builds to appear successful while the output version was never recorded. The change is well-scoped, follows existing conventions, and the test coverage is thorough (error propagated, step not successful, Finished/StoreResult not called).
Worth noting for operators: builds that previously succeeded silently on a DB error during SaveOutput will now be marked as errored. This is the correct behaviour, but may surface as new alerts in production after rollout.
Tests:
I did a before and after with the following Dockerfile:
FROM busybox
RUN mkdir -p /opt/resource
RUN echo '#!/bin/sh' > /opt/resource/check && echo 'echo "[]"' >> /opt/resource/check && chmod +x /opt/resource/check
RUN echo '#!/bin/sh' > /opt/resource/in && echo 'echo "{}"' >> /opt/resource/in && chmod +x /opt/resource/in
RUN echo '#!/bin/sh' > /opt/resource/out && echo 'echo "{\"version\": {}}"' >> /opt/resource/out && chmod +x /opt/resource/outBefore:
After:
Contributor
Author
|
@Kump3r Thanks for the review and taking care of this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fail a put-step when saving output does not succeed.
To confirm that this was fixed, I just created the pipeline as explained in the issue section: steps to reproduce.
Here are the logs from my tests.
shows that in ATC logs that the put step errored and failed to save the version to the database, while the user is informed that the put-step succeeded.
2 .run from PR branch:
and we can see that both ATC logs and user have the same information; put step did not succeed.
The main problem described in: #9632 has been resolved by this PR. The put step will not silently succeed.
In the follow-up PR, we can improve the confusing error messages from the JSON decoder.