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

feat: [auto-approve] add python sample dependency process #5002

Merged
merged 7 commits into from
Mar 23, 2023

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Mar 16, 2023

Fixes #4993

cc @kweinmeister

@sofisl sofisl requested a review from a team as a code owner March 16, 2023 06:45
@sofisl sofisl changed the title feat: add python sample dependency feat[auto-approve]: add python sample dependency process Mar 16, 2023
@sofisl sofisl changed the title feat[auto-approve]: add python sample dependency process feat: [auto-approve] add python sample dependency process Mar 21, 2023
@@ -244,8 +244,30 @@ export function doesDependencyChangeMatchPRTitle(
return false;
}

export function doesDependencyAgainstRegexes(
Copy link
Contributor

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.

Copy link
Contributor

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

Comment on lines 249 to 250
regexToInclude: RegExp[] | undefined,
regexToExclude: RegExp[] | undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

These could be optional

Suggested change
regexToInclude: RegExp[] | undefined,
regexToExclude: RegExp[] | undefined
regexToInclude?: RegExp[],
regexToExclude?: RegExp[]

regexToInclude: RegExp[] | undefined,
regexToExclude: RegExp[] | undefined
): boolean {
let doesDepIncludeRegexToInclude = true;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@sofisl sofisl requested a review from chingor13 March 22, 2023 23:50
Copy link
Contributor

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

@sofisl sofisl merged commit 8323737 into main Mar 23, 2023
@sofisl sofisl deleted the addPythonSampleDependency branch March 23, 2023 18:55
@release-please release-please bot mentioned this pull request Aug 21, 2023
@release-please release-please bot mentioned this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[auto-approve] Add PythonSampleDependency process
3 participants