fix: deletionProposed branch throws error for main
revisions
#4056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When following these steps:
The error is thrown because when we try to delete the deletionProposed branch, we are passing in the commit from the latest ref on the main branch. In our case, when we try to delete the second packagerevision, we pass in the latest commit from main which was created when the first packagerevision was deleted. This commit doesn't exist in the second deletionProposed branch because the deletion of the first packagerevision happened on the main branch after the second packagerevision was proposed for deletion.
Since we're trying to delete the deletionProposed branch entirely and are using its existence as a boolean, I don't think we care what commit its on. We can pass in the zero-hash commit for it to delete the branch regardless of what commit its on. This makes the error go away for me locally.