-
Notifications
You must be signed in to change notification settings - Fork 14
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
Workshop reviewer #134
Workshop reviewer #134
Conversation
Reviewer rules can be skipped based on conditions, and suggestions can be used in rules
core/src/validation/engine.ts
Outdated
return await condition(ruleArgs); | ||
}); | ||
const results = await Promise.all(conditions); | ||
console.log(`Conditional results: ${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.
Should not use console.log, use the logger instead (look for getLogger
in the code)
// Validate model | ||
for (const rule of modelRules) { | ||
if (!isModelValidation(rule)) { | ||
continue; | ||
} | ||
|
||
if (rule.conditionalRules && rule.conditionalRules.length > 0) { |
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.
Missing tests to cover this new functionality
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.
Feel free to also remove the snapshot tests.
also skips all snapshots
@@ -91,4 +91,56 @@ describe("ValidationEngine", () => { | |||
|
|||
expect(Array.isArray(resultList)).toBe(true); | |||
}); | |||
|
|||
it("should select rules that have no conditions", async () => { |
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 PR adds the possibility to skip a reviewer rule with conditions build with the model data.
It also provides rules with access to control and threat suggestions.