Skip to content

Commit 56444d5

Browse files
authored
Remove fork handling from release issue workflow (#79310)
This is currently broken, because the check is performed on the wrong repository. repo here is llvm/llvm-project, which is not a fork (so this will always trigger), then we'll push a new branch to llvmbot/llvm-project, and then again set the wrong owner, so we'll look for the branch in llvm/llvm-project rather than llvmbot/llvm-project. Rather than fixing this, I'm removing the code entirely, as it shouldn't be needed anymore (llvmbot/llvm-project is a fork of llvm/llvm-project).
1 parent 4079aab commit 56444d5

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

llvm/utils/git/github-automation.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -498,33 +498,8 @@ def create_pull_request(self, owner: str, repo_name: str, branch: str) -> bool:
498498
release_branch_for_issue = self.release_branch_for_issue
499499
if release_branch_for_issue is None:
500500
return False
501-
head_branch = branch
502-
if not repo.fork:
503-
# If the target repo is not a fork of llvm-project, we need to copy
504-
# the branch into the target repo. GitHub only supports cross-repo pull
505-
# requests on forked repos.
506-
head_branch = f"{owner}-{branch}"
507-
local_repo = Repo(self.llvm_project_dir)
508-
push_done = False
509-
for _ in range(0, 5):
510-
try:
511-
local_repo.git.fetch(
512-
f"https://github.com/{owner}/{repo_name}", f"{branch}:{branch}"
513-
)
514-
local_repo.git.push(
515-
self.push_url, f"{branch}:{head_branch}", force=True
516-
)
517-
push_done = True
518-
break
519-
except Exception as e:
520-
print(e)
521-
time.sleep(30)
522-
continue
523-
if not push_done:
524-
raise Exception("Failed to mirror branch into {}".format(self.push_url))
525-
owner = repo.owner.login
526-
527-
head = f"{owner}:{head_branch}"
501+
502+
head = f"{owner}:{branch}"
528503
if self.check_if_pull_request_exists(repo, head):
529504
print("PR already exists...")
530505
return True

0 commit comments

Comments
 (0)