Refactor configuration errors#2105
Merged
angelapwen merged 17 commits intogithub:mainfrom Feb 8, 2024
Merged
Conversation
3bcce67 to
7837cc7
Compare
nickfyson
reviewed
Jan 30, 2024
Contributor
nickfyson
left a comment
There was a problem hiding this comment.
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...
nickfyson
reviewed
Jan 31, 2024
2d5e89c to
e8fcc9e
Compare
aeisenberg
reviewed
Feb 2, 2024
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
Contributor
Author
|
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 😸
|
nickfyson
reviewed
Feb 7, 2024
Contributor
nickfyson
left a comment
There was a problem hiding this comment.
I like the direction, couple of small queries!
nickfyson
approved these changes
Feb 8, 2024
8 tasks
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
FeatureConfigRecordthat 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
UserErrortype toConfigurationErrorto standardize on a single term.Merge / deployment checklist