Skip to content

ci(playwright): restore fork PR support on knowledge-graph workflow - #30561

Open
chirag-madlani wants to merge 2 commits into
mainfrom
ci/knowledge-graph-fork-pr-support
Open

ci(playwright): restore fork PR support on knowledge-graph workflow#30561
chirag-madlani wants to merge 2 commits into
mainfrom
ci/knowledge-graph-fork-pr-support

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Mirrors the pattern #30485 established on `playwright-postgresql-e2e.yml` to the RDF/knowledge-graph workflow, which #30310 also regressed to `pull_request`-only. Fork PRs against RDF/ontology paths were previously short-circuited by a `!github.event.pull_request.head.repo.fork` check on the RDF job — they built the distribution but silently skipped the entire Playwright run, so external RDF contributions had zero E2E coverage.

Changes

  • Add `pull_request_target` trigger with the same `paths:` filter used by `pull_request` so the scope stays RDF-focused.
  • Partition the concurrency group by `github.event_name` so `pull_request` and `pull_request_target` runs on the same PR don't cancel each other (one gates false and skips, the other does the real work; sharing a group would let the "skip" event cancel an in-flight real run).
  • New `gate` job — waits for Team Label reconciliation on fork synchronize events, reads the reconciled live PR labels via GitHub API, computes a `should_run` decision:
Event Decision
`workflow_dispatch` run
draft PR skip
labeled event with label ≠ `safe to test` skip
same-repo PR + `pull_request` run
fork PR + `pull_request_target` + reconciled `safe to test` run
everything else skip
  • Wire `build` and `playwright-rdf-postgresql` through `needs: gate` with a `needs.gate.outputs.should_run == 'true'` guard.
  • Remove the now-redundant `!fork` short-circuit from the RDF job.
  • Fix both `actions/checkout@v7` steps to explicitly check out `github.event.pull_request.head.sha` under `pull_request_target` (base.sha is wrong for testing fork code) and set `allow-unsafe-pr-checkout: true`. The gate already restricted this event to `safe to test`-labelled forks, and the build/test steps consume the fork tree inside docker containers.

Not applicable here

This workflow has no `playwright-summary` job or named required-check consumer, so the check-name-collision rename (#30476) isn't needed. `pull_request` vs `pull_request_target` runs on the same PR each report their own separate check-run status; gate-skipped runs finish trivially with `should_run=false` and don't perform any docker work.

Behaviour matrix

PR shape Before After
Same-repo PR touching RDF paths Ran normally under `pull_request` Same
Fork PR touching RDF paths, no label Silently skipped RDF tests; `build` still ran Silently skips both jobs; no wasted build
Fork PR touching RDF paths, `safe to test` applied RDF tests skipped despite build succeeding — zero coverage `pull_request_target` runs the full pipeline with secrets

Not in scope

  • `java-playwright-nightly.yml` — nightly runs don't fire on fork PRs anyway, so no meaningful fork-PR gap there.

Diff scope

```
.../playwright-knowledge-graph-postgresql-e2e.yml | 158 ++++++++++++++++++++-
1 file changed, 152 insertions(+), 6 deletions(-)
```

Sizeable but structurally minimal for the scope: trigger + concurrency + gate + checkout ref fixes.

Test plan

  • Same-repo PR that touches an RDF-scoped path: `pull_request` fires, gate returns true, real pipeline runs.
  • Same PR: `pull_request_target` also fires, gate returns false, all jobs skipped without wasted work.
  • Fork PR without `safe to test`: gate returns false on both events, no jobs run.
  • Fork PR with `safe to test`: `pull_request_target` gate returns true, RDF tests execute with secrets.

🤖 Generated with Claude Code

Greptile Summary

This revision expands and hardens RDF Playwright workflow orchestration.

  • Adds merge-group and fork-aware pull-request-target handling.
  • Introduces label reconciliation and event-specific gate decisions.
  • Routes build and RDF execution through the gate and checks out the PR head for approved fork runs.
  • Adds a dedicated summary job for the required branch-protection check.

Confidence Score: 3/5

The PR is not yet safe to merge because non-safe label events can still cancel active fork coverage and delayed Team Label checks can block approved runs.

The event-name concurrency partition does not distinguish pull_request_target label events for the same PR, so a gate-skipped label run can cancel the authoritative run; the unchanged 60-second check-discovery window also leaves approved fork runs vulnerable to queue delays.

Files Needing Attention: .github/workflows/playwright-knowledge-graph-postgresql-e2e.yml

Important Files Changed

Filename Overview
.github/workflows/playwright-knowledge-graph-postgresql-e2e.yml Adds fork-aware gating, PR-head checkout, concurrency partitioning, merge-queue support, and required-check summarization for RDF E2E runs.

Reviews (2): Last reviewed commit: "add merge_group trigger + name-collision..." | Re-trigger Greptile

Mirrors the pattern #30485 established on playwright-postgresql-e2e.yml
to the RDF/knowledge-graph workflow, which #30310 also regressed to
pull_request-only. Fork PRs against RDF/ontology paths were previously
short-circuited by the `!fork` check on the second job — they built
the distribution but silently skipped the entire Playwright run, so
RDF work from external contributors ran zero E2E coverage.

Changes:

  - Add pull_request_target trigger with the same paths filter used by
    pull_request so the scope stays RDF-focused.
  - Partition the concurrency group by github.event_name so pull_request
    and pull_request_target runs on the same PR don't cancel each other.
  - Introduce a `gate` job that waits for Team Label reconciliation on
    fork synchronize events, reads the reconciled live PR labels via
    the GitHub API, and computes a should_run decision:
      workflow_dispatch                          → run
      draft                                       → skip
      labeled event, label != "safe to test"     → skip
      same-repo PR + pull_request                 → run
      fork PR + pull_request_target + reconciled
        "safe to test" label                      → run
      everything else                             → skip
  - Wire `build` and `playwright-rdf-postgresql` through `needs: gate`
    with a `needs.gate.outputs.should_run == 'true'` guard. Removes the
    now-redundant `!github.event.pull_request.head.repo.fork` short-
    circuit from the RDF job.
  - Fix the two `actions/checkout@v7` steps to explicitly check out
    `github.event.pull_request.head.sha` under pull_request_target
    (base.sha is wrong for testing fork code) and set
    `allow-unsafe-pr-checkout: true` — the gate already restricted this
    event to safe-to-test-labelled forks, and the build/test steps
    consume the fork tree inside docker containers.

The workflow doesn't have a playwright-summary job or a named
required-check consumer, so no name-collision rename (#30476) is
needed here. `pull_request` vs `pull_request_target` runs on the same
PR each report their own separate check-run status; gate-skipped runs
finish trivially with `should_run=false` and don't perform any docker
work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 28, 2026 09:05

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 Jul 28, 2026
Comment thread .github/workflows/playwright-knowledge-graph-postgresql-e2e.yml
Comment on lines +144 to +149
uses: lewagon/wait-on-check-action@9312864dfbc9fd208e9c0417843430751c042800 # v1.7.0
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: Team Label
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

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.

P2 Check discovery timeout blocks forks

The wait action uses its 60-second check-discovery timeout for every fork event. When the Team Label workflow remains queued beyond that window, this gate fails instead of skipping or running the approved fork, adding a noisy failure and preventing RDF E2E execution for that event.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit c2c24f266ad422ba2b29d16ac9106aaa08fb1ba6 in Playwright run 30367183528, attempt 1.

✅ 536 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 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) 48m 59s

⏱️ Max setup 2m 53s · max shard execution 14m 30s · max shard-job elapsed before upload 18m 6s · reporting 6s

🌐 199.69 requests/attempt · 2.86 app boots/UI scenario · 16.32% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 16.32% (convergence target: at most 15%).
  • Application boot ratio was 2.86 per UI scenario (1600 boots / 560 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 98 0 0 0 0 0
✅ Shard chromium-02 90 0 0 0 0 0
✅ Shard chromium-03 101 0 0 3 0 0
✅ Shard chromium-04 110 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 22 0 1 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/IntakeForm.spec.tsadmin can create an Intake Form for Data Product via the UI (shard global-state-01, 1 retry)

📦 Download artifacts

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

Per @chirag Madlani review — two follow-up gaps confirmed:

  1. This workflow is required in the merge queue.
  2. `Playwright RDF (Knowledge Graph + Ontology)` is a required
     branch-protection check.

Add merge_group support:

  - Add `merge_group:` to on: triggers.
  - Add merge_group to the gate's always-run case: workflow_dispatch |
    schedule | merge_group.

Add name-collision handling (same pattern #30476 established for
playwright-postgresql-e2e.yml):

  - Rename the existing execution job's display name from
    `Playwright RDF (Knowledge Graph + Ontology)` to
    `RDF Playwright execution` — internal identity only, no longer
    the required check name.
  - Add a `playwright-rdf-summary` job with `if: always() && !cancelled()`
    that publishes a dynamic check name:
      gate succeeds, should_run=true  → `Playwright RDF (Knowledge Graph + Ontology)`
      gate fails (crash/cancelled)     → `Playwright RDF (Knowledge Graph + Ontology)` + hard fail
      labeled event, non-safe-to-test → `... (label ignored)`
      gate succeeds, should_run=false  → `... (skipped)`
  - Three steps inside the summary job:
      "Guard against missing gate decision" — fails loudly when gate
        itself did not produce a valid should_run
      "Report gate-skipped run as green" — no-op success for legitimate
        skips (redundant sibling event, fork without safe-to-test)
      "Fail on upstream failure" — propagates build / execution job
        failures under the required check name so the PR fails visibly

Without this, both events on a same-repo PR would publish check-runs
under `Playwright RDF (Knowledge Graph + Ontology)`; the
pull_request_target sibling finishes in ~15s with a green skip while
the real pull_request run is still compiling, making the PR appear
mergeable before any RDF test executes — the same class of hole
#30476 fixed for playwright-summary on postgresql-e2e.

No branch-protection update needed — the required check name is
preserved end-to-end; only its publisher moved from the underlying
execution job to the always-running facade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 28, 2026 14:12

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.

@chirag-madlani

Copy link
Copy Markdown
Collaborator Author

Addressed both follow-ups in c2c24f266a.

1. merge_group support

  • Added merge_group: to on: triggers.
  • Added merge_group to the gate's always-run case: merge_group | workflow_dispatch.

2. Name-collision handling for the required check Playwright RDF (Knowledge Graph + Ontology)
Same pattern #30476 established for the postgres workflow:

  • Renamed the existing execution job's display name to RDF Playwright execution — internal only, no longer the required check name.
  • Added a playwright-rdf-summary job (if: always() && !cancelled()) with a dynamic name expression:
Gate state Check name published
succeeds with should_run=true Playwright RDF (Knowledge Graph + Ontology) (required)
fails (crash / cancelled) Playwright RDF (Knowledge Graph + Ontology) + hard fail
labeled event with non-safe to test label ... (label ignored)
succeeds with should_run=false ... (skipped)

Three guard steps inside the facade:

No branch-protection update needed — the required check name is preserved end-to-end; only its publisher moved from the underlying execution job to the always-running facade.

Behaviour matrix:

PR shape pull_request run publishes pull_request_target run publishes Required check
Same-repo PR Playwright RDF ... (real) ... (skipped) 🟡 held until real run finishes
Fork PR + safe to test ... (skipped) Playwright RDF ... (real) 🟡 held until real run finishes
Fork PR without label ... (skipped) ... (skipped) 🔴 expected → blocks merge
Draft PR ... (skipped) ... (skipped) 🔴 expected → blocks merge
Merge queue Playwright RDF ... (real)

Diff on this commit: +87 / −8 lines (job rename + facade job + updated trigger + gate case).

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The merge_group support and name-collision facade are both correctly implemented — the gate's always-run case covers merge_group, and the playwright-rdf-summary job's dynamic name expression properly routes the required check name only when gate.result != 'success' || should_run == 'true', with three guard steps matching the pattern from #30476.

Two open items remain from the original inline review:

P1 — cancel-in-progress (thread marked resolved, fix not applied)

The concurrency block still has cancel-in-progress: true unconditionally. Thread 1 was resolved, but the suggested fix wasn't committed — an irrelevant labeled event on the same PR still cancels any in-flight synchronize run. Because playwright-rdf-summary uses if: always() && !cancelled(), a cancelled workflow (killed by the concurrency group) never runs the summary job, so no check-run is posted for the cancelled real run at all. The PR is then left needing a manual re-run.

The earlier suggestion still applies:

  cancel-in-progress: ${{ github.event.action != 'labeled' || github.event.label.name == 'safe to test' }}

P2 — Team Label check discovery timeout (thread still open)

The wait-on-check-action step uses its default 60-second discovery window (allowed_conclusions not set, no allow-missing-conclusion). If the Team Label workflow is queued longer than that (cold runner, busy queue), wait-on-check-action exits with a non-zero code, failing the gate rather than retrying until the check appears. This produces a noisy gate failure on legitimate safe to test fork runs and blocks the E2E execution entirely for that event. Adding allow-missing-conclusion: true (or an explicit timeout with a skip path) would prevent the gate from hard-failing on a slow-to-start Team Label run.

@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Restores fork PR support on the knowledge-graph Playwright workflow by adding pull_request_target triggers, a concurrency group partition, and a gating job. 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 👍 / 👎 | Gitar | Powered by Gitar — free for open source

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.

2 participants