-
Notifications
You must be signed in to change notification settings - Fork 552
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
fix: handle errors from /share-results [CFG-2028] #3454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this :)
no problem. could you have another look, just added a 2nd commit, I think we should be throwing an error for anything non 200ish - like this: 44381fc what do you think? |
src/cli/commands/test/iac/local-execution/process-results/cli-share-results.ts
Outdated
Show resolved
Hide resolved
sounds like a good idea |
d160c84
to
f969812
Compare
f969812
to
5871079
Compare
What does this PR do?
While investigating https://snyk.zendesk.com/agent/tickets/26894, we noticed that client errors (e.g. HTTP 422) from the IaC share-results endpoint are not communicated to the CLI caller at all.
Example error returned in prod-registry that is not surfaced to users (example with non english chars in tag, but this can be caused by any non Az09 characters):
snyk iac test test/fixtures/iac/terraform/var_deref/nested_var_deref/ --project-tags=client=nαδαδσδαomnom,Team=Cloud --report
Users should see the error in the CLI’s output so that they know they need to do something in order to record project results, otherwise the problem might go un-noticed for some time. The silence can also lead users to believe that it is a backend error, and not an input error.
We will not print the specific validation error as part of this PR - this code is to be refactored in the next weeks so we will re-write this again.
This PR updates the call to share-results to handle all 500 errors (that's what we wrap them with in Registry).
before - the error was silent for the invalid tag:
after