fix: pin nightly_detect_failure checkout to the tested SHA#214
Closed
kim-em wants to merge 1 commit into
Closed
Conversation
This PR fixes a race condition in the `handle_success` job: the workflow
checked out `ref: nightly-testing` after CI completed, so if a new commit
landed on `nightly-testing` between the start of CI and the firing of the
`workflow_run` event, the `nightly-testing-YYYY-MM-DD` tag (and the
`nightly-testing-green` / `nightly-testing-daily` branch updates) would
point to an untested commit. Downstream consumers — `daily.yml`, nanoda,
leanchecker, executable jobs — then test that untested commit, producing
spurious failures attributed to nanoda/leanchecker rather than to the
broken tag.
Pin the checkout to `${{ github.event.workflow_run.head_sha }}`, the SHA
whose CI just succeeded, so the tag is always anchored to a tested commit.
Also fix the `handle_failure` Zulip message, which used `${{ github.sha }}`
— in a `workflow_run` event this is the SHA of the workflow's branch, not
the SHA of the failing run, so the linked commit was misleading whenever a
new commit had landed during CI.
🤖 Prepared with Claude Code
Author
|
Closing — workflow changes belong on mathlib4 master, not on the nightly-testing repo. Reopening there. |
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.
This PR fixes a race condition in
nightly_detect_failure.yml'shandle_successjob. The job was checking outref: nightly-testingafter CI completed, so if a new commit landed onnightly-testingbetween the start of CI and the firing of theworkflow_runevent, thenightly-testing-YYYY-MM-DDtag (and thenightly-testing-green/nightly-testing-dailybranch updates) would point to an untested commit. Downstream consumers —daily.yml, nanoda, leanchecker, executable jobs — then test that untested commit, producing spurious failures attributed to nanoda/leanchecker rather than to the broken tag. See the discussion on Zulip, where @semorrison and @Kha diagnosed this.The fix pins the checkout to
${{ github.event.workflow_run.head_sha }}, the SHA whose CI just succeeded, so the tag is always anchored to a tested commit. Side effect worth noting:nightly-testing-dailyandnightly-testing-greenwill now track the most recent successfully-tested commit rather than the tip ofnightly-testingat the moment a CI run finishes — which is what they were already documented to do.Also fix the
handle_failureZulip message, which used${{ github.sha }}— in aworkflow_runevent this is the SHA of the workflow's branch (the default branch), not the SHA of the failing run, so the linked commit was misleading whenever a new commit had landed during CI.🤖 Prepared with Claude Code