Skip to content

[NO-JIRA] Surface Percy silent failures as CI errors#4541

Open
Richard-Shen (RichardSyq) wants to merge 5 commits into
mainfrom
RichardSyq/percy-silent-failure-analysis
Open

[NO-JIRA] Surface Percy silent failures as CI errors#4541
Richard-Shen (RichardSyq) wants to merge 5 commits into
mainfrom
RichardSyq/percy-silent-failure-analysis

Conversation

@RichardSyq
Copy link
Copy Markdown
Contributor

Summary

  • Percy CLI exits 0 even when it fails internally (missing token, API errors, build not created), causing the PercyTests job to show success while actually failing silently
  • Added pre-validation of PERCY_TOKEN and post-run log inspection to exit 1 on known failure patterns
  • This ensures CI correctly shows a red cross when Percy cannot complete its work

What changed

The Percy Test step now:

  1. Checks PERCY_TOKEN is set before running — fails immediately if empty
  2. Captures Percy output and scans for known failure messages (Build not created, Failed to create build, Error:)
  3. Exits with code 1 if any failure is detected, surfacing it as a proper CI failure

Test plan

  • Verify normal Percy runs (with valid token) still pass
  • Verify that an empty/invalid PERCY_TOKEN causes the job to fail with a clear error message

🤖 Generated with Claude Code

Percy CLI exits 0 even when it fails internally (missing token, API
errors, build not created). This causes the PercyTests job to show
green while actually failing. Add pre-validation of PERCY_TOKEN and
post-run log inspection to exit 1 on known failure patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 22, 2026 08:40
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4541 to see this build running in a browser.

@RichardSyq Richard-Shen (RichardSyq) added the patch Patch production bug label May 22, 2026
@RichardSyq Richard-Shen (RichardSyq) changed the title [NO-JIRA][CI] Surface Percy silent failures as CI errors [NO-JIRA] Surface Percy silent failures as CI errors May 22, 2026
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4541 to see this build running in a browser.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4541 to see this build running in a browser.

Replace shell-based log parsing with Percy's built-in PERCY_RAISE_ERROR
env var, which causes Percy CLI to exit non-zero on internal errors
rather than silently succeeding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4541 to see this build running in a browser.

PERCY_RAISE_ERROR does not work for token/build-creation failures in
Percy CLI 1.31.x — the process still exits 0 even when it prints
"Build not created". Instead:

1. Pre-check that PERCY_TOKEN is non-empty
2. Use set -o pipefail to catch npm script failures
3. Grep for the definitive "[percy] Build not created" message

This is narrowly targeted at the exact failure pattern observed in CI
(Percy starts, processes snapshots, but cannot create the build).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@skyscanner-backpack-bot
Copy link
Copy Markdown

Visit https://backpack.github.io/storybook-prs/4541 to see this build running in a browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Patch production bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants