Skip to content

Summarize visual regression failures on pull requests - #1188

Merged
danbarr merged 4 commits into
mainfrom
summarize-visual-failures
Oct 1, 2026
Merged

danbarr merged 4 commits into
mainfrom
summarize-visual-failures

Conversation

@danbarr

@danbarr danbarr commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Post a compact, sticky pull request comment when Playwright visual regression tests fail. The comment groups light and dark failures by screen, reports the route, viewport, changed-pixel count, and ratio, and links directly to the failed job and complete Playwright artifact. A later run updates the same comment, and a passing visual run removes it.

The read-only pull request job remains unchanged. The trusted workflow_run follow-up downloads and validates the artifact, checks that the run still matches the current pull request head, sanitizes artifact-derived text, and executes only the helper script from the trusted base revision.

The parser was replayed against the artifact from run 36173514905 and produced this summary row:

Screen Route Viewport Difference
nav page - AI Gateway /ai-gateway Desktop Light: 643 pixels (ratio 0.01)

Inline before/after images remain deferred until generated images have a suitable hosting location.

Type of change

  • Bug fix (typo, broken link, etc.)

Related issues/PRs

Screenshots

Not applicable.

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Copilot AI balanced review requested due to automatic review settings October 1, 2026 08:00
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-website Ready Ready Preview Oct 1, 2026 10:49am UTC

Request Review

@danbarr

danbarr commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

/update-snapshots

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.

Copilot review overview

🟡 Changes recommended

Artifact validation occurs after extraction, and metadata is read from the base revision instead of the tested PR head.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds sticky PR comments summarizing failed Playwright visual regression tests.

Changes:

  • Resolves failed visual jobs and downloads their artifacts.
  • Parses, sanitizes, groups, and publishes failure details.
  • Adds unit tests and contributor documentation.
File Description
.github/​workflows/​pr-screenshot-summary.yaml Integrates failure-comment generation.
.github/​scripts/​update_visual_failure_comment.py Parses artifacts and manages comments.
.github/​scripts/​test_update_visual_failure_comment.py Tests parsing, rendering, and comment updates.
tests/​visual/​README.md Documents failure comments.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/pr-screenshot-summary.yaml Outdated
Comment thread .github/scripts/update_visual_failure_comment.py Outdated
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

📸 Regenerated visual baselines per your /update-snapshots request and pushed a new commit.

@danbarr
danbarr merged commit af00c74 into main Oct 1, 2026
5 of 6 checks passed
@danbarr
danbarr deleted the summarize-visual-failures branch October 1, 2026 14:07

This branch was successfully deployed

1 active deployment
Preview — d105bd97 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants