-
Notifications
You must be signed in to change notification settings - Fork 338
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
Refactor configuration errors #2105
Conversation
3bcce67
to
7837cc7
Compare
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.
I really like the direction, I think it makes a lot of sense to consolidate this class of errors and their handling into a single place. I've added a couple of comments/questions...
2d5e89c
to
e8fcc9e
Compare
As we add more configuration errors, we can standardize throwing and catching them in the `codeql` file where we actually invoke the commands. Also, rename to `isCliConfigurationError` for more clarity.
To maintain parity with the previous logic: only 1 of the 2 conditions needs to hold: either the exit codes match, or the error messages match.
And all associated methods/comments that say `user error`
Now that we are always appending the original error, this test needs to be updated.
e7bd740
to
a6cb48e
Compare
Okay.. the refactoring based off of the feedback took a bit longer/was more complex than expected, but I think I'm happy with the results 😸
|
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.
I like the direction, couple of small queries!
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.
🚀
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.
🚀
As we add more configuration errors to improve our uptime measurements, I thought it would be nice to refactor the existing errors into their own file. I took inspiration from the
FeatureConfig
Record
that we use for feature flags.Also, I thought it would be nice to consolidate the place we check for configuration errors into
codeql.ts
, where the actual command invocations happen.The PR also renames the
UserError
type toConfigurationError
to standardize on a single term.Merge / deployment checklist