Repository navigation
[2.0] ci: run PR code on pull_request only and retire the safe to test label - #35433
Merged
Merged
Conversation
…t label Backports the trigger change of #35426. Since 2025-12-08 GitHub runs the default branch's copy of a pull_request_target workflow, so PRs into 2.0 have been running main's copies. Once main stops triggering on pull_request_target, pull_request reads the workflow from the PR's merge commit, so 2.0 PRs only get the checks 2.0's own copies define. Convert those copies so 2.0 PRs keep their checks, including the required py-tests-status. Fork and Dependabot PRs run unprivileged: steps that need a secret or a write token (Sonar PR scans, bot comments, the Collate dispatches, the generated-source auto-commits) run only for the other same-repo PRs, and bot comment content also goes to the job summary and an error annotation. The Collate dispatches keep reporting PR runs as pull_request_target, a typescript-type-generation dispatch for a fork PR stops instead of running the fork's code, and impact-map drift tells forks apart on pull_request instead of failing their checkout.
2.0 PRs have been running main's copies of maven-build-collate and data-access-request-e2e, which dispatch Collate through the REST endpoint and build the Collate branch matching the PR base. Keep that now that 2.0 PRs run 2.0's own copies: replace benc-uk/workflow-dispatch, whose workflow lookup misses about one run in four, with main's REST dispatch and 5700s wait, and build Collate 2.0 for a 2.0 PR instead of Collate main. The Collate build job no longer checks out a PR head it never used, and PR runs still report themselves as pull_request_target.
pmbrull
requested review from
a team,
akash-jain-10,
harshach and
tutte
as code owners
October 14, 2026 10:02
Code Review ✅ Approved🔴 High risk · Moving 14 CI workflows to pull_request removes safe-to-test approval, so contributor-controlled workflow changes could run automatically with same-repo secrets. Converts the 2.0 branch's CI workflows from pull_request_target to pull_request, retires the safe to test label gates, and gates secret and write-token steps to same-repo, non-Dependabot PRs so py-tests-status keeps reporting. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
This was referenced Oct 14, 2026
8 of 9 tasks
6 of 7 tasks
7 tasks done
This branch was previously 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.
Describe your changes:
Rollout alignment (2026-11-10): this PR remains unchanged and green on the reviewed head
7f32c388ae5; it still needs its required approval. Companion release PRs are #35435 (1.13) and #37470 (2.1, replacing closed #36403). Merge the release backports before #35426. Latest-push approval is enabled inmerge-rules.No linked issue — CI hardening, labelled
skip-pr-checks. Release-branch backport of #35426; merge this before #35426.pull_request_targetalways runs the default branch's workflow file (GitHub behaviour since 2025-12-08), so PRs into2.0currently runmain'spull_request_targetcopies of these workflows;2.0's own copies never run. #35426 movesmain's copies topull_request, which reads the workflow from the PR's merge commit, i.e.2.0's own copies — and those still trigger only onpull_request_target. Without this backport,2.0PRs would stop reportingpy-tests-status, the check2.0.x-protectionrequires.This converts
2.0's own copies with the same rules as #35426 (ADR:2026-10-14-pr-code-never-runs-on-pull-request-targetonmain):pull_request_target→pull_request;labeleddropped; the "Wait for the labeler" / "Verify PR labels" gates and the label clauses removed (ui-checkstyle'sauthorizejob folded into its path condition).::error::annotation instead.workflow_dispatchof type generation for a fork PR stops before checking out the fork's code.maven-build-collateanddata-access-request-e2edispatch Collate the waymain's copies do today (REST dispatch, Collate branch matching the base, 5,700 s wait); PR runs still report to Collate aspull_request_target.Files: java-checkstyle, py-checkstyle, ui-checkstyle, validate-jsons-yamls, py-operator-build-test, maven-sonar-build, airflow-apis-tests, yarn-coverage, py-tests, py-tests-postgres, typescript-type-generation, playwright-impact-map-drift, maven-build-collate, data-access-request-e2e.
What changes for
2.0PRs: they run2.0's own versions of these workflows instead ofmain's, so the checks match the branch's code and tooling. Notably2.0's py-tests runs its Python integration tests at PR time (2.0has no merge queue;main's copy runs them only in the queue). The impact-map workflow's fork handling is also fixed (fork PRs touching UI files failed at checkout underpull_request).Left untouched:
2.0workflows that only trigger onpull_request_targetand thatmainhas no PRT copy of (integration-tests-, playwright-integration-tests-, playwright-mysql-e2e(-skip), playwright-sso-tests, auto-cherry-pick-labeled-prs, team-labeler, pr-metadata-validation). They do not run on2.0PRs today either.Type of change:
High-level design:
Same as #35426; see the rule list above.
Tests:
Use cases covered
2.0PR: every converted workflow runs onpull_request, with Sonar, comments and the Collate dispatches as today;py-tests-statusreports.2.0PR: required checks run; secret and write steps are skipped.Unit tests / integration tests / Playwright
Not applicable — CI configuration only.
Manual testing performed
yaml.safe_loadon the 14 changed workflows.actionlintbefore/after on the same files: no new findings (60 → 56).pull_request_targettrigger,labeledtype, label gate orallow-unsafe-pr-checkout; every step using a non-GITHUB_TOKENsecret or writing to the PR is gated for same-repo, non-Dependabot PRs.maven-build-collate/data-access-request-e2edispatch steps were diffed againstmain's: identical apart fromEVENT(nomerge_groupon2.0).2.0's converted workflows on itself throughpull_request;main'spull_request_targetcopies also run until ci: run PR code on pull_request only and retire the safe to test label #35426 merges, so some check names appear twice.UI screen recording:
Not applicable — CI configuration only.
Checklist:
Fixes <issue-number>: <short explanation>— no linked issue; CI hardening, labelledskip-pr-checks.Fixes #<issue-number>above — see above.ADR:2026-10-14-pr-code-never-runs-on-pull-request-target(added onmainby ci: run PR code on pull_request only and retire the safe to test label #35426).🤖 Generated with Claude Code