-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Expand pr bot to python #21791
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
Expand pr bot to python #21791
Changes from all commits
a128452
81d5fdf
4f30a00
ed0cb2e
34e5a31
7c528ef
7b830d2
57aa3ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,21 +39,30 @@ import { CheckStatus } from "./shared/checks"; | |
| * 4) Are closed | ||
| * 5) Have already been processed | ||
| * 6) Have notifications stopped | ||
| * 7) The pr doesn't contain the go label (temporary). TODO(damccorm) - remove this when we're ready to roll this out to everyone. | ||
| * 7) The pr doesn't contain the go or python labels (temporary). TODO(damccorm) - remove this when we're ready to roll this out to everyone. | ||
| * 8) The pr happens after the date we turn on the automation. TODO(damccorm) - remove this once this has been rolled out for a while. | ||
| * unless we're supposed to remind the user after tests pass | ||
| * (in which case that's all we need to do). | ||
| */ | ||
| function needsProcessed(pull: any, prState: typeof Pr): boolean { | ||
| if (!pull.labels.find((label) => label.name.toLowerCase() === "go")) { | ||
| if ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re item 6) above : for my education, what does it mean to have notifications stopped?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anytime a reviewer manually requests review (e.g. Fixed the comment |
||
| !pull.labels.find( | ||
| (label) => | ||
| label.name.toLowerCase() === "go" || | ||
| label.name.toLowerCase() === "python" | ||
| ) | ||
| ) { | ||
| console.log( | ||
| `Skipping PR ${pull.number} because it doesn't contain the go label` | ||
| `Skipping PR ${pull.number} because it doesn't contain the go or python labels` | ||
| ); | ||
| return false; | ||
| } | ||
| const firstPrToProcess = new Date(2022, 2, 2, 20); | ||
| const firstPrToProcess = new Date(2022, 5, 16, 14); // June 16 2022, 14:00 UTC (note that Java months are 0 indexed) | ||
| const createdAt = new Date(pull.created_at); | ||
| if (createdAt < firstPrToProcess) { | ||
| if ( | ||
| createdAt < firstPrToProcess && | ||
| !pull.labels.find((label) => label.name.toLowerCase() === "go") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to exclude
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're excluding go because we don't want it to be skipped ever. Its worth noting that this would retroactively apply to in flight prs, even if the PR bot has already taken some action on them, so without this exclusion this would break the flow on all in-flight PRs. Functionally, the biggest implication would be that if its been assigned to a non-committer and that non-committer approves it won't get auto-routed to a committer |
||
| ) { | ||
| console.log( | ||
| `Skipping PR ${pull.number} because it was created at ${createdAt}, before the first pr to process date of ${firstPrToProcess}` | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,8 +136,14 @@ async function processPrUpdate() { | |
|
|
||
| // TODO(damccorm) - remove this when we roll out to more than go | ||
| const existingLabels = payload.issue?.labels || payload.pull_request?.labels; | ||
| if (!existingLabels.find((label) => label.name.toLowerCase() === "go")) { | ||
| console.log("Does not contain the go label - skipping"); | ||
| if ( | ||
| !existingLabels.find( | ||
| (label) => | ||
| label.name.toLowerCase() === "go" || | ||
| label.name.toLowerCase() === "python" | ||
| ) | ||
| ) { | ||
| console.log("Does not contain the go or python labels - skipping"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for my education, where can these logs be inspected?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The actions console for the run - https://github.com/apache/beam/actions/workflows/pr-bot-new-prs.yml |
||
| return; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.