Skip to content

[2.0] ci: run PR code on pull_request only and retire the safe to test label - #35433

Merged
pmbrull merged 2 commits into
2.0from
pmbrull/retire-safe-to-test-2.0
Nov 10, 2026
Merged

pmbrull merged 2 commits into
2.0from
pmbrull/retire-safe-to-test-2.0

Conversation

@pmbrull

@pmbrull pmbrull commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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 in merge-rules.

No linked issue — CI hardening, labelled skip-pr-checks. Release-branch backport of #35426; merge this before #35426.

pull_request_target always runs the default branch's workflow file (GitHub behaviour since 2025-12-08), so PRs into 2.0 currently run main's pull_request_target copies of these workflows; 2.0's own copies never run. #35426 moves main's copies to pull_request, which reads the workflow from the PR's merge commit, i.e. 2.0's own copies — and those still trigger only on pull_request_target. Without this backport, 2.0 PRs would stop reporting py-tests-status, the check 2.0.x-protection requires.

This converts 2.0's own copies with the same rules as #35426 (ADR:2026-10-14-pr-code-never-runs-on-pull-request-target on main):

  • pull_request_target → pull_request; labeled dropped; the "Wait for the labeler" / "Verify PR labels" gates and the label clauses removed (ui-checkstyle's authorize job folded into its path condition).
  • Steps that need a secret or a write token run only for same-repo, non-Dependabot PRs; fork and Dependabot PRs get the comment text in the job summary and an ::error:: annotation instead.
  • A workflow_dispatch of type generation for a fork PR stops before checking out the fork's code.
  • maven-build-collate and data-access-request-e2e dispatch Collate the way main's copies do today (REST dispatch, Collate branch matching the base, 5,700 s wait); PR runs still report to Collate as pull_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.0 PRs: they run 2.0's own versions of these workflows instead of main's, so the checks match the branch's code and tooling. Notably 2.0's py-tests runs its Python integration tests at PR time (2.0 has 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 under pull_request).

Left untouched: 2.0 workflows that only trigger on pull_request_target and that main has 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 on 2.0 PRs today either.

Type of change:

  • Improvement

High-level design:

Same as #35426; see the rule list above.

Tests:

Use cases covered

  • Same-repo 2.0 PR: every converted workflow runs on pull_request, with Sonar, comments and the Collate dispatches as today; py-tests-status reports.
  • Fork / Dependabot 2.0 PR: required checks run; secret and write steps are skipped.

Unit tests / integration tests / Playwright

Not applicable — CI configuration only.

Manual testing performed

  1. yaml.safe_load on the 14 changed workflows.
  2. actionlint before/after on the same files: no new findings (60 → 56).
  3. Static check over every step: no remaining pull_request_target trigger, labeled type, label gate or allow-unsafe-pr-checkout; every step using a non-GITHUB_TOKEN secret or writing to the PR is gated for same-repo, non-Dependabot PRs.
  4. The maven-build-collate / data-access-request-e2e dispatch steps were diffed against main's: identical apart from EVENT (no merge_group on 2.0).
  5. This PR runs 2.0's converted workflows on itself through pull_request; main's pull_request_target copies 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:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — no linked issue; CI hardening, labelled skip-pr-checks.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — see above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For a UI feature or feature task: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above — CI configuration; the checks run are listed above.
  • Decision check: follows ADR:2026-10-14-pr-code-never-runs-on-pull-request-target (added on main by ci: run PR code on pull_request only and retire the safe to test label #35426).

🤖 Generated with Claude Code

…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 pmbrull added the skip-pr-checks Bypass PR metadata validation check label Oct 14, 2026
@pmbrull
pmbrull requested review from a team, akash-jain-10, harshach and tutte as code owners October 14, 2026 10:02
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 14, 2026
@gitar-bot

gitar-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@pmbrull pmbrull mentioned this pull request Nov 10, 2026
6 of 7 tasks
@pmbrull
pmbrull merged commit 93a7fde into 2.0 Nov 10, 2026
103 of 118 checks passed
@pmbrull
pmbrull deleted the pmbrull/retire-safe-to-test-2.0 branch November 10, 2026 09:06
@pmbrull pmbrull mentioned this pull request Nov 10, 2026
7 tasks done

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant