-
Notifications
You must be signed in to change notification settings - Fork 71
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
chore: remove all asserts in source code, replace with error for internal exceptions, and InvalidDirectiveExceptions for input errors #765
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.
LGTM. Left few comments.
…rnal exceptions, and InvalidDirectiveExceptions for input errors
b0b7693
to
9a4f620
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.
LGTM
Codecov Report
@@ Coverage Diff @@
## main #765 +/- ##
==========================================
+ Coverage 63.14% 63.39% +0.24%
==========================================
Files 278 278
Lines 18125 18220 +95
Branches 4375 4431 +56
==========================================
+ Hits 11445 11550 +105
+ Misses 6093 6074 -19
- Partials 587 596 +9
📣 We’re building smart automated test selection to slash your CI/CD build times. 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.
Looks Good. Nice to have these changes put in!
* @param ctx the cli invocation context | ||
* @returns the constructed sort field, or null if no sort field can be created | ||
*/ | ||
export const tryAndCreateSortField = ( |
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.
appreciate this refactor!
Description of changes
Today, we have a number of
assert
statements in source which we shouldn't do. This PR replaces those with eitherError
s for faults, orInvalidDirectiveExceptions
where invalid input is caught, to provide better visibility into operator error vs bugs.Issue #, if available
N/A
Description of how you validated changes
I would have like to add more unit tests, but given the surface area of the change that was slowing me down, so I'm relying on e2e tests to verify all use-cases here.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.