Skip to content

ci: bind PR helpers to workflow revision - #28678

Merged
XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/ci-workflow-script-provenance-20260911
Sep 11, 2026
Merged

ci: bind PR helpers to workflow revision#28678
XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/ci-workflow-script-provenance-20260911

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

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_target currently checks out .github/ci from the pull request base SHA in the change-scope and ci-required jobs. A 4.2-dev pull request can therefore load a workflow that references change-scope.cjs while its base commit does not contain that helper, failing before product tests start with Cannot 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-dev route and failure semantics remain unchanged. This PR is intentionally separate from #28591, whose purpose is cancelling doomed PR runs.

Validation

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.

@mergify mergify Bot added the kind/test-ci label Sep 11, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mergify

mergify Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@XuPeng-SH
XuPeng-SH merged commit db4edb4 into matrixorigin:main Sep 11, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants