mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Assign to all at once, improve logging
This commit is contained in:
parent
6dfd415758
commit
187b10dec5
@ -206,14 +206,7 @@ Merge it only if you intend to backport changes to the target branch, otherwise
|
||||
)
|
||||
self.cherrypick_pr.add_to_labels(Labels.LABEL_CHERRYPICK)
|
||||
self.cherrypick_pr.add_to_labels(Labels.LABEL_DO_NOT_TEST)
|
||||
if self.pr.assignees:
|
||||
logging.info(
|
||||
"Assing to assignees of the original PR: %s",
|
||||
", ".join(user.login for user in self.pr.assignees),
|
||||
)
|
||||
self.cherrypick_pr.add_to_assignees(*self.pr.assignees)
|
||||
logging.info("Assign to the author of the original PR: %s", self.pr.user.login)
|
||||
self.cherrypick_pr.add_to_assignees(self.pr.user)
|
||||
self._assign_new_pr(self.cherrypick_pr)
|
||||
|
||||
def create_backport(self):
|
||||
# Checkout the backport branch from the remote and make all changes to
|
||||
@ -244,14 +237,20 @@ Merge it only if you intend to backport changes to the target branch, otherwise
|
||||
head=self.backport_branch,
|
||||
)
|
||||
self.backport_pr.add_to_labels(Labels.LABEL_BACKPORT)
|
||||
self._assign_new_pr(self.backport_pr)
|
||||
|
||||
def _assign_new_pr(self, new_pr: PullRequest):
|
||||
# It looks there some race when multiple .add_to_assignees are executed,
|
||||
# so we'll add all at once
|
||||
assignees = [self.pr.user]
|
||||
if self.pr.assignees:
|
||||
logging.info(
|
||||
"Assing to assignees of the original PR: %s",
|
||||
", ".join(user.login for user in self.pr.assignees),
|
||||
)
|
||||
self.cherrypick_pr.add_to_assignees(*self.pr.assignees)
|
||||
logging.info("Assign to the author of the original PR: %s", self.pr.user.login)
|
||||
self.backport_pr.add_to_assignees(self.pr.user)
|
||||
assignees.extend(self.pr.assignees)
|
||||
logging.info(
|
||||
"Assing #%s to author and assignees of the original PR: %s",
|
||||
new_pr.number,
|
||||
", ".join(user.login for user in assignees),
|
||||
)
|
||||
new_pr.add_to_assignees(*assignees)
|
||||
|
||||
@property
|
||||
def backported(self) -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user