Skip to content

ci(playwright): stop the plan step discarding the checked-in timing baseline - #32080

Closed
ShaileshParmar11 wants to merge 2 commits into
open-metadata:mainfrom
ShaileshParmar11:claude/ci-plan-history-baseline
Closed

ShaileshParmar11 wants to merge 2 commits into
open-metadata:mainfrom
ShaileshParmar11:claude/ci-plan-history-baseline

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Blocked by #31898, which carries the build_playwright_shards.py change this depends on. Merging this first would leave a zero-artifact run with no history at all.

The bug

The Build duration-aware shard plans step builds history_args from the downloaded full-run artifacts and reaches for the checked-in baseline only when that array comes out empty:

if [[ ${#history_args[@]} -eq 0 ]]; then
  history_args=(--history .github/playwright/timing-baseline.json)
fi

gh run download prints nothing on success, so a run can log 49 failures across its 50 candidates, quietly succeed on the 50th, and discard the baseline on the strength of that one artifact.

Everything already covered by an artifact is unaffected, which is why this went unnoticed. The only entries that exist solely in the baseline are the ones an author seeds for a brand-new spec file — exactly as the stale-baseline gate's own error text instructs:

Seed the observed durations for these files into .github/playwright/timing-baseline.json (see PR #30812 for the pattern…)

Those seeded timings were dropped, and the gate then failed the plan for a file that did have history. Net effect: a brand-new spec file is unseedable whenever any full-history artifact is available, which is most of the time.

Evidence

#31898 hit this twice — runs 32933633223 and 32937328644, both 49/50 download failures. The artifact they used, from run 32653484382, carries 4504 tests and none of the new file's.

Replaying run 32937328644's own selection with only its artifact as history:

planner input result
artifact only, before #31898's script change exit 1 — the reported failure
artifact only, after it exit 0

Planning that same selection minus the new spec produces byte-identical shard plans either way, so nothing the artifacts already cover moves.

The change

build_playwright_shards.py now folds the baseline in itself, at lower precedence than anything passed via --history. That makes the fallback here not merely redundant but harmful: it re-introduces the baseline as a peer of the artifacts, diluting the p75 those weights are built from. Drop it, and log how many artifacts actually resolved so the next person can see at a glance what fed the planner.

🤖 Generated with Claude Code

Greptile Summary

The PR updates Playwright shard planning so downloaded timing artifacts are passed as higher-precedence history while the planner supplies the checked-in baseline itself.

  • Removes the workflow-level fallback that passed the baseline as a peer history source.
  • Logs the number and arguments of downloaded timing-history artifacts.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/workflows/playwright-e2e-reusable.yml Removes the redundant baseline fallback and adds artifact-source logging; the planner at current HEAD backfills the checked-in baseline beneath artifact history.

Reviews (3): Last reviewed commit: "Merge branch 'main' into claude/ci-plan-..." | Re-trigger Greptile

@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 26, 2026
Comment on lines +710 to +719
# No baseline fallback here on purpose. `gh run download` above is
# silent on success, so "we got zero artifacts" is not something this
# step can tell by eye, and gating the baseline on an empty
# history_args meant one successful download discarded it -- taking
# every newly seeded spec file with it. build_playwright_shards.py
# now folds .github/playwright/timing-baseline.json in itself, at
# lower precedence than anything passed here.
echo "history sources: ${#history_args[@]} artifact(s) + the checked-in baseline"
if [[ ${#history_args[@]} -gt 0 ]]; then
printf ' %s\n' "${history_args[@]}"

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 Workflow authorization not recorded

This changes executable logic under .github/workflows/** without recording the repository-required CLAUDE_ALLOW_WORKFLOW_EDITS=1 authorization, preventing reviewers from verifying that the supply-chain safeguard was observed.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…aseline

The step built `history_args` from the downloaded full-run artifacts and
reached for `.github/playwright/timing-baseline.json` only when that
array came out empty. `gh run download` prints nothing on success, so a
run could log 49 failures across its 50 candidates, quietly succeed on
the 50th, and drop the baseline on the strength of that one artifact.

Everything already covered by an artifact was unaffected, which is why
this went unnoticed: the only entries that exist solely in the baseline
are the ones an author seeds for a brand-new spec file, exactly as the
stale-baseline gate's error text tells them to. Those were discarded, and
the gate then failed the plan for a file that did have history — so a new
spec file was unseedable whenever any artifact was available, which is
most of the time. PR open-metadata#31898 hit this twice (runs 32933633223 and
32937328644).

build_playwright_shards.py now folds the baseline in itself at lower
precedence than anything passed via --history, so the fallback here is
not just redundant but actively harmful — it re-introduces the baseline
as a peer of the artifacts, diluting the p75 those weights are built
from. Drop it, and log how many artifacts actually resolved so the next
person can see at a glance what fed the planner.

Blocked by open-metadata#31898, which carries the build_playwright_shards.py change.
Merging this first would leave a zero-artifact run with no history at
all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs and removed safe to test Add this label to run secure Github workflows on PRs labels Aug 26, 2026
@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates the Playwright CI workflow to prevent plan steps from discarding the checked-in timing baseline when partial artifacts exist. 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

@ShaileshParmar11

Copy link
Copy Markdown
Contributor Author

Closing — not needed.

The actual bug (a newly added spec file's seeded timings being discarded whenever any full-history artifact downloaded) is already fixed on main by the build_playwright_shards.py backfill that landed with #31898. The planner now folds .github/playwright/timing-baseline.json in itself, below anything passed via --history, so every PR can seed timings for a new spec file today.

That leaves this PR as cleanup only, and one of its stated justifications does not hold. The description argued that keeping the fallback "re-introduces the baseline as a peer of the artifacts, diluting the p75". That is wrong: the fallback only fires when history_args is empty — i.e. when there are zero artifacts — so the baseline can never sit alongside them. Verified by replaying the same selection with the fallback kept vs removed: byte-identical shard plans. The fallback is redundant, not harmful.

The one piece here with lasting value is the history sources: N artifact(s) + the checked-in baseline log line — gh run download is silent on success, so nothing currently records what actually fed the planner, which is most of why the original bug took so long to find. Worth re-proposing on its own if anyone wants it; not worth a review cycle bundled with dead-code removal.

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.

1 participant