-
Notifications
You must be signed in to change notification settings - Fork 10
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(RELEASE-1108): improve error messaging #166
Conversation
scoheb
commented
Aug 19, 2024
•
edited
Loading
edited
- capture the error message when validating.
- capture the error message when validating. Signed-off-by: Scott Hebert <[email protected]>
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.
Why doesn't this work as is? jq -e
is supposed to fail if the key isn't found
Yes. 'jq -e' does do that...but all that gets transferred via the trap would be "exit 1" as the error message. This way we detect the error silently via the " == null " and then write a nice error message to the stderr file and then exit. The contents is the stderr file is what is used to relay back to the user in the release pipeline and in this case is a better UX |
Wouldn't the existing code do that with just the addition of |
It works great here https://github.com/hacbs-release/app-interface-deployments/blob/main/internal-services/catalog/pulp-push-disk-images-task.yaml#L163 so I am not sure why we need a new style with additional if checks here |
When I tested this, it did not work. I can show you my test script and it's output later... |
The reason why it doesn't work isn't the |
Consider this script that mimics
when it executes, /tmp/stderr.txt is empty We'd have to amend it with a
|
I am not following.
|
/retest |
a363017
to
834ebf3
Compare
Thanks for setting me straight. I was initially swayed with the fact that the python script were not logging to stdout. I think this looks better now |
- revert to original method with change in redirection for function Signed-off-by: Scott Hebert <[email protected]>