Skip to content

Require CI to cover HEAD before passing#62

Merged
srid merged 1 commit intomasterfrom
fix/ci-head-freshness
Apr 13, 2026
Merged

Require CI to cover HEAD before passing#62
srid merged 1 commit intomasterfrom
fix/ci-head-freshness

Conversation

@srid
Copy link
Copy Markdown
Owner

@srid srid commented Apr 13, 2026

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 commit 2f86f10 (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.

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.
@srid srid merged commit 942c854 into master Apr 13, 2026
1 check passed
@srid srid deleted the fix/ci-head-freshness branch April 13, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant