Skip to content

Revert process

Kevin Chang edited this page Sep 2, 2021 · 7 revisions

Reverts do need to happen occasionally, and no blame or guilt should result from revert to a merge. We learn as a team and move on.

Reverting PRs in Sage

  1. Assuming recommended processes have been followed, this Pull Request (PR) will be linked from the most recent sage-lib version bump PR. If this is not the case, in the sage-lib GitHub repo, navigate to "Pull Requests" and locate the originating PR to revert in the list of "Closed" PRs.
  2. Scroll to the bottom of the PR to be reverted, and locate the merge description item in the timeline. The description should read "<username of author> merged commit <git hash here> into develop 5 hours ago".
  3. Click the "Revert" button next to the merge description. No need to panic. This will not make any immediate changes to the codebase
  4. You should now be redirected to a new "Open a pull request" view. By default, the title will read "Revert <title of PR>." To demonstrate the reason for this PR, do not alter this title.
  5. Confirm that this PR will is merged into develop.
  6. Add a description if necessary, indicating the reason for the revert.
  7. Scan through the list of changed files, and verify that only the files related to the PR to be reverted are included.
  8. Assign yourself as the PR assignee.
  9. Once you have verified all of the information above, click the "Create pull request" to create the PR and assign at minimum one, but preferably two reviewers for testing. If you are not the original author of the feature branch being reverted, be sure to add yourself as a reviewer
  10. Thoroughly test the branch on your own local machine and confirm that the work in the branch has been reverted and no new issues have appeared.
  11. Once approval has been given by all reviewers, proceed as you normally would with a feature branch: merge into develop using the "Merge pull request" button, and (optionally) delete the revert branch

Sage version bump

  1. Now that the change has been reverted in develop, a new Sage version update is now necessary to merge the revert PR (and any other recent changes) from develop into main.
    1. If a new "Next version bump" PR already exists, navigate to the version bump PR, or
    2. If a new "Next version bump" PR has yet to be created, navigate to the "Pull requests" tab in GitHub, and click the "New pull request" button, making sure the base branch is set to main. Fill out the description using the version bump template
  2. Follow the remaining steps in the version bump process documentation. Depending on the urgency of the revert, you may be able to skip directly to Step 2.