Skip to content
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

Merged
merged 5 commits into from
Nov 18, 2024
Merged

Workshop reviewer #134

merged 5 commits into from
Nov 18, 2024

Conversation

Tyouxik
Copy link
Collaborator

@Tyouxik Tyouxik commented Nov 18, 2024

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.

Pauline Didier added 2 commits November 18, 2024 08:38
Reviewer rules can be skipped based on conditions, and suggestions can be used in rules
return await condition(ruleArgs);
});
const results = await Promise.all(conditions);
console.log(`Conditional results: ${results}`);
Copy link
Member

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) {
Copy link
Member

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

Copy link
Member

@Tethik Tethik left a 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.

Pauline Didier added 2 commits November 18, 2024 15:28
@Tyouxik Tyouxik requested a review from Tethik November 18, 2024 14:33
@@ -91,4 +91,56 @@ describe("ValidationEngine", () => {

expect(Array.isArray(resultList)).toBe(true);
});

it("should select rules that have no conditions", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@Tyouxik Tyouxik merged commit a1ca636 into main Nov 18, 2024
1 check passed
@Tyouxik Tyouxik self-assigned this Nov 18, 2024
@Tyouxik Tyouxik deleted the workshop-reviewer branch November 28, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants