-
Notifications
You must be signed in to change notification settings - Fork 15
feat(ipa): error on unneeded exceptions IPA 005-104 #877
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
Conversation
| * @param {Array<string>} objectPath the JSON path to the object | ||
| * @returns {Array<{path: Array<string>, message: string}>|undefined} an array of the validation errors, or undefined if there are no errors | ||
| */ | ||
| export function collectExceptionAdoptionViolations(validationErrors, ruleName, object, objectPath) { |
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 am looking for a better function name, what about evaluateAndCollectAdoptionStatus or something like that?
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.
It might apply to the function below as well, if we are allowed to use same function name with different signature
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.
Agree the name is bad :) evaluateAndCollectAdoptionStatus sounds good!
No you can't have the same name with different params unfortunately, I'll name it evaluateAndCollectAdoptionStatusWithoutExceptions for now, it's a bit long but let me know what you think
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.
Sounds good to me, we'll change it later if we can find any better. Thanks!
yelizhenden-mdb
left a comment
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!
Proposed changes
This PR introduces a new helper function to handle all violations, exceptions and adoptions for a rule.
The idea is that when violations are collected in a rule, this function gets called to handle metric collection as well as silencing violations with exceptions.
Additionally, thing brings the functionality to error if there are no violations, but the component still has exceptions. This allows us to remove unnecessary exceptions in the OAS.
For now IPA 005-104 are updated using the new helper function. I'll adjust the other IPAs in incremental follow-up PRs to keep the PRs smaller.
Finally, I'll update the OAS and remove identified exceptions that are no longer needed + remove temporary Spectral overrides.
Jira ticket: CLOUDP-307585
Exceptions found that can be removed: