Skip to content
Bitwarden Logo

Pull Requests

Pull Requests are the primary mechanism we use to write software. GitHub has some great documentation on using the Pull Request feature.

Branch

Each new feature or bug fix should be developed on a separate branch. Branches allow you to work on multiple features concurrently. In most cases you should branch from main. However, if you are working with other contributors we typically branch off a long-lived feature branch. Long-lived feature branches allow us to break up a single feature into multiple PRs, which can be reviewed individually but tested and released together.

Commit

We recommend grouping related changes together into a single commit. This can make it easier for reviewers to understand and assess the changes that are being proposed, while also giving the contributor checkpoints to revert to if something should go wrong.

We do not have a standard for how to structure commit messages (e.g. semantic commit messages). We encourage that commit messages should be within the 50-character limit so that git log can be used easily. If a commit message would take more than 50 characters it is best to break it up into smaller atomic changes for readability and malleability of the git history (reversion, cherry-picking, etc.).

More advanced contributors might find it useful to Rewrite History. This allows a contributor to revise their local history before pushing to the remote repository. A common use case is squashing multiple half-working commits.

Creating a pull request

The Bitwarden repositories have a Pull Request template which should be followed. This will ensure the PR review goes smoothly since it will provide context to the reviewer.

Addressing feedback

It is likely that you will receive some feedback on your PR. You should see this as a positive thing — it signifies a healthy and thorough review process and an organizational commitment to code quality. You may receive comments or a request for changes. You are encouraged to engage in conversation on the PR to discuss a solution, but if any strong conflicting opinions arise it is often best to move the conversation to a synchronous format to avoid any misunderstanding.

When any necessary changes have been made, you should address the comments or request for changes by responding in the PR conversation thread. You are not responsible for resolving the conversation — that is the prerogative of the reviewer, to ensure that they agree that the question or concern has been addressed.

When you are ready for a reviewer to revisit your changes, you should request a re-review. This will notify the reviewer and ensure a prompt response.