Skip to content

ci(playwright): guard against lane-tag drops at PR time + better oversized-unit error - #30835

Merged
chirag-madlani merged 1 commit into
mainfrom
ci/planner-lane-hints-and-better-errors
Aug 4, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
ci/planner-lane-hints-and-better-errors

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

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_units error message

The existing gate at build_playwright_shards.py:oversized_units 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 remediation paths:

B — FILE_LANE_HINTS filename → expected-project check

Small 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:

::error file=Features/BulkImport.spec.ts::planned under `chromium` project but its
filename convention expects `ImportExport` (via `@import-export` tag). The describe
likely lost its tag option — see PR #30834.

Playwright spec files are routed to the wrong project. Each file below matches a
FILE_LANE_HINTS pattern that expects a specific tag on its top-level describe, but
the tag is missing so the suite falls through to another project.

  Features/BulkImport.spec.ts: on `chromium` project, expected `ImportExport`
  (add `{ tag: '@import-export' }` to the top-level describe)

To fix, restore the expected `{ tag: '...' }` option on the describe. If this file
was intentionally moved off its dedicated lane, update FILE_LANE_HINTS in
.github/scripts/build_playwright_shards.py.

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:

(re.compile(r"(?:^|/)(?:BulkImport|[^/]*ImportExport)[^/]*\.spec\.ts$"),
 "ImportExport", "@import-export"),

That matches 12 of 13 files with those names currently in the tree — every one carries @import-export today except Features/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 plan

  • Merge-queue plan step on a PR that reintroduces the tag-drop (or the initial BulkImport regression) fails with the specific FILE_LANE_HINTS error.
  • Merge-queue plan step on healthy PRs succeeds unchanged — the hint check is a no-op when routing matches.
  • Merge-queue plan step on a PR whose spec exceeds TARGET_MS for 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

Copilot AI review requested due to automatic review settings August 3, 2026 05:55
@github-actions

github-actions Bot commented Aug 3, 2026

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 3, 2026

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.

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_HINTS convention 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_units failure to explicitly list the two common fixes (restore { tag: '...' } vs. audit-splitting via AUDITED_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.

Comment on lines +104 to +107
# 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).
pmbrull
pmbrull previously approved these changes Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 0b8516a19ec9f19cbedc8fe6bdbfe52e9acb23e1 in Playwright run 30829771865, attempt 1.

✅ 548 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 3 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) 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:

  • Common shard skew was 18.39% (convergence target: at most 15%).
  • Browser traffic was 202.21 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1623 boots / 573 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 119 0 1 0 0 0
✅ Shard chromium-02 139 0 0 0 0 0
🟡 Shard chromium-03 139 0 1 3 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 10 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Domain Propagation (shard chromium-01, 1 retry)
  • Pages/Entity.spec.ts › Domain Propagation (shard chromium-03, 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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-08-03T12:15:04Z)

The entry left the queue before it was built, so no checks ran against it.

…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]>
Copilot AI review requested due to automatic review settings August 3, 2026 15:55
@chirag-madlani
chirag-madlani force-pushed the ci/planner-lane-hints-and-better-errors branch from b2b2090 to 0b8516a Compare August 3, 2026 15:55

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.

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 uses file as Features/BulkImport.spec.ts, but GitHub Actions file annotations are resolved from the repo root (as you already handle in the stale-baseline gate with spec_root). Without prefixing openmetadata-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,

@chirag-madlani
chirag-madlani added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit 82afe5b Aug 4, 2026
74 of 75 checks passed
@chirag-madlani
chirag-madlani deleted the ci/planner-lane-hints-and-better-errors branch August 4, 2026 06:59
@gitar-bot

gitar-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

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

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

k-anshul pushed a commit to k-anshul/OpenMetadata that referenced this pull request Aug 12, 2026
…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]>

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.

3 participants