ci: bind PR helpers to workflow revision - #28678
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 7ca9d71 against base 065a675. No concrete blocker found.
Both classifier and final verifier now load the same immutable, repository-owned workflow revision rather than an unrelated PR base or untrusted head. The explicit target repository and disabled persisted credentials preserve the trust boundary; SHA values are passed through environment variables and quoted in the checkout-independent provenance step. Missing checkout/helper errors still fail the job, with provenance already written. Scope/revision checks, required-job AND gating, cancellation behavior, reusable-workflow calls and job names are unchanged. Reruns retain the executing workflow/helper pairing rather than following floating main.
Reviewed the complete diff, full entrypoint and helper consumers, malicious-head/missing-base fixtures and provenance failure test. GitHub's published pull_request_target default-branch change supports the stated target problem: https://github.blog/changelog/2025-11-07-actions-pull_request_target-and-environment-branch-protections-changes/ . Author reports 10/10 Node tests, actionlint and diff check; I did not rerun them or wait for CI. Actual release-branch startup remains the explicitly documented post-merge verification, not something this source review claims to have executed. Head/base rechecked before submission.
|
Tick the box to add this pull request to the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28419 (CI Required / coverage failure reporting)
Related to #27291 and #27293 through #28529's CI startup blocker
What this PR does / why we need it:
pull_request_targetcurrently checks out.github/cifrom the pull request base SHA in thechange-scopeandci-requiredjobs. A4.2-devpull request can therefore load a workflow that referenceschange-scope.cjswhile its base commit does not contain that helper, failing before product tests start withCannot find module '.github/ci/change-scope.cjs'.Both jobs now load the repository-owned CI helper from
${{ github.workflow_sha }}, the commit that supplied the running workflow. The PR base and head SHAs remain event metadata only, and all checkout credentials remain disabled. A checkout-independent provenance step writes the workflow, base, and head SHAs before loading the helper, so missing-helper or checkout failures retain diagnostics. No test routing, required-check policy, or product code is changed.The existing
3.0-devroute and failure semantics remain unchanged. This PR is intentionally separate from #28591, whose purpose is cancelling doomed PR runs.Validation
node --test .github/ci/change-scope.test.cjs(10/10 passed)verifyResultsare executed from that same trusted version.mainref, requires provenance before checkout, and executes the provenance shell against a simulated checkout failure to verify the summary remains available.actionlint v1.7.12 .github/workflows/entrypoint.yaml(passed)git diff --check(passed)pull_request_targetbehavior uses the repository default-branch workflow source; a fresh fix(lockservice): backport stale empty-lock recovery to 4.2-dev #28529 run can therefore be created directly without a4.2-devCI-file backport. That run must prove the workflow SHA contains this fix, classification succeeds, and required tests actually start. See GitHub's change.QA required: no; this is a workflow/test-only change and does not alter MatrixOne runtime behavior. Complete CI startup and classification validation is a post-merge check.