Skip to content

ci(playwright): give the visual baselines a way to be re-recorded - #33650

Closed
chirag-madlani wants to merge 1 commit into
mainfrom
fix/visual-regression-snapshot-refresh
Closed

chirag-madlani wants to merge 1 commit into
mainfrom
fix/visual-regression-snapshot-refresh

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Why

The visual baselines are PNGs rendered by the pinned Linux Playwright image, so they cannot be regenerated on a contributor's machine — a macOS screenshot differs everywhere text is antialiased. There was no way to re-record them in CI either, so a baseline that legitimately goes stale (the page really did change) could only be fixed by hand-editing a binary. In practice it stays red, and a suite that is always red stops being read.

data-quality.png is in that state now — 16708 pixels, 2% of the image. I pulled the diff artifact to check it isn't noise:

  • "Data Dimensions" and its description render 55px lower than the baseline
  • the Data Assets Coverage donut carries different counts

So the recording predates a change that really happened.

What

workflow_dispatch gains an update_snapshots boolean. When set, the suite runs with --update-snapshots instead of comparing, and the re-recorded __snapshots__/** are uploaded as an artifact.

It deliberately does not push. Accepting a baseline is a judgement about whether the new rendering is the intended one — that belongs to whoever reviews the diff, not to the job that produced it.

One step with one flag rather than a second if:-gated step, so the recorded run is identical to the comparing run in every other respect.

Usage

Actions → playwright-visual-regression → Run workflow → tick update_snapshots → download visual-regression-baselines → commit.

Related

#33648 narrows this workflow's paths filter so it stops firing on PRs that only change Playwright specs — which is how data-quality.png went stale unnoticed in the first place: almost nothing triggers this suite, so test-only PRs were the only ones seeing it.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the manual recording path is isolated from normal comparison runs and uploads the expected baseline files.

Summary

This PR adds an opt-in manual workflow mode for regenerating visual-regression baselines in the pinned Playwright container.

  • Adds a boolean workflow_dispatch input.
  • Passes --update-snapshots only when the input is enabled.
  • Uploads regenerated snapshot PNGs as a retained artifact without pushing repository changes.

Reviews (1) · Last reviewed commit: "ci(playwright): give the visual baseline..."

The baselines are PNGs rendered by the pinned Linux Playwright image, so they
cannot be regenerated on a contributor's machine: a macOS screenshot differs
from this one everywhere text is antialiased. There was no way to re-record them
in CI either, so a baseline that legitimately goes stale — the page really did
change — could only be fixed by hand-editing a binary. In practice it stays red,
and a suite that is always red stops being read.

`data-quality.png` is there now: 16708 pixels, 2% of the image. The diff is not
noise, it is the page. "Data Dimensions" renders 55px lower than the baseline and
the coverage donut carries different counts, so the recording predates a change
that really happened.

`workflow_dispatch` gains an `update_snapshots` flag that re-records instead of
comparing and uploads the result as an artifact. It deliberately does not push:
accepting a baseline is a judgement about whether the new rendering is the
intended one, which belongs to whoever reviews the diff, not to the job that
produced it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@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 Sep 20, 2026
@gitar-bot

gitar-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk

Adds a workflow_dispatch flag to re-record visual baselines in CI using --update-snapshots, uploading the refreshed snapshots as an artifact without pushing them. This allows stale baselines like data-quality.png to be regenerated on the pinned Linux Playwright image and reviewed before acceptance. No issues found.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 0f2a968b9c6a656e602ddc67851a2bfd59890141 in Playwright run 35490825305, attempt 2.

✅ 557 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 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) 2h 23m 45s

⏱️ Max setup 4m 23s · max shard execution 18m 34s · max shard-job elapsed before upload 22m 5s · reporting 5s

🌐 230.89 requests/attempt · 2.23 app boots/UI scenario · 22.53% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 22.53% (convergence target: at most 15%).
  • Browser traffic was 230.89 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.23 per UI scenario (1291 boots / 578 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 121 0 0 0 0 0
✅ Shard chromium-02 132 0 0 0 0 0
✅ Shard chromium-03 146 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 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 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

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

@chirag-madlani

Copy link
Copy Markdown
Collaborator Author

Discarding this in favour of a real fix — the premise was wrong.

I claimed the baselines could not be regenerated outside CI. They can: CI runs the suite inside mcr.microsoft.com/playwright:v1.57.0-jammy, and running that same image locally against a dev server produces a byte-comparable PNG. No workflow input is needed, and adding one would have papered over the actual bug.

Which is this: data-quality.png was recorded mid-load. The committed baseline is the page's skeleton placeholders. The test only passed while the next run was equally slow.

Replaced by #33655 — waits for skeletons, masks the environment-dependent donut counts, and re-records the baseline in the CI image.

@chirag-madlani
chirag-madlani deleted the fix/visual-regression-snapshot-refresh branch September 20, 2026 10:47

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