Repository navigation
ci: keep 2.1 PR jobs credential-free - #37480
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| # they skip the PR-time build and the merge queue builds Collate for them (see `changes`). | ||
| if: ${{ !cancelled() && (github.event_name != 'merge_group' || needs.changes.outputs.backend == 'true' || needs.changes.outputs.skipped_pr_ui == 'true') && !github.event.pull_request.draft && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }} | ||
| # The status function lets push and dispatch proceed when the queue-only filter is skipped. | ||
| if: ${{ !cancelled() && github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/2.1') && (github.event_name != 'merge_group' || needs.changes.outputs.backend == 'true' || needs.changes.outputs.ui == 'true') }} |
There was a problem hiding this comment.
💡 Bug: UI-only merge groups now send 'merge_group', not Collate's PR mode
The new comment says UI-only merge groups use Collate's PR mode, which skips the backend ITs. But EVENT is now plain ${{ github.event_name }}. The old expression sent 'pull_request_target' whenever needs.changes.outputs.backend != 'true'. The job now runs for needs.changes.outputs.ui == 'true', so a UI-only merge group dispatches with merge_group, and Collate runs its full integration suite of up to 90 minutes instead of the build-only mode the comment describes. Either restore the mapping for UI-only groups or drop the comment.
Send Collate's PR-mode event name for merge groups that touch no backend paths, as the comment says.:
EVENT: ${{ (github.event_name == 'merge_group' && needs.changes.outputs.backend != 'true') && 'pull_request_target' || github.event_name }}
Was this helpful? React with 👍 / 👎
| # Collate's push mode follows the branch tip instead of inputs.sha. | ||
| # Its dispatched-run mode pins the supplied immutable OpenMetadata SHA. | ||
| dispatch_event="$EVENT" | ||
| if [ "$dispatch_event" = push ]; then | ||
| dispatch_event=workflow_dispatch | ||
| fi | ||
| run_id=$(gh api -X POST "repos/$COLLATE_REPO/actions/workflows/openmetadata-dispatch.yml/dispatches" \ | ||
| -f ref="$COLLATE_REF" -f "inputs[sha]=$SHA" -f "inputs[event]=$EVENT" \ | ||
| -f ref="$COLLATE_REF" -f "inputs[sha]=$SHA" -f "inputs[event]=$dispatch_event" \ |
There was a problem hiding this comment.
⚠️ Quality: Push→workflow_dispatch remap to Collate is not in the decision record
This commit changes the inputs[event] value that both Collate receivers (openmetadata-dispatch.yml and data-access-request-e2e.yml) get. A trusted 2.1 push is now sent as workflow_dispatch, so the downstream run pins inputs.sha and does not follow the branch tip. Collate has to keep agreeing with this: its workflow_dispatch mode must keep pinning the SHA, and its push-only behaviour, such as the Slack alerts gated on inputs.event == 'push', no longer runs after OSS merges. The PR description states the rule ("Pushes use downstream workflow_dispatch mode because its push mode bypasses SHA pinning"). The Accepted record 2026-11-10-pr-jobs-never-receive-credentials.md only says dispatches run for merge groups "against the immutable group SHA". It says nothing about pushes or the event remap. The record would need to say something like: "OSS never sends inputs[event]=push to Collate. Trusted pushes are dispatched as workflow_dispatch with the event SHA so the downstream run pins that revision. As a result, Collate's push-only alerts do not fire for OSS-triggered runs."
Add a v3 amendment to the existing record stating the dispatch-event contract.:
## Amendment — v3: trusted pushes dispatch Collate in workflow_dispatch mode
Collate's `push` mode follows its branch tip and ignores `inputs.sha`. OSS therefore never sends
`inputs[event]=push`: trusted `2.1` pushes dispatch with `inputs[event]=workflow_dispatch` and the
event SHA, so the downstream run certifies that revision. Collate's push-only Slack alerts do not
fire for these runs; OSS waits for and propagates the downstream conclusion instead. Checkout-only
receivers without an explicit fetch fail, rather than certify the tip, when the SHA is absent.
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
Describe your changes
Security follow-up to #35426 and the merged 2.1 backport #37470. The earlier backport protected fork PRs but retained same-repository credential access; this patch applies the strict policy to every PR.
No separate issue: maintainer-requested CI security hardening (
skip-pr-checks).High-level design
pull_requestand use trusted2.1refs. Downstream Collate dispatches pass the immutable event SHA and use the matching Collate release branch. Pushes use downstreamworkflow_dispatchmode because itspushmode bypasses SHA pinning.REVIEW.md, the decision record, and a blocking workflow-security step in JSON/YAML validation enforce the policy in future changes.Release behavior
Java integration tests remain available on PRs without check-report write tokens. Existing credential-free Playwright jobs retain their current graph. Collate and DAR dispatch after relevant
2.1merges or on trusted manual/approved merge-group runs. Live SSO remains available through a trusted manual2.1run.GitHub cron schedules run only on the default branch. This patch does not claim that release copies of nightly workflows are scheduled, and does not enable a merge queue. UI/ingestion Sonar PR scans are removed; their existing default-branch nightly workflows remain. Airflow Sonar uses a separate job after trusted release test runs.
Verification
.github/scripts/tests: 388 passed, 2 skipped, 6 failures. All six failures reproduce on untouchedorigin/2.1; they concern existing Playwright/merge-queue planning and recovery assertions.actionlintagainst the untouched release base: 21 changed workflows; 63 existing findings on the base, 28 on this patch, zero new findings.git diff --checkpassed.REVIEW.md: no proven blockers in the final committed diff. Reviewed commit:b4f4f8268877af593328f3e07898672a25320571.The five live receiver pinning snippets were exercised against a local Git fixture with an older requested SHA and a newer branch tip. Fetch-capable receivers pinned the requested SHA; checkout-only 2.0 DAR and 1.13 Maven receivers failed when that SHA was absent from a shallow clone. They cannot silently certify the later tip in this mode. Those older receivers may need an explicit fetch to avoid that failure under branch churn. Existing downstream Slack alerts conditioned on
inputs.event == 'push'do not fire in this SHA-pinning mode; OSS still waits for and propagates downstream failures/timeouts.Credentialed cloud suites and downstream Collate runs were not dispatched during local verification. GitHub CI and maintainer approval remain pending. No application Java, schema, or UI source changed; application integration tests and a UI recording are not applicable.
Manual validation
Run
python .github/scripts/check_pr_workflow_security.pyandpython -m pytest .github/scripts/tests/test_pr_workflow_security.py .github/scripts/tests/test_release_ci_security.py -q. On a PR, confirm credential-backed jobs skip and safe checks/required summaries still report. After merge, inspect the trusted release runs and the linked downstream Collate result.Type of change
Checklist
REVIEW.mdat the reviewed commit above.skip-pr-checks.