Repository navigation
fix(comment-triggered-check): draw the newest attempt after a re-run on a newer commit - #362
Merged
Merged
Conversation
…on a newer commit
Piotr1215
added a commit
that referenced
this pull request
Nov 9, 2026
Main gained --timeout parsing (7ac6b02, #358) and the newest-attempt reply fix (8e5976c, #362), which touched the same lines as the per-caller caps in action.yml, start.sh and the README. Kept both sides: parse-timeout and INPUT_PARSE_TIMEOUT from main, the max-repeat and max-runs inputs, their env wiring and the start.sh validation from this branch. The README input table was regenerated with make generate-docs. The result against main equals the branch's original diff (5 files, +127/-7). Claude-Session: https://claude.ai/code/session_017edg9kEEKEqFFnrxvaVz3T
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.
What happened
The
/test-e2ereply from #360 is drawn from the checks, newest attempt first. Each redraw lists the checks on two commits: the one stored in the reply and the caller's own.A re-run after the pull request moved to a new commit breaks that. Say an old run's finish reads the reply while it still points at the old commit. A re-run on the new commit then writes the reply. The old finish resumes and writes its view on top, because its own check just closed. Its read-back lists only the old commit, sees its own view, and stops. The reply now shows the old run as cancelled. It stays that way until a writer from the new attempt redraws it, and if none comes later, it stays wrong.
What this PR changes
Every redraw also lists the checks on the pull request's current head. The reply comment names its pull request, so one extra read gives the head commit. A re-run after the pull request moved runs on that head, so even a writer from an older attempt now finds the newer attempt and draws it. If the pull request cannot be read, the redraw works as before.
One case is still open. If the pull request moves again after the re-run, with no further re-run, a late writer from the older attempt reads its own commit and the new head. It misses the re-run's commit and can draw the older attempt. A later writer from the re-run corrects it, but none is guaranteed to come. Covering it would mean listing the checks on every commit of the pull request.
There is no lock. GitHub has no conditional comment edit, and a check right before the write would still race. Letting every writer find the newer attempt on the current head means the last writer draws it in the case above, and a stale write is corrected by the read-back that follows it.
The cost is one more API call per redraw. It needs read access to pull requests, which every caller already has.
How it was tested
bats .github/actions/comment-triggered-check/test/*.batson the branch merged with main: 266 tests pass. In Docker on ubuntu 22.04 with jq 1.6, which callers use, 262 pass; the 4 that fail needyq, which the container lacks, and they fail the same way on main. CI's ubuntu-22.04 job runs the full set withyq. Two tests are new:make lintare clean, andmake check-docspasses.comment-triggered-check/v1advances and the experiment repo uses it directly. There I will push a new commit to a test pull request, re-run a command, and check the reply settles on the newer attempt.Closes DEVOPS-1847