Repository navigation
Read the merge-group review in ci review on a merge_group event - #148
Open
kunalgoesbyken wants to merge 2 commits into
Open
kunalgoesbyken wants to merge 2 commits into
kunalgoesbyken wants to merge 2 commits into
Conversation
… wording, headline arm order test
This branch has not been deployed
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.
Fixes #147.
A repo with a GitHub merge queue has to add
merge_groupto the workflow that runsproofline ci review, or the required check never reports for the queue. On that eventGITHUB_SHAis the commit the queue built, and Proofline reviews that commit as aMERGE_GROUPreview. Before this changeci reviewonly acceptedPULL_REQUESTreviews. It skipped theMERGE_GROUPreview at the exact commit, waited out--timeout(30 minutes by default), and exited 2. With the check required, nothing could merge through the queue.What changes
CiSubject::for_eventpicks the review kind once fromGITHUB_EVENT_NAME:MERGE_GROUPonmerge_group,PULL_REQUESTon every other event. Both the search inwait_for_head_reviewand the subject check inconfirm_ci_subjectuse it, so they can't drift apart.merge_groupjob never takes a pull-request review of the same SHA, and apull_requestjob never takes a merge-group review.MERGE_GROUPreview carriesopen_items(the API leaves them out only while a review is pending or running, and for audits), so--fail-onworks on it the same way it does on a pull-request review.proofline review show ID --fail-onmakes the same decision throughreview_verdict. It now measures aMERGE_GROUPreview by itsopen_items, asci reviewdoes, so a dismissed finding no longer fails one path while passing the other.--sarifaccepts aMERGE_GROUPreview. It is also of one immutable commit, sovalidate_subjectno longer refuses it.merge_group_pull_request_numbers, for exampleacme/app merge group of #12, #13 run 1 at 89abcdef0123: COMPLETED, and printsmerge groupuntil Proofline has read the group's members.pull_request, the OIDC exchange still verifies a pull-request head only on merge-ref events, andcommit_under_teststill usesGITHUB_SHAonmerge_group.Verification
On
main(22c86ca), a mock console listing one completed, cleanMERGE_GROUPreview at the job's commit gives:On this branch the same job returns
Donestraight away.a_merge_group_job_reads_the_merge_group_review_of_its_commitrunsci_jobagainst a local console for each of these rows:--fail-onThere are also
only_a_merge_group_event_reads_the_merge_group_review(event to kind, includingpull_request_target, an empty event and wrong case),a_merge_group_review_names_the_queued_pull_requests(headline with members, an empty list, no list, no repository), andsarif_exports_a_merge_group_review_of_the_queued_commit.To reproduce:
cargo fmt --checkandcargo clippy --locked --all-targets -- -D warningspass. I rancargo test --lockedon Windows: everything this change touches passes. 12 tests inagent_install,hooks,local_patch,mcpandupdatefail the same way on unchangedmainon Windows (CI runs the suite only on Linux, see #85 and #103).Question
On a
merge_groupjob the OIDC exchange runs as it does onpush: no pull-request head is sent.ci/github-actions/credentialsisn't inopenapi.public.json, so I couldn't confirm from this repo that the server issues a read credential for amerge_groupidentity. If it doesn't,PROOFLINE_TOKENstill works, and I'm happy to add whatever the exchange needs.--annotationson a merge group appear on the job's check run, since there is no pull-request diff to place them on.Proofline review
I ran Proofline on this branch in my fork (kunalgoesbyken/cli#1, run 2 at
f1dc392). It raised 4 warnings, and I fixed 3 of them inb52d5c7:--fail-on. The README still said only pull-request reviews use open-item counts, butreview_verdictnow uses them forMERGE_GROUPtoo. Fixed: it now names both kinds and says a result without counts is unavailable, which is whatci_verdictreturns.--commit. The help and README promised "the commit the queue built", but--commitorCOMMIT_SHAcan name another SHA, and the job still reads that SHA'sMERGE_GROUPreview. Fixed: both now say the queued commit is the default and the overrides still apply.pull_request_numberin every case, so moving the PR arm ahead of the merge-group arm would still pass. Fixed: three of the four cases now carry PR number 42.[13, 12]to pin that the CLI doesn't sort. The API saysmerge_group_pull_request_numbersis "in number order", so the server never sends[13, 12]. For every input it can send, sorting and not sorting print the same thing, so the test would only cover data the contract rules out.The run itself finished as "Review incomplete" ("could not read everything it needed"). Run 1 never finished: all 6 attempts failed (support ref
rev_01a23723684c77b9ac41802b502249a0).