Conversation
Without this guard, the ci step can be recorded as passed against a stale commit if new commits land mid-workflow (e.g., user-requested changes, expanded tests). The verification clause now requires comparing the CI commit SHA against `git rev-parse HEAD` and re-running if they diverge. Observed in juspay/kolu#503: CI passed on cd5b8c5 but a followup commit 2f86f10 was pushed after — the ci step was already recorded as passed without covering the latest code.
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.
CI can silently pass on a stale commit if new commits land mid-workflow — the ci step records success against the commit it ran on, even if HEAD has moved.
Observed in juspay/kolu#503: CI ran against
cd5b8c5, then a followup commit2f86f10(expanded unit tests) was pushed after the user requested more coverage. The ci step was already recorded as passed without ever covering the latest code.The fix adds a HEAD-freshness guard to the ci step's verification clause: before recording the step as passed, the agent must compare the commit SHA that CI ran against with
git rev-parse HEAD. If they differ, CI must re-run. This closes the gap regardless of why HEAD moved — fix retries, user-requested changes, or any other source of new commits.