-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat: [auto-approve] add python sample dependency process #5002
Conversation
@@ -244,8 +244,30 @@ export function doesDependencyChangeMatchPRTitle( | |||
return false; | |||
} | |||
|
|||
export function doesDependencyAgainstRegexes( |
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.
Please add a jsdoc to describe what this is doing.
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.
Also, this could use a test if it's a re-usable helper
regexToInclude: RegExp[] | undefined, | ||
regexToExclude: RegExp[] | undefined |
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.
These could be optional
regexToInclude: RegExp[] | undefined, | |
regexToExclude: RegExp[] | undefined | |
regexToInclude?: RegExp[], | |
regexToExclude?: RegExp[] |
regexToInclude: RegExp[] | undefined, | ||
regexToExclude: RegExp[] | undefined | ||
): boolean { | ||
let doesDepIncludeRegexToInclude = true; |
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.
Is this correct? If there are no regexes, then this would return true?
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.
Exactly! If no regexes are provided, then there's no criteria to check the dependency against; so, it's trivially valid.
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.
Note: This is a lot of code to implement a new rule that shares much of its logic with other classes.
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.
Note: we are meeting today to discuss refactoring to make these much simpler in the future.
Fixes #4993
cc @kweinmeister