diff options
author | Nikita Popov <npopov@redhat.com> | 2024-01-24 17:39:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 17:39:10 +0100 |
commit | 56444d5687818938a6ce798e7221aa920c54098e (patch) | |
tree | 871dd0c7057f2453f9d59ee251f49504e25c01a6 | |
parent | 4079aab8d80233586a9cd3f7be27bece4c21ea16 (diff) | |
download | llvm-56444d5687818938a6ce798e7221aa920c54098e.zip llvm-56444d5687818938a6ce798e7221aa920c54098e.tar.gz llvm-56444d5687818938a6ce798e7221aa920c54098e.tar.bz2 |
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).
-rwxr-xr-x | llvm/utils/git/github-automation.py | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py index ffe4e54..72db999 100755 --- a/llvm/utils/git/github-automation.py +++ b/llvm/utils/git/github-automation.py @@ -498,33 +498,8 @@ class ReleaseWorkflow: release_branch_for_issue = self.release_branch_for_issue if release_branch_for_issue is None: return False - head_branch = branch - if not repo.fork: - # If the target repo is not a fork of llvm-project, we need to copy - # the branch into the target repo. GitHub only supports cross-repo pull - # requests on forked repos. - head_branch = f"{owner}-{branch}" - local_repo = Repo(self.llvm_project_dir) - push_done = False - for _ in range(0, 5): - try: - local_repo.git.fetch( - f"https://github.com/{owner}/{repo_name}", f"{branch}:{branch}" - ) - local_repo.git.push( - self.push_url, f"{branch}:{head_branch}", force=True - ) - push_done = True - break - except Exception as e: - print(e) - time.sleep(30) - continue - if not push_done: - raise Exception("Failed to mirror branch into {}".format(self.push_url)) - owner = repo.owner.login - - head = f"{owner}:{head_branch}" + + head = f"{owner}:{branch}" if self.check_if_pull_request_exists(repo, head): print("PR already exists...") return True |