-
Notifications
You must be signed in to change notification settings - Fork 522
Revert & regression policy
When you find yourself in a situation where something seems newly broken in the app, it's important to:
- Isolate the problem & file an issue for it
- Identify the commit which introduced the regression (see below section)
- Revert the PR associated with the commit & send it as a PR for review (the bug you filed in (1) should be marked as fixed by this PR)
- Once the revert commit is submitted, reopen any issues fixed by the original PR that was reverted
If you get stuck along the way, please mention in the issue that you filed in (1) that you are unable to locate commit introducing the regression.
- Why do we revert PRs rather than just fix them?
- How to find the offending commit
- What do I do if I caused a regression?
Leaving problems checked in can result in the following two situations:
- As the known issues are fixed, others go unnoticed or are discovered later (potentially by users)
- The original commit may become non-revertible without manual conflict resolution as more changes are checked in on top of that
For this reason, the team's policy is to quickly revert regressions when they're found. This immediately unblocks team members and provides time for the original PR author to more carefully investigate the underlying issue & potential edge cases.
- Always checkout an unchanged, up-to-date copy of develop & verify that the issue is still occurring. Note this commit hash.
- If you can't repro the issue, double check that it isn't flaky (try a few times). If you still can't, it's likely the issue has been resolved. Please still file an issue and leave notes for what you tried so that the team can triage accordingly.
- Go back to an earlier commit on develop that doesn't repro this issue (if you're unsure, try something at the bottom of this page or earlier, if the regression was introduced a while ago).
- Perform a binary search until you find the commit that introduced the issue. Specifically:
- Open up a text editor and list all of the commit hashes on develop between the one that you found is reproing the regression and the commit not reproing the issue
- Pick the middle hash of the list, check out that commit, and verify whether the issue regresses. If it does, this becomes your new lower bound. If it doesn't, this becomes your new upper bound. Like standard binary search, the number of commits you're considering is cut in half during each check.
If it hasn't been reverted, please follow the steps above to revert. Once your PR is reverted, follow these steps:
- Ensure you can repro the issue fully. If you can't, talk to the original author to better understand how to repro the issue.
- Make sure you fully understand why your change caused the observed regression(s)--without this step, no progress can actually be made. Remember: fix issues not symptoms. We don't want the observed problem to just go away, we want the underlying root cause to be understood & addressed.
- Once you understand the root cause, think through potential edge cases that may break other aspects of the app. It's quite likely that the observed regression was just one of several broken behaviors caused by the underlying issue.
- Turn the behaviors from (3) into tests. Verify that these tests fail without a fix, and pass with a fix to the original regression.
- Submit a new PR with your original changes + the fixes and tests from (4). Make sure to detail the investigation in this new PR, and reference the original issue that tracked the regression.
Finally, be aware that everyone causes regressions. While we have a lot checks in place to try and avoid regressions from being checked in, they will still happen. Focus on learning from the situation rather focusing on the fact that a regression happened.
Have an idea for how to improve the wiki? Please help make our documentation better by following our instructions for contributing to the wiki.
Core documentation
Developing Oppia
- Contributing to Oppia Android
- Bazel
- Key Workflows
- Testing
- Developing Skills
- Frequent Errors and Solutions
- RTL Guidelines
- Working on UI
- Writing Design Docs
Developer Reference
- Code style
- Background Processing
- Dark mode
- Buf Guide
- Firebase Console Guide
- Platform Parameters & Feature Flags
- Work Manager
- Dependency Injection with Dagger
- Revert & regression policy
- Upgrading target SDK version
- Spotlight Guide
- Triaging Process
- Bazel
- Internationalization
- Terminology in Oppia
- Past Events