You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2022/12/23 14:40:53 UTC
[beam] branch master updated: Remove slow review label after processing commands to avoid race (#24765)
This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 820839fe86b Remove slow review label after processing commands to avoid race (#24765)
820839fe86b is described below
commit 820839fe86b16c4600b0aab4ad8236456cd200a9
Author: Danny McCormick <da...@google.com>
AuthorDate: Fri Dec 23 09:40:44 2022 -0500
Remove slow review label after processing commands to avoid race (#24765)
---
scripts/ci/pr-bot/processPrUpdate.ts | 19 +++++++++----------
scripts/ci/pr-bot/shared/persistentState.ts | 12 +++++++++---
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/scripts/ci/pr-bot/processPrUpdate.ts b/scripts/ci/pr-bot/processPrUpdate.ts
index 8c9d0b3c034..f9aa1571321 100644
--- a/scripts/ci/pr-bot/processPrUpdate.ts
+++ b/scripts/ci/pr-bot/processPrUpdate.ts
@@ -75,20 +75,19 @@ async function processPrComment(
const commentContents = payload.comment.body;
const commentAuthor = payload.sender.login;
const pullAuthor = getPullAuthorFromPayload(payload);
+ console.log(commentContents);
+ const processedCommand = await processCommand(
+ payload,
+ commentAuthor,
+ commentContents,
+ stateClient,
+ reviewerConfig
+ );
// If there's been a comment by a non-author, we can remove the slow review label
if (commentAuthor !== pullAuthor && commentAuthor !== BOT_NAME) {
await removeSlowReviewLabel(payload);
}
- console.log(commentContents);
- if (
- await processCommand(
- payload,
- commentAuthor,
- commentContents,
- stateClient,
- reviewerConfig
- )
- ) {
+ if (processedCommand) {
// If we've processed a command, don't worry about trying to change the attention set.
// This is not a meaningful push or comment from the author.
console.log("Processed command");
diff --git a/scripts/ci/pr-bot/shared/persistentState.ts b/scripts/ci/pr-bot/shared/persistentState.ts
index 76e23f790cd..9c277f14d4a 100644
--- a/scripts/ci/pr-bot/shared/persistentState.ts
+++ b/scripts/ci/pr-bot/shared/persistentState.ts
@@ -40,14 +40,20 @@ async function commitStateToRepo() {
);
}
// Print changes for observability
- await exec.exec("git status", [], {ignoreReturnCode: true});
+ await exec.exec("git status", [], { ignoreReturnCode: true });
await exec.exec("git add state/*");
- const changes = await exec.exec("git diff --quiet --cached origin/pr-bot-state state", [], {ignoreReturnCode: true});
+ const changes = await exec.exec(
+ "git diff --quiet --cached origin/pr-bot-state state",
+ [],
+ { ignoreReturnCode: true }
+ );
if (changes == 1) {
await exec.exec(`git commit -m "Updating config from bot" --allow-empty`);
await exec.exec("git push origin pr-bot-state");
} else {
- console.log("Skipping updating state branch since there are no changes to commit");
+ console.log(
+ "Skipping updating state branch since there are no changes to commit"
+ );
}
}