Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add percy exec flag to avoid failure for Percy-related issues #1590

Open
geoffharcourt opened this issue May 6, 2024 · 2 comments
Open

Add percy exec flag to avoid failure for Percy-related issues #1590

geoffharcourt opened this issue May 6, 2024 · 2 comments
Labels
✨ enhancement New feature or request

Comments

@geoffharcourt
Copy link

The problem

Sometimes if we have some infrastructure failures that result in certain kinds of retries we end up with an issue where we get one of these errors:

[percy] Error: Can only finalize pending builds, current state: finished

We tried the approach of closing our builds with percy build:finalize and it seemed like it created more problems in our builds than before.

Could there be a flag for percy exec so that if there's a Percy-related issue (like an already finalized build) that the wrapped process would continue? We don't want our whole CI pipeline to fail over an issue related to snapshots (but we'd still like the error output so that we could look into the problem).

I was envisioning something like:

percy exec --proceed-on-failure -- bundle exec rake specs

This way we'd see the errors/warnings about issues in the build, but issues with retried parallel jobs (or situations where Percy's API is out of service) would be less likely to cause the spec portion of our builds to fail.

Environment

  • Node version: 20
  • @percy/cli version: @percy/cli 1.28.5

Details

If necessary, describe the problem you have been experiencing in more detail.

@ninadbstack
Copy link
Contributor

We will be taking this as a feature request. Thanks for raising this.

@prklm10
Copy link
Contributor

prklm10 commented Jul 2, 2024

@geoffharcourt We have released CLI version v1.28.9-beta.1. You can set the environment variable PERCY_EXIT_WITH_ZERO_ON_ERROR=true. This will exit with code 0 on any Percy-related errors, and the error logs will be present.

Additionally, if the command passed in exec -- fails, it will not exit with code 0.

We will release a stable version of this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants