Skip to content

Commit

Permalink
Turn pr bot on for remaining common labels
Browse files Browse the repository at this point in the history
  • Loading branch information
damccorm committed Jul 13, 2022
1 parent 2c8e7eb commit 53c3ffb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
21 changes: 21 additions & 0 deletions .github/REVIEWERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,25 @@ labels:
- pabloem
- y1chi
exclusionList: []
- name: Java
reviewers:
- lukecwik
- kennknowles
- robertwb
- kileys
- apilloud
exclusionList: []
- name: IO
reviewers:
- chamikaramj
- johnjcasey
- pabloem
- Abacn
- ahmedabu98
exclusionList: []
- name: Build
reviewers:
- damccorm
- Abacn
exclusionList: []
fallbackReviewers: []
29 changes: 11 additions & 18 deletions scripts/ci/pr-bot/processNewPrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,27 @@ 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 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" ||
label.name.toLowerCase() === "python"
)
) {
console.log(
`Skipping PR ${pull.number} because it doesn't contain the go or python labels`
);
return false;
}
const firstPrToProcess = new Date(2022, 5, 16, 14); // June 16 2022, 14:00 UTC (note that Java months are 0 indexed)
const firstPythonPrToProcess = new Date(2022, 5, 16, 14); // June 16 2022, 14:00 UTC (note that JavaScript months are 0 indexed)
const firstPrToProcess = new Date(2022, 6, 15, 14); // July 15 2022, 14:00 UTC (note that JavaScript months are 0 indexed)
const createdAt = new Date(pull.created_at);
if (
createdAt < firstPrToProcess &&
!pull.labels.find((label) => label.name.toLowerCase() === "go")
) {
console.log(
`Skipping PR ${pull.number} because it was created at ${createdAt}, before the first pr to process date of ${firstPrToProcess}`
);
return false;
if (
createdAt < firstPythonPrToProcess ||
!pull.labels.find((label) => label.name.toLowerCase() === "python")
) {
console.log(
`Skipping PR ${pull.number} because it was created at ${createdAt}, before the first pr to process date of ${firstPrToProcess}`
);
return false;
}
}
if (prState.remindAfterTestsPass && prState.remindAfterTestsPass.length > 0) {
return true;
Expand Down
13 changes: 0 additions & 13 deletions scripts/ci/pr-bot/processPrUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,6 @@ async function processPrUpdate() {
console.log(context);
const payload = context.payload;

// 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" ||
label.name.toLowerCase() === "python"
)
) {
console.log("Does not contain the go or python labels - skipping");
return;
}

if (!payload.issue?.pull_request && !payload.pull_request) {
console.log("Issue, not pull request - returning");
return;
Expand Down

0 comments on commit 53c3ffb

Please sign in to comment.