Repository navigation
Run the review checkers from the workflow's commit - #611
Merged
Merged
Conversation
A reopened pull request whose head had not moved since the review gate merged failed its interactive-review check: the job checked out the event's base.sha, which moves only when the head does, so the new workflow ran the old check-queue-review.py and it refused the new arguments. Under pull_request_target the workflow file is the base branch's tip, github.sha, so the checkers and the base the change is measured against now come from that same commit. Change-Id: Ie73eac9f59864e773b05fbf73562af35c5c61b3c
The test only refused the old base.sha expression, so any other wrong ref or base would still pass it. It now requires the exact checkout ref and BASE_SHA expressions. Change-Id: I7008cdbd1902847ae6188363f169d5b99f5f1631
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.
Problem and behavior
After #610 merged, reopening #608 failed
interactive-reviewwithcheck-queue-review.py: error: the queue check requires --branch and --repo(run 42356441759). The job checked out
pull_request.base.sha, which stillpointed to main before #610, because that SHA moves only when the head does.
The new workflow therefore ran the old checker, and the old checker refused
the new arguments.
After this change, a pull request's run checks out
github.sha, the basebranch's tip that the workflow file itself came from, and measures the change
against that commit. Merge groups keep
merge_group.base_shaand still exitbefore reading anything.
Approach
The workflow and the scripts it calls now come from one commit, so they cannot
disagree about flags. A test refuses
pull_request.base.shain the workflow.Validation
scripts/run-python-tests.py tests/test_interactive_review_hook.py: 63 pass.work.
Summary by cubic
Fixes the interactive-review check failing on reopened pull requests after a review-gate merge. The job now checks out
github.sha, the base branch tip the workflow file came from, so the checkers and the base they measure against always come from the same commit; previously it usedpull_request.base.sha, which moves only when the head does, so a reopened PR ran an outdated checker that rejected the new flags. Merge-group runs still usemerge_group.base_sha. A test now asserts the workflow's exact checkout ref andBASE_SHAexpressions, not just that the old one is absent.Written for commit d5fc4c2. Summary will update on new commits.