Skip to content

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

Merged
chirag-madlani merged 5 commits into
mainfrom
label-guard-safe-to-test-only
Aug 20, 2026
Merged

chirag-madlani merged 5 commits 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

The PR adjusts concurrency cancellation across 18 GitHub Actions workflows so adding safe to test only restarts CI for fork pull requests.

  • Preserves in-progress CI when the label is added to a same-repository pull request.
  • Retains stale-run cancellation for ordinary pull-request updates and other existing events.
  • Aligns the knowledge-graph Playwright workflow with the guarded concurrency behavior used by the related Playwright workflow.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/workflows/playwright-knowledge-graph-postgresql-e2e.yml Replaces unconditional cancellation with the event-, label-, and fork-aware predicate while retaining cancellation for ordinary PR updates.
.github/workflows/playwright-e2e-reusable.yml Adds the fork condition to the reusable Playwright workflow’s safe-to-test cancellation branch.
.github/workflows/openmetadata-service-unit-tests.yml Prevents same-repository safe-to-test label events from cancelling an active pull-request test run.
.github/workflows/py-tests.yml Applies the guarded cancellation predicate without changing the workflow’s concurrency group.
.github/workflows/java-checkstyle.yml Applies the same fork-aware safe-to-test cancellation policy to Java checkstyle runs.

Reviews (5): Last reviewed commit: "Merge branch 'main' into label-guard-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
karanh37
karanh37 previously approved these changes Aug 17, 2026
@github-actions

github-actions Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit a8c72e557fd5394e9027bf389d211b0c63f824f8 in Playwright run 32336849895, 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) 52m 5s

⏱️ Max setup 4m 25s · max shard execution 14m 50s · max shard-job elapsed before upload 18m 18s · reporting 4s

🌐 214.52 requests/attempt · 2.83 app boots/UI scenario · 2.13% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 214.52 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 106 0 0 0 0 0
✅ Shard chromium-02 100 0 0 0 0 0
✅ Shard chromium-03 99 0 0 0 0 0
✅ Shard chromium-04 94 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

ulixius9
ulixius9 previously approved these changes Aug 17, 2026
pmbrull
pmbrull previously approved these changes Aug 17, 2026
@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
Copilot AI review requested due to automatic review settings August 20, 2026 05:45

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.

@gitar-bot

gitar-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Guards the safe-to-test workflow concurrency cancellation across 18 CI files with a fork-origin check, preventing same-repository runs from being unnecessarily restarted when labels are 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

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

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