Repository navigation
ci(playwright): guard against lane-tag drops at PR time + better oversized-unit error - #30835
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 strengthens the Playwright shard planner’s PR-time validation to catch “lane tag dropped” regressions (where a spec silently routes to the wrong Playwright project/lane) and improves the oversized-unit failure message so developers get actionable remediation steps before merge-queue failures.
Changes:
- Adds a
FILE_LANE_HINTSconvention map plus a plan-time hard gate (misrouted_lane_hint_violations) that fails when a hinted filename routes to an unexpected project. - Rewrites the
oversized_unitsfailure to explicitly list the two common fixes (restore{ tag: '...' }vs. audit-splitting viaAUDITED_PARALLEL_SUITES). - Adds pytest coverage for the new lane-hint validation and the updated oversized-unit messaging.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/scripts/build_playwright_shards.py | Adds filename→expected-project hinting, a pre-oversized gate that hard-fails on misrouting, and improves the oversized-unit error copy with concrete remediation paths. |
| .github/scripts/tests/test_playwright_ci_planning.py | Adds unit + end-to-end tests covering misrouted lane hint detection and the updated oversized-unit error message content. |
| # Today `BulkImport*.spec.ts` and `*ImportExport*.spec.ts` uniformly carry | ||
| # `@import-export` (12 of 13 matching files as of writing; the 13th is the | ||
| # bug this guard catches). Add other conventions as they emerge — the entry | ||
| # shape is (filename regex, expected project name, expected tag literal). |
✅ Playwright Results — workflow succeededValidated commit ✅ 548 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 50m 57s ⏱️ Max setup 3m 24s · max shard execution 17m 46s · max shard-job elapsed before upload 21m 17s · reporting 5s 🌐 202.21 requests/attempt · 2.83 app boots/UI scenario · 18.39% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
…sized-unit error Two changes to make the tag-drop failure mode (PR #30834) actionable at PR time rather than a merge-queue plan failure. A. Improved `oversized_units` error message The existing gate correctly fires when any unit exceeds TARGET_MS, but the message ("refactor or explicitly audit them for parallel splitting") left developers guessing between two very different fixes. Rewrite it to spell out both: * Restore a `{ tag: '...' }` option that a recent edit dropped (points at FILE_LANE_HINTS and PR #30834 for the pattern). * Add the (file, describe_title) to AUDITED_PARALLEL_SUITES to split the describe into per-spec parallel units. B. FILE_LANE_HINTS — filename → expected project check A small mapping from filename regex → expected project + expected tag. At plan time, for every planned unit whose file matches a hint but whose project doesn't match the expected one, hard-fail with: Features/BulkImport.spec.ts: on `chromium` project, expected `ImportExport` (add `{ tag: '@Import-Export' }` to the top-level describe) This catches the exact PR #30834 pattern (a re-enable rewrote `test.describe.fixme('...', { tag: '@Import-Export' }, ...)` as `test.describe('...', ...)`, dropping the tag along with `.fixme`) at PR review time. Runs before the oversized-unit check so the developer gets the specific error, not the generic one. Seeded with one hint today — BulkImport*.spec.ts + *ImportExport*.spec.ts → `ImportExport` / `@import-export`. That matches 12 of the 13 files currently in the tree with those names; the 13th is the very bug this guard catches (see PR #30834). Add other conventions as they emerge. 7 new pytest cases cover the hint match, the ignore path, dedupe across audit-split units, the improved oversized message, and an end-to-end main() SystemExit reproduction of the tag-drop scenario. 71 total planner tests pass locally. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
b2b2090 to
0b8516a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/scripts/build_playwright_shards.py:708
- The
::error file=...::annotation here usesfileasFeatures/BulkImport.spec.ts, but GitHub Actions file annotations are resolved from the repo root (as you already handle in the stale-baseline gate withspec_root). Without prefixingopenmetadata-ui/src/main/resources/ui/playwright/e2e/, the error may not attach to the actual spec file in the Checks UI.
for file, actual, expected, tag in lane_violations:
print(
f"::error file={file}::planned under `{actual}` project but its "
f"filename convention expects `{expected}` (via `{tag}` tag). "
"The describe likely lost its tag option — see PR #30834.",
file=sys.stderr,
Code Review ✅ ApprovedAdds lane-tag guardrails and clearer oversized-unit error messages to the Playwright CI shard planner, preventing silent routing regressions at PR time. 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 | Powered by Gitar — free for open source |
…sized-unit error (open-metadata#30835) Two changes to make the tag-drop failure mode (PR open-metadata#30834) actionable at PR time rather than a merge-queue plan failure. A. Improved `oversized_units` error message The existing gate correctly fires when any unit exceeds TARGET_MS, but the message ("refactor or explicitly audit them for parallel splitting") left developers guessing between two very different fixes. Rewrite it to spell out both: * Restore a `{ tag: '...' }` option that a recent edit dropped (points at FILE_LANE_HINTS and PR open-metadata#30834 for the pattern). * Add the (file, describe_title) to AUDITED_PARALLEL_SUITES to split the describe into per-spec parallel units. B. FILE_LANE_HINTS — filename → expected project check A small mapping from filename regex → expected project + expected tag. At plan time, for every planned unit whose file matches a hint but whose project doesn't match the expected one, hard-fail with: Features/BulkImport.spec.ts: on `chromium` project, expected `ImportExport` (add `{ tag: '@Import-Export' }` to the top-level describe) This catches the exact PR open-metadata#30834 pattern (a re-enable rewrote `test.describe.fixme('...', { tag: '@Import-Export' }, ...)` as `test.describe('...', ...)`, dropping the tag along with `.fixme`) at PR review time. Runs before the oversized-unit check so the developer gets the specific error, not the generic one. Seeded with one hint today — BulkImport*.spec.ts + *ImportExport*.spec.ts → `ImportExport` / `@import-export`. That matches 12 of the 13 files currently in the tree with those names; the 13th is the very bug this guard catches (see PR open-metadata#30834). Add other conventions as they emerge. 7 new pytest cases cover the hint match, the ignore path, dedupe across audit-split units, the improved oversized message, and an end-to-end main() SystemExit reproduction of the tag-drop scenario. 71 total planner tests pass locally. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Two changes so the tag-drop failure mode from #30834 (a re-enable dropped
{ tag: '@import-export' }along with.fixme, silently routing the whole suite to chromium) fails at PR time with an actionable error instead of a merge-queue plan failure.A — improved
oversized_unitserror messageThe existing gate at
build_playwright_shards.py:oversized_unitscorrectly fires when any unit exceedsTARGET_MS, but the message ("refactor or explicitly audit them for parallel splitting") left developers guessing between two very different fixes. Rewrite it to spell out both remediation paths:{ tag: '...' }option that a recent edit dropped (points atFILE_LANE_HINTSand fix(playwright): route BulkImport back to import-export lane and audit-split the atomic describe #30834 for the pattern).(file, describe_title)toAUDITED_PARALLEL_SUITESto split the describe into per-spec parallel units.B —
FILE_LANE_HINTSfilename → expected-project checkSmall mapping from filename regex → expected project + expected tag. For every planned unit whose file matches a hint but whose project doesn't match, hard-fail with:
Runs before the oversized-unit check so the developer gets the specific error, not the generic one.
The initial hint
Seeded with one entry today:
That matches 12 of 13 files with those names currently in the tree — every one carries
@import-exporttoday exceptFeatures/BulkImport.spec.ts, which is the bug this guard would have caught. Adding other conventions (domain-isolation, reindex, etc.) is a one-line edit each.Verified
test_misrouted_lane_hint_violations_*,test_main_fails_on_misrouted_lane_hint,test_oversized_units_error_names_both_common_fixes).matrix.jsonwritten.Test plan
TARGET_MSfor a different reason (not a tag drop) gets the improved "Common fixes" message with both remediation paths.Related: #30812 (planner all-zero-history fix), #30813 (plan-time warning), #30827 (stale-baseline gate), #30834 (the bug this guards against).
🤖 Generated with Claude Code