This is an automated email from the ASF dual-hosted git repository. derrickaw pushed a commit to branch 20261023_updateReviewerSelection in repository https://gitbox.apache.org/repos/asf/beam.git
commit 9ac6bfa4f1241c8aaba0d29e5820a03bc4493aa3 Author: Derrick Williams <[email protected]> AuthorDate: Fri Oct 23 18:02:19 2026 +0000 update pr review code flow when assigning reviewer ahead of bot --- .github/workflows/pr-bot-pr-updates.yml | 2 +- scripts/ci/pr-bot/processPrUpdate.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-bot-pr-updates.yml b/.github/workflows/pr-bot-pr-updates.yml index a0b5a1242b7..e6dda97d853 100644 --- a/.github/workflows/pr-bot-pr-updates.yml +++ b/.github/workflows/pr-bot-pr-updates.yml @@ -16,7 +16,7 @@ name: pr-bot-pr-updates on: pull_request_target: - types: ["synchronize", "converted_to_draft", "ready_for_review"] + types: ["synchronize", "converted_to_draft", "ready_for_review", "review_requested"] issue_comment: types: [created] permissions: read-all diff --git a/scripts/ci/pr-bot/processPrUpdate.ts b/scripts/ci/pr-bot/processPrUpdate.ts index ad0aeaef80e..d48b5763b5b 100644 --- a/scripts/ci/pr-bot/processPrUpdate.ts +++ b/scripts/ci/pr-bot/processPrUpdate.ts @@ -32,6 +32,7 @@ const { PersistentState } = require("./shared/persistentState"); const { ReviewerConfig } = require("./shared/reviewerConfig"); const { BOT_NAME, + NO_MATCHING_LABEL, PATH_TO_CONFIG_FILE, REPO_OWNER, REPO, @@ -220,6 +221,17 @@ async function processPrUpdate() { await setNextActionReviewers(payload, pull, stateClient); } else if (payload.action === "review_requested") { console.log("Processing review_requested action"); + if (payload.requested_reviewer?.login) { + let prState = await stateClient.getPrState(pull.number); + const reviewersForLabels = reviewerConfig.getReviewersForLabels( + pull.labels, + [pull.user.login] + ); + const label = Object.keys(reviewersForLabels)[0] || NO_MATCHING_LABEL; + prState.reviewersAssignedForLabels[label] = + payload.requested_reviewer.login; + await stateClient.writePrState(pull.number, prState); + } await setNextActionReviewers(payload, pull, stateClient); } else if (payload.action === "converted_to_draft") { console.log("Processing converted_to_draft action");
