Skip to content

ci: keep 2.1 PR jobs credential-free - #37480

Merged
pmbrull merged 2 commits into
2.1from
pmbrull/strict-pr-ci-2.1
Nov 10, 2026
Merged

pmbrull merged 2 commits into
2.1from
pmbrull/strict-pr-ci-2.1

Conversation

@pmbrull

@pmbrull pmbrull commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

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

  • PR code receives no repository, organization, or environment secrets and only a read-only built-in token. Checkouts do not persist credentials, and reusable PR callers do not inherit secrets.
  • Credential-backed jobs explicitly exclude pull_request and use trusted 2.1 refs. Downstream Collate dispatches pass the immutable event SHA and use the matching Collate release branch. Pushes use downstream workflow_dispatch mode because its push mode bypasses SHA pinning.
  • Generation validates drift and fails with local regeneration instructions. Manual generation uses its event SHA/cache scope; PR/branch override inputs and auto-push credentials are removed.
  • PR annotations, artifacts, and job summaries replace privileged PR comments and report writes. 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.1 merges or on trusted manual/approved merge-group runs. Live SSO remains available through a trusted manual 2.1 run.

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

  • Workflow security guard and focused policy/regression tests: 46 passed, 2 skipped (the skips cover SSO adapters absent from this newer branch).
  • Full .github/scripts/tests: 388 passed, 2 skipped, 6 failures. All six failures reproduce on untouched origin/2.1; they concern existing Playwright/merge-queue planning and recovery assertions.
  • actionlint against the untouched release base: 21 changed workflows; 63 existing findings on the base, 28 on this patch, zero new findings.
  • Ruff on new/modified security helpers and changed test files, normal commit hooks, and git diff --check passed.
  • Fresh-context self-review against 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.py and python -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

  • Bug fix

Checklist

  • Self-reviewed against REVIEW.md at the reviewed commit above.
  • Added tests for credential boundaries, generation drift, immutable manual checkouts, release dispatches, and failure propagation.
  • Preserved branch-specific safe tests and required check names.
  • Documented the security policy and the checks deferred until trusted execution.
  • JSON schema migration, ingestion application tests, and UI recording: not applicable (CI/docs only).
  • Issue/title exception: maintainer-requested CI hardening with skip-pr-checks.

@pmbrull
pmbrull requested review from a team, akash-jain-10, harshach and tutte as code owners November 10, 2026 11:35
@pmbrull pmbrull added the skip-pr-checks Bypass PR metadata validation check label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

# 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') }}

@gitar-bot gitar-bot Bot Nov 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 👍 / 👎

Comment on lines +132 to +139
# 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" \

@gitar-bot gitar-bot Bot Nov 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ 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 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 2 findings

🔴 High risk · Moving credential-backed CI off PRs and onto trusted 2.1 runs changes secret boundaries; a faulty event guard could expose credentials to unreviewed code.

Keeps PR jobs credential-free and pins Collate dispatches to immutable SHAs, but changes are requested before merge. UI-only merge groups dispatch with merge_group instead of the build-only mode the comment describes, so .github/workflows/maven-build-collate.yml needs either the event mapping restored or the comment removed. The push-to-workflow_dispatch remap changes what both Collate receivers get, and it is not captured in docs/decisions/2026-11-10-pr-jobs-never-receive-credentials.md, which needs to document that OSS never sends push and that Collate's push-only alerts no longer fire for OSS-triggered runs.

⚠️ Quality: Push→workflow_dispatch remap to Collate is not in the decision record

📄 .github/workflows/maven-build-collate.yml:132-139 📄 .github/workflows/data-access-request-e2e.yml:98-105 📄 docs/decisions/2026-11-10-pr-jobs-never-receive-credentials.md

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.
💡 Bug: UI-only merge groups now send 'merge_group', not Collate's PR mode

📄 .github/workflows/maven-build-collate.yml:98 📄 .github/workflows/maven-build-collate.yml:121-124

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 }}
🤖 Prompt for agents
Code Review: Keeps PR jobs credential-free and pins Collate dispatches to immutable SHAs, but changes are requested before merge. UI-only merge groups dispatch with `merge_group` instead of the build-only mode the comment describes, so `.github/workflows/maven-build-collate.yml` needs either the event mapping restored or the comment removed. The push-to-`workflow_dispatch` remap changes what both Collate receivers get, and it is not captured in `docs/decisions/2026-11-10-pr-jobs-never-receive-credentials.md`, which needs to document that OSS never sends `push` and that Collate's push-only alerts no longer fire for OSS-triggered runs.

1. 💡 Bug: UI-only merge groups now send 'merge_group', not Collate's PR mode
   Files: .github/workflows/maven-build-collate.yml:98, .github/workflows/maven-build-collate.yml:121-124

   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.

   Fix (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 }}

2. ⚠️ Quality: Push→workflow_dispatch remap to Collate is not in the decision record
   Files: .github/workflows/maven-build-collate.yml:132-139, .github/workflows/data-access-request-e2e.yml:98-105, docs/decisions/2026-11-10-pr-jobs-never-receive-credentials.md

   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."

   Fix (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.

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 merged commit e64090a into 2.1 Nov 10, 2026
57 of 59 checks passed
@pmbrull
pmbrull deleted the pmbrull/strict-pr-ci-2.1 branch November 10, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant