What to do if your merged PR got reverted?

Sometimes, the PyTorch team reverts a commit after it has been reviewed and merged into the main branch. This is fair, since they may have internal tests or find other issues with the PR that need it reverted. But for the open source community, it is not possible to understand what the issue was, or what the next step is, because the reverted commit does not contain any information about what went wrong, only what appears to be Meta-internal ticket numbers.

My suggestions:

  1. Provide the error stack trace and possibly the entire test case that failed.
  2. Reopen the tickets that were closed in the original PR. Only PyTorch staff can do this.
  3. Communicate with the author, encourage them to re-land an improved version of the reverted commit. Guide them with clear call to action of what should be changed.

I’m posting here, seeking advice because my PR got reverted and I have no idea what to do.

1 Like

I think the suggestions you made are supposed to be standard practice, and that there are no relevant comments on your original PR seems like a mistake. You might want to add a comment on your original PR pinging internal people to ask about next steps before re-submitting.

Another thing to check is the hud though. Often when a PR is reverted, you’ll see the test failure in the HUD right before that revert. In your case, if step through to the page with the revert for your PR, I see a whole series of PR unlands happening, including yours. It’s possible that your PR merely had merge conflicts with the PR they actually cared to revert, and so it was easier to revert everything until back to a known working state.

If your PR was directly related to what actually broke things, I think they’d have been less likely to forget to add those details to your original PR. In at least one case, looking at the many unlanded PRs just before yours, I see some have comments like “It is required to revert this PR in order to properly revert #116193.” Some of the other nearby unlands have comments with specific references to particular test failures.

The hud link (though the correct page number may change as more commits come in):
https://hud.pytorch.org/hud/pytorch/pytorch/main/3?per_page=50

1 Like