Revert ".github/scripts/auto-backport.py: validate backport candidate with Fixes prefix"

This reverts commit 8414cd743e. It prevents
pulling pull requests that do have "Fixes" references.
This commit is contained in:
Avi Kivity
2024-11-18 12:29:22 +02:00
parent 3a6c0a9b36
commit bef015da0d
2 changed files with 10 additions and 78 deletions

View File

@@ -129,20 +129,6 @@ def backport(repo, pr, version, commits, backport_base_branch):
logging.warning(f"GitCommandError: {e}")
def with_github_keyword_prefix(repo, pr):
pattern = rf"(?:fix(?:|es|ed))\s*:?\s*(?:(?:(?:{repo.full_name})?#)|https://github\.com/{repo.full_name}/issues/)(\d+)"
match = re.findall(pattern, pr.body, re.IGNORECASE)
if not match:
print(f'No valid close reference for {pr.number}')
comment = f':warning: @{pr.user.login} PR body does not contain a Fixes reference to an issue '
comment += ' and can not be backported\n\n'
comment += 'The following labels were removed:\n'
create_pr_comment_and_remove_label(pr, comment)
return False
else:
return True
def main():
args = parse_args()
base_branch = args.base_branch.split('/')[2]
@@ -183,8 +169,6 @@ def main():
if not backport_labels:
print(f'no backport label: {pr.number}')
continue
if args.commits and not with_github_keyword_prefix(repo, pr):
continue
commits = get_pr_commits(repo, pr, stable_branch, start_commit)
logging.info(f"Found PR #{pr.number} with commit {commits} and the following labels: {backport_labels}")
for backport_label in backport_labels: