fix(playwright): run trusted fork updates#30485
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 |
There was a problem hiding this comment.
Pull request overview
This PR fixes the Playwright PostgreSQL E2E gating logic for fork PR updates by ensuring safe to test invalidation/revalidation happens in a deterministic order and that the gate reads the reconciled labels for the current head SHA (so trusted forks can run on synchronize).
Changes:
- Move fork
safe to testinvalidation into theTeam Labelworkflow/job so it can invalidate then revalidate allowlisted authors in the same run. - Update the Playwright PostgreSQL gate to wait for the
Team Labelcheck and then read the current PR labels before computingshould_run. - Make
playwright-summarycheck naming depend on the gate result, so skipped sibling events don’t satisfy branch protection early.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/team-labeler.yml | Adds a fork-sync invalidation step ahead of the trusted-author labeler step. |
| .github/workflows/playwright-postgresql-e2e.yml | Waits for Team Label reconciliation, reads live labels, and uses the gate result for playwright-summary naming. |
| run: | | ||
| set -euo pipefail | ||
| gh api -X DELETE \ | ||
| "/repos/${REPO}/issues/${PR_NUMBER}/labels/safe%20to%20test" |
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
| echo "::warning::Fork sync detected; removing 'safe to test' label (re-apply after reviewing the new commits)." | ||
| gh api -X DELETE "/repos/${REPO}/issues/${PR_NUMBER}/labels/safe%20to%20test" \ | ||
| || echo "Label already absent" | ||
| labels=$(gh api "/repos/${REPO}/issues/${PR_NUMBER}" \ | ||
| --jq '[.labels[].name]') | ||
| echo "labels=$labels" >> "$GITHUB_OUTPUT" |
Code Review ✅ ApprovedHardens fork label reconciliation by reordering the fork safe to test invalidation into the Team Label job and updating the Playwright gate to read live PR labels. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
What changed
safe to testinvalidation into the Team Label job so invalidation and trusted-author revalidation are ordered.playwright-summarycheck name.Root cause
The PostgreSQL Playwright gate removed
safe to testand skipped every forksynchronizeevent. Team Label then restored the label for allowlisted authors withGITHUB_TOKEN, but GitHub intentionally does not launch another workflow for that bot-generatedlabeledevent. As a result, trusted fork updates never reached Playwright.This keeps approval SHA-scoped for untrusted forks while automatically revalidating authors listed under
safe to testin.github/teams.ymlon the existingsynchronizeevent.The MySQL + Elasticsearch workflow already waits for Team Label and verifies the live label, but it is currently disabled at the GitHub workflow level. After this fix merges, it will be re-enabled before #30484 is updated so both database/search variants exercise the corrected path.
Validation
actionlinton all three changed workflows, excluding the workflows' pre-existingallow-unsafe-pr-checkoutmetadata warningsuv run --with pytest python -m pytest -q .github/scripts/tests/test_playwright_ci_planning.py .github/scripts/tests/test_playwright_pr_comment.py— 59 passedgit diff --checkAfter merge, PR #30484 will be updated from
mainto exercise both PostgreSQL + OpenSearch and MySQL + Elasticsearch.This urgent CI regression fix uses the maintainer
skip-pr-checksbypass because it does not have a product issue.Greptile Summary
This PR hardens trusted-fork Playwright workflow coordination.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failures remain within the eligible follow-up scope.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Sync as Fork synchronize event participant Label as Team Label job participant API as GitHub API participant Gate as PostgreSQL gate participant Tests as Playwright jobs Sync->>Label: Start reconciliation for current head SHA Label->>API: Remove stale safe-to-test label Label->>Label: Revalidate allowlisted author Label->>API: Restore label when trusted Gate->>Label: Wait for Team Label check Gate->>API: Read live pull-request labels Gate->>Gate: Compute should_run alt should_run is true Gate->>Tests: Authorize Playwright execution else should_run is false Gate->>Tests: Publish skipped summary name endReviews (2): Last reviewed commit: "fix(playwright): harden fork label recon..." | Re-trigger Greptile