Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mergebot should reopen a PR when it's reverted #4692

Closed
ZainRizvi opened this issue Nov 1, 2023 · 5 comments
Closed

Mergebot should reopen a PR when it's reverted #4692

ZainRizvi opened this issue Nov 1, 2023 · 5 comments
Assignees

Comments

@ZainRizvi
Copy link
Contributor

ZainRizvi commented Nov 1, 2023

Goal
When mergebot reverts a PR, reopen that PR as well. This'll make tracking reverted PRs easier for the authors

Caveat
It appears that sometimes github can't reopen regular PRs. It's been reported this can happen when the branch has been deleted or if it's been "merged" (potentially meaning this feature could only work for ghstack PRs), but this needs more investigation

@ZainRizvi ZainRizvi converted this from a draft issue Nov 1, 2023
@malfet malfet self-assigned this Nov 1, 2023
@malfet
Copy link
Contributor

malfet commented Nov 1, 2023

Sounds simple, let me give it a try...

@malfet
Copy link
Contributor

malfet commented Nov 1, 2023

gh_fetch_url("https://api.github.com/repos/malfet/deleteme/pulls/57", method="PATCH", data={"state":"open"}) is all it takes

@huydhn
Copy link
Contributor

huydhn commented Nov 1, 2023

It looks like restoring the deleted branch could be done if there is a need, i.e. pytorch/pytorch#112304 has a restore branch button at the bottom. Although I think it would need to try it out:

  • In the case of ghstack, both base and head branches are deleted. So, both needs to be restored
  • I couldn't find any GitHub API to do the restore, so we would need to implement the that part ourselves

@malfet
Copy link
Contributor

malfet commented Nov 1, 2023

@huydhn branches are not auto-deleted, and only owner can restore a branch, so if PR is reverted, we should just try to revert as a first step

@malfet
Copy link
Contributor

malfet commented Nov 1, 2023

And it works: malfet/deleteme#58 Cherry-picking PRs into torch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants