Merge pull request #47755 from ClickHouse/cherry-pick-body

Clarify steps for reopened cherry-pick PRs
This commit is contained in:
alesapin 2023-03-20 13:42:22 +01:00 committed by GitHub
commit 28525c7c21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,18 +52,25 @@ class Labels:
class ReleaseBranch: class ReleaseBranch:
CHERRYPICK_DESCRIPTION = f"""This pull-request is a first step of an automated \ CHERRYPICK_DESCRIPTION = """Original pull-request #{pr_number}
backporting.
This pull-request is a first step of an automated backporting.
It contains changes like after calling a local command `git cherry-pick`. It contains changes like after calling a local command `git cherry-pick`.
If you intend to continue backporting this changes, then resolve all conflicts if any. If you intend to continue backporting this changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request. Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them. The check results does not matter at this step - you can safely ignore them.
Also this pull-request will be merged automatically as it reaches the mergeable state, \
### Note
This pull-request will be merged automatically as it reaches the mergeable state, \
**do not merge it manually**. **do not merge it manually**.
If it stuck, check the original PR for `{Labels.BACKPORTS_CREATED}` and delete it if \ ### If the PR was closed and then reopened
necessary.
If it stuck, check #{pr_number} for `{label_backports_created}` and delete it if \
necessary. Manually merging will do nothing, since `{label_backports_created}` \
prevents the original PR #{pr_number} from being processed.
""" """
BACKPORT_DESCRIPTION = """This pull-request is a last step of an automated \ BACKPORT_DESCRIPTION = """This pull-request is a last step of an automated \
backporting. backporting.
@ -203,8 +210,10 @@ close it.
self.cherrypick_pr = self.pr.base.repo.create_pull( self.cherrypick_pr = self.pr.base.repo.create_pull(
title=f"Cherry pick #{self.pr.number} to {self.name}: {self.pr.title}", title=f"Cherry pick #{self.pr.number} to {self.name}: {self.pr.title}",
body=f"Original pull-request #{self.pr.number}\n\n" body=self.CHERRYPICK_DESCRIPTION.format(
f"{self.CHERRYPICK_DESCRIPTION}", pr_number=self.pr.number,
label_backports_created=Labels.BACKPORTS_CREATED,
),
base=self.backport_branch, base=self.backport_branch,
head=self.cherrypick_branch, head=self.cherrypick_branch,
) )