Skip to content

Fix visual failure reporting and unstable captures - #1296

Merged
danbarr merged 3 commits into
mainfrom
fix-visual-failure-comment
Oct 30, 2026
Merged

danbarr merged 3 commits into
mainfrom
fix-visual-failure-comment

Conversation

@danbarr

@danbarr danbarr commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The artifact-selection query added in #1289 uses jq's update assignment (|=), which evaluates its right-hand side against the artifacts array. The nested .artifacts[] access then fails, so the failure-comment step receives no visual-job conclusion and crashes. This prevented a comment on #1295 even though its compact failure artifact was available.

Use ordinary assignment (=) to select the compact artifact from the response object. Publish the visual-job conclusion and URL before artifact discovery so a discovery or parsing failure still allows the existing fallback comment. Add CI tests that execute the actual workflow shell step with representative GitHub API responses, covering compact selection, expired artifacts, missing artifacts, API failures, malformed JSON, and reruns. Only artifacts created during the current visual job are eligible, so earlier attempts cannot supply stale failure details.

Capture the theme-preview page in separate light and dark page loads, with the color scheme selected before navigation and both Mermaid diagrams rendered before the screenshot. This avoids measuring page height during an asynchronous theme-change render. Restore the complete dark baseline from before #1288; it is byte-for-byte identical to #1296's latest CI retry, whereas the intervening baseline was truncated. Update the snapshot metadata to name the separate test cases.

Validation: the updated CI run passed all 12 visual tests without retries. The new workflow-step suite reproduces the original query failure and all ten tests pass with the fix; the three description-updater tests and 15 failure-comment tests pass. Replayed #1295's real 21 KB artifact and recovered all three failure rows. TypeScript checking, production build, focused ESLint and Prettier, git diff --check, and offline zizmor pass. Local actionlint passes after normalizing the existing $/ syntax for its older parser. Live comment delivery requires merging this fix and rerunning #1295's On PR workflow to trigger a fresh summary run. Rerunning the old summary run would reuse its original workflow revision.

Type of change

  • Bug fix

Related issues/PRs

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 30, 2026 17:13
@vercel

vercel Bot commented Oct 30, 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 30, 2026 5:35pm UTC

Request Review

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.

🟡 Changes recommended

On reruns, the screenshot summary can select an artifact from an earlier attempt and post stale failures instead of the current job’s fallback.

1 open issue
What changed in this PR

Fixes artifact selection in ToolHive’s screenshot-summary workflow so visual regression failures can produce PR comments, with fallback information preserved when artifact discovery fails.

Changes:

  • Corrects the jq assignment used to prefer compact failure artifacts.
  • Publishes the visual-job conclusion and URL before artifact discovery.
  • Adds five workflow-step regression tests and includes them in CI.
File Description
scripts/​pr-screenshot-workflow.test.mjs Tests artifact selection, expiration, missing artifacts, and discovery failures.
.github/​workflows/​pr-screenshot-summary.yaml Fixes artifact selection and preserves outputs needed for fallback comments.
.github/​workflows/​_static-checks.yaml Runs the new workflow tests alongside screenshot-summary helper tests.

Review effort: Balanced

@danbarr danbarr changed the title Fix visual failure comment artifact selection Fix visual failure reporting and unstable captures Oct 30, 2026
@danbarr
danbarr merged commit 76acdf7 into main Oct 30, 2026
11 of 13 checks passed
@danbarr
danbarr deleted the fix-visual-failure-comment branch October 30, 2026 19:50

This branch was successfully deployed

1 active deployment
Preview — 8d0ba1fa Deployed Oct 30, 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