-
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
optionally return non-zero error code when function run sees error #401
base: main
Are you sure you want to change the base?
Conversation
src/main.rs
Outdated
Ok(()) | ||
} else { | ||
Err(anyhow!( | ||
"The Function execution failed. Review the logs for more information." |
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.
we could have printed the error message here but I felt that was just too noisy since its displayed right above
I think we stopped auto-updating in this PR, which was released in the 3.65.0 version on August 2. I wonder if that's enough time that it would be okay to ship this PR as the default behaviour. @nickwesselman Do you have an opinion on this? |
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.
Could we make a case for a breaking change for older versions of the Shopify CLI here? I would imagine we would want older versions of the CLI to error out in these cases. But if not, this seems fine.
|
||
/// Return a non-zero exit code when a module error occurs during the function run. | ||
#[clap(short = 'n', long)] | ||
non_zero_exit_code_for_module_errors: bool, |
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.
This seems like a pretty long flag name to me. Unfortunately I don't have a constructive suggestion for something more succinct.
I think it could be fair to make a case on that. It would make the changes here much nicer. I'll wait to see if Nick has an opinion there. |
fcde9f1
to
a59c72b
Compare
We want to support returning a non-zero error code anytime a module sees an error during a run. Unfortunately, since older versions of the Shopify CLI auto-update, we can't do this my default and make a breaking change. Instead, i opted to implement this change behind an option
--non-zero-exit-code-for-module-errors
. In the Shopify CLI, we can update new versions to start calling this flag.When the flag isn't provided, nothing changes. When it is provided, we return exit code 1. Heres an example output with the flag: