Repository navigation
🐛 PR Verifier (v5): record PR Type and PR Issue with one completed create, and fail visibly when it can't - #18795
Conversation
The pinned kubebuilder-release-tools v0.4.3 image created each required check run in_progress and then PATCHed it with the verdict. When GitHub answered the PATCH with 404 (hivecommons#18667, run 44069761061) the runs stayed in_progress for ever, Tide blocked the PR, and the continue-on-error wrapper job still went green. The workflow now computes both verdicts in-repo, reusing the existing port of the upstream rules in integration-governance.cjs (same check names, output titles and summaries), and records each check with ONE create that is already completed: no create-then-update, no lookup by name. A title verdict stays advisory for the wrapper job; a result that cannot be recorded posts a completed failure run with the reason (best effort) and fails the job. No image is pulled, so the job leaves the ARM64 runner and drops packages: read. Refs hivecommons#18764 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> (cherry picked from commit 5750c0f)
GitHub runs the default branch's copy of a pull_request_target workflow (verified on the fork: a PR based on a branch carrying this change ran the default branch's old workflow). Correct the checkout comment. Refs hivecommons#18764 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com> (cherry picked from commit d12c9ec)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #18795 (replace the pinned verifier image with an in-repo script) or #18792 (keep the image and settle stuck check runs afterwards) is the fix for #18764, since both rewrite .github/workflows/pr-verifier.yml and cannot both merge.
Two open PRs fix #18764 in incompatible ways; a maintainer has to pick one. This is a routing note, not a defect report.
- #18795 (this PR) removes the GHCR image, login and
docker run. It recordsPR Type/PR Issuewith one already-completedchecks.createeach, in.github/scripts/pr-verifier.cjs. It also dropspackages: read, addscontents: read, and changes the runner selection (pr-verifier.ymlruns-on, nowHIVE_RUNNER_LABELS). - #18792 keeps the image and adds a "settle" step that closes stuck runs in the same check suite. The hive overlap comment already flags
pr-verifier.ymlas a CONFLICT between the two. - #18796 is the v6 twin of this PR. I diffed the two and only the blob index lines differ, so this is intentional paired copies, not a duplicate to close. The PR body says the v5 copy is the one that matters, because
pull_request_targetruns the default branch's workflow.
Read at the PR head: the workflow checks out github.sha (default-branch tip) with persist-credentials: false and a sparse .github/scripts checkout, so no PR code runs under pull_request_target. The verdicts are computed from event.pull_request.title only, as plain data. record() treats a response that isn't a completed verdict on the same head as unrecorded. I found no defect in this path.
The question is a trust-surface one: it changes workflow permissions and the required-check producer, and it changes what the required checks mean. The author's own open question (do the old stuck in_progress runs still count for Tide?) is unverified, so neither PR is proven to unblock #18667.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Needs a maintainer choice between two fixes for #18764, and it edits a CI trust surface. Competing PR (not a duplicate). #18792 (v5, #18796 is not a duplicate of this PR. I diffed the two: they are byte-identical apart from index hashes, but target What I read. Why a person should decide. It changes workflow permissions (drops ℹ️ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No merged by Hive trusted-author auto-merge: author |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide which fix for #18764 lands on v5 — this PR (replace the verifier image with an in-repo one-create pr-verifier.cjs) or #18792 (keep the pinned image and add a settle step)?
Two open v5 PRs rewrite .github/workflows/pr-verifier.yml for the same issue (#18764) with different designs, so they conflict rather than duplicate.
- #18795 (this PR) removes the pinned verifier image and records
PR Type/PR Issuewith one already-completedchecks.createeach (.github/scripts/pr-verifier.cjs:19-33), so noin_progressrun can be left behind. - #18792 keeps the image and adds a "Settle PR Type and PR Issue check runs" step that PATCHes stuck runs to
failure(per its body).
Both edit the same workflow, so only one can merge cleanly. They also differ in trust terms: this PR drops the packages: read permission and the native ARM64 runner, and reimplements the upstream title rules in-repo (integration-governance.cjs, prTypeFromTitle/prTypeVerdict/prIssueVerdict); #18792 leaves the image-based rules in place. Both touch a required-check workflow, which is a trust surface, so I am routing this rather than judging it.
What I read in this diff looks internally consistent: create() verifies the response's name, head SHA, status and conclusion before counting a result as recorded, verifyContents now delegates to the same verdict functions, and the tests assert update/get/listForRef are never called. I did not run anything. #18796 is the v6 twin of this PR (same file set, different base, stated in both bodies), so it is not a duplicate; I am not commenting on it separately.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
There was a problem hiding this comment.
Decision needed: @clubanderson should the PR Verifier hang fix land as this PR (replace the GHCR image with an in-repo verifier) or as #18792 (keep the image and settle its checks afterwards)?
This PR and #18792 both fix hung PR Type / PR Issue checks by editing .github/workflows/pr-verifier.yml and .github/workflows/pr-auto-update-test.yml, with different designs. This one drops the image and records one completed check run per verdict (pr-verifier.cjs). #18792 keeps the image and adds a settle step (test-pr-verifier-settle.py). They will conflict, and only one design should merge.
The diff looks sound to me. I did not read pr-verifier.yml past the diff's first hunk (the diff is truncated in my view). Read:
pr-verifier.cjscreates each check withstatus: 'completed'in a single call and verifies GitHub's echoed response.prTypeVerdict/prIssueVerdictare covered by tests.- The workflow test pins
checkouttogithub.shawithpersist-credentials: false, which is the right choice underpull_request_target.
The decision is a human call because the change rewires a required check under pull_request_target, with checks: write, and removes the pinned upstream image. Trust-surface files are never mine to approve.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
|
Needs a decision, not a merge:
Head: verdict requires_human @0243a9c, 44/57 checks green, 13 pending, DCO yes, soak 0s of 10m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to Updated 2026-11-17 21:20 UTC. |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the required PR Type / PR Issue checks may move from the pinned upstream verifier image to an in-repo github-script port that runs under checks: write.
I found no code defect in the logic, but this changes a required-check producer in .github/workflows/pr-verifier.yml, which is a CI-permissions surface, so I'm routing it rather than judging it alone.
What I read (pr-verifier.yml, pr-verifier.cjs, integration-governance.cjs):
- The
pull_request_targetjob now checks out${{ github.sha }}(the default branch tip) withpersist-credentials: falseand a sparse.github/scriptscheckout, thenrequire()spr-verifier.cjsfrom it. PR code is never executed, so the standard pwn-request path is closed for fork PRs. - Permissions go from
checks: write, pull-requests: read, packages: readtochecks: write, contents: read, pull-requests: read. The reduction is fine. - A
workflow_dispatchrun checks out the dispatching same-repo branch's own scripts, and that run holdschecks: write. Whoever can push a branch and dispatch can post a greenPR Type/PR Issueon any head. The workflow comment says this is limited to same-repo branches, which I believe is right, but it is new, because the previous image was pinned by digest. - The verifier no longer comes from an immutable digest-pinned upstream image. The rules are re-implemented in JS (
prTypeFromTitle,prTypeVerdict), so the required checks can now drift from the upstream rules. The new tests do pin the output text.
The decision for a maintainer: is that trade acceptable? It removes the GHCR dependency and the create-then-update stuck-in_progress failure (#18764), at the cost of owning the verifier logic in-repo.
No changelog.d text issue seen; the fragment is present.
— hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.326
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the required PR Type / PR Issue checks may move from the pinned upstream verifier image to in-repo github-script code, since this rewrites a required-check workflow that runs under pull_request_target with checks: write.
Routing to a human, not a code defect. This PR replaces the pinned verifier image with in-repo code in .github/workflows/pr-verifier.yml, which is the workflow that posts the required PR Type / PR Issue contexts. That is a CI-permissions / required-check surface, so a maintainer needs to sign off.
What I verified in the diff:
permissions:goes tochecks: write,contents: read,pull-requests: read(packages: readis dropped). No broader grant.- The new checkout uses
ref: ${{ github.sha }}withpersist-credentials: falseand a sparse.github/scriptscheckout. Onpull_request_targetthat is the default-branch tip, so PR code is not executed. The script reads onlypr.titleandpr.head.sha. runs-onnow allowsvars.HIVE_RUNNER_LABELSfor same-repo PRs andworkflow_dispatch, andubuntu-latestfor forks. Forks stay off the self-hosted pool.record()inpr-verifier.cjscreates each check alreadycompletedand fails the job when it cannot record. That matches the stated goal of fixing thein_progresshang.
Open question from the PR body, still unverified: whether the old stuck in_progress runs on a head are ignored in favour of the newer completed run. That decides whether #18667 actually unblocks. It is worth confirming on #18667 after merge, as the author says.
I read the diff and the workflow hunks only; I did not run anything.
— hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.326
The required
PR TypeandPR Issuechecks could hangin_progressfor ever whileverify PR contentswent green. That is what blocks #18667. This PR makes the verifier record each check in one step, already finished, so the checks always reach a result. If the verifier can't record a result, the job now goes red and says why.Refs #18764. This is the v5 copy. The v6 copy is #18796. This is the copy that fixes the live problem. GitHub runs
pull_request_targetworkflows from the repository's default branch, which is v5. So this copy is the one that runs for v6 PRs like #18667 too.Why it happened
The pinned verifier image (upstream kubebuilder-release-tools v0.4.3, deprecated upstream) worked in two steps. First it created each check as "in progress". Then it updated the check with the verdict. Sometimes GitHub answers that update with 404 Not Found (run 44069761061 on #18667). When that happens the check stays "in progress" for ever. Edits, pushes and reopens all start by updating the existing check, so the stuck check never recovers. The image step was
continue-on-error, so the job reported success anyway.What this changes for operators
integration-governance.cjs. Check names, output titles and summaries are the same as the image's. The job runs on the normal runner pool instead of a native ARM64 runner, and dropspackages: read.status: completed, the conclusion and the output. There's no "in progress" step and no update that could fail.failurecheck that gives the reason (best effort). Thenverify PR contentsfails with an error saying the verifier could not record its result.PR Type/PR Issueitself. The wrapper job stays green, as before.labeled,unlabeledandready_for_reviewevents. These checks only read the title, so the extra runs agree with each other.Example: an
editedevent on #18667 would recordPR Type: success (Found 🐛 PR (bugfix))andPR Issue: success, one call each.After merge: un-sticking a PR
The fix only applies to events after it merges. Re-running an old run re-runs the old workflow. For a PR whose checks are already stuck, do one of these on its current head:
github.tokenflip fires nothing), orgh workflow run pr-verifier.yml --ref <branch> -f pr_number=<N>.Either one records a fresh, completed pair.
Open question (unverified): the old stuck
in_progressruns stay on the commit. I expect GitHub and Tide to use the newest run of each name, but I have not verified it. If they still count the stuck ones, the PR stays blocked. I'll check this on #18667 after merge.Files
.github/workflows/pr-verifier.yml: replaces the login, pull anddocker runsteps with a sparse checkout of.github/scripts(pinnedactions/checkout, no credentials kept) and a pinnedactions/github-scriptstep. Keeps the dispatch payload rebuild, the stale-head bailout, the concurrency block and the check names. Updates the comments..github/scripts/pr-verifier.cjs(new):record..github/scripts/integration-governance.cjs:prTypeVerdictandprIssueVerdict(the upstream check text).verifyContentsnow uses them.src/deploy/test_pr_verifier_advisory.sh: checks the new setup. Nothing touches a registry, no step iscontinue-on-error, and a stale dispatch records nothing..github/scripts/test-native-queue-workflows.py: contract tests for the new step..github/workflows/pr-auto-update-test.yml: runs the new node test.src/docs/hivecommons-migration.md,changelog.d/fixed-18764-pr-verifier-single-post.md.Tests
pr-verifier.test.cjs, mocked GitHub. One completed create per check, and no update or lookup calls. A bad title makes the check fail but not the job. A transient error is retried. When a result can't be recorded, the job fails and a fallback failure check is posted. A response that isn't completed counts as not recorded.integration-governance.test.cjs: exact upstream check text for both checks.workflow_dispatchrun on the v6 copy (run 44137409710) recordedPR Typecompleted/failure ("No matching PR type indicator found in title.", correct for thatTEST ONLY …title) andPR Issuecompleted/success, one create each, with nothing leftin_progress. Thepull_request_targetpath could not be exercised in the fork, because GitHub ran the fork's default-branch copy of the workflow there.🤖 Generated with Claude Code
https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t