Skip to content

ci: don't cancel same-repo runs when 'safe to test' label is added - #31613

Open
chirag-madlani wants to merge 1 commit into
mainfrom
label-guard-safe-to-test-only
Open

ci: don't cancel same-repo runs when 'safe to test' label is added#31613
chirag-madlani wants to merge 1 commit into
mainfrom
label-guard-safe-to-test-only

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes: N/A — CI hardening for the label-guarded workflows.

Same-repo PRs already run with full trust under pull_request / pull_request_target, so labeling one safe to test grants no new capability. The previous concurrency.cancel-in-progress expression treated any labeled: safe to test event as a cancel-trigger, which killed the in-flight synchronize run and started an identical fresh run — pure CI waste, and visually a spurious "re-run" on the PR checks. Non-safe to test labels (e.g. To release) also produced confusing skipped-run entries because they entered the same concurrency group and either queued behind or cancelled a pending real run.

This PR guards the safe to test branch of the concurrency predicate with a fork check (github.event.pull_request.head.repo.full_name != github.repository). Now only fork PRs restart on the label — same-repo PRs preserve the running work. All other events (synchronize, opened, reopened, ready_for_review, merge_group, workflow_dispatch) still cancel stale runs as before, and non-safe to test labels remain non-cancelling.

Applied uniformly to 18 workflows that share the pattern.

Type of change:

  • Improvement

High-level design:

N/A — small change. One-line edit per workflow inside the existing concurrency.cancel-in-progress expression:

github.event.label.name == 'safe to test'

becomes

(github.event.label.name == 'safe to test' && github.event.pull_request.head.repo.full_name != github.repository)

Files touched (18):
airflow-apis-tests, data-access-request-e2e, integration-tests-mysql-elasticsearch, integration-tests-postgres-elasticsearch-redis, integration-tests-postgres-opensearch, java-checkstyle, maven-build-collate, maven-sonar-build, openmetadata-service-unit-tests, playwright-knowledge-graph-postgresql-e2e, playwright-postgresql-e2e, py-checkstyle, py-operator-build-test, py-tests-postgres, py-tests, typescript-type-generation, ui-checkstyle, yarn-coverage.

playwright-knowledge-graph-postgresql-e2e.yml previously had a bare cancel-in-progress: true; it now uses the same guarded expression as playwright-postgresql-e2e.yml (both handle pull_request + pull_request_target).

Rejected alternatives: splitting the concurrency group so non-safe to test label runs never touch the real pipeline (fix A) — deferred; this PR fixes the highest-impact case (wasteful cancel-and-restart on same-repo labeling).

Tests:

Use cases covered

  • Same-repo PR + labeled: safe to test → in-flight synchronize run is not cancelled.
  • Fork PR + labeled: safe to test → gated run is cancelled and privileged run starts (unchanged).
  • Any label ≠ safe to test on any PR → in-flight run is not cancelled (unchanged).
  • synchronize / opened / reopened / ready_for_review → stale runs still cancelled (unchanged).
  • merge_group / workflow_dispatch → still cancel stale runs (unchanged).

Unit tests

  • Not applicable (workflow YAML edits only).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  • YAML syntax validated locally via python3 -c "import yaml; yaml.safe_load(open(...))" on each edited file.
  • Verified expressions with grep — all 18 files now use the guarded predicate.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For UI changes: N/A.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above — N/A, CI-config edit.

Greptile Summary

This PR updates concurrency cancellation predicates across 18 CI workflows so adding safe to test only cancels an existing run for fork PRs.

  • Preserves in-progress same-repository PR checks when the label is added.
  • Retains stale-run cancellation for ordinary PR updates and non-PR events.
  • Aligns the Knowledge Graph Playwright workflow with the guarded cancellation behavior already used by its sibling workflow.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness or security failures identified in the changed workflow predicates.

The new repository comparison is reached only for labeled PR events, fork label events continue cancelling stale runs, and all other supported events retain their previous cancellation behavior.

Important Files Changed

Filename Overview
.github/workflows/airflow-apis-tests.yml Adds the fork-repository condition to the representative pull_request_target cancellation predicate without changing job authorization.
.github/workflows/openmetadata-service-unit-tests.yml Applies the equivalent guarded predicate to the workflow’s pull_request event path.
.github/workflows/playwright-knowledge-graph-postgresql-e2e.yml Replaces unconditional cancellation with event-, label-, and fork-aware cancellation while retaining cancellation for non-PR events.
.github/workflows/playwright-postgresql-e2e.yml Adds the same-repository exemption to the existing dual-event Playwright cancellation predicate.

Reviews (1): Last reviewed commit: "ci: don't cancel same-repo runs when saf..." | Re-trigger Greptile

Same-repo PRs already run with full trust under pull_request /
pull_request_target, so labeling them "safe to test" adds no new
capability. The previous concurrency expression cancelled the in-flight
synchronize run and kicked off a fresh identical run — wasted CI.

Guard the "safe to test" cancel with a fork check so only fork PRs (whose
head repo differs from the base) restart on the label. All other events
(synchronize, opened, reopened, ready_for_review, merge_group, dispatch)
continue to cancel stale runs as before. Non-"safe to test" labels
remain non-cancelling.

Applied uniformly to 18 workflows that share the pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 08:23

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 17, 2026
@gitar-bot

gitar-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Guards workflow concurrency cancellation predicates with a fork check to prevent same-repo runs from being cancelled when the 'safe to test' label is added. No issues found.

Options

Display: compact → Showing less information.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 8b2ce893121974c3f8c7ca0a8bdc75267e58e74e in Playwright run 32010146324, attempt 1.

✅ 551 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 46m 45s

⏱️ Max setup 3m 48s · max shard execution 18m 43s · max shard-job elapsed before upload 22m 10s · reporting 4s

🌐 213.98 requests/attempt · 2.83 app boots/UI scenario · 8.64% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 213.98 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1618 boots / 572 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 140 0 0 0 0 0
✅ Shard chromium-02 122 0 0 0 0 0
✅ Shard chromium-03 137 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@chirag-madlani
chirag-madlani added this pull request to the merge queue Aug 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-17T15:02:22Z)

Blocked the queue: integration-tests-mysql-elasticsearch

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants