Team code reviews
Code reviews add a layer of accountability for scrupulous teams and work similarly to pull requests for GitHub.
How code reviews work
When team code reviews are enabled, any new snippets are subject to review and approval by another member of the team. In addition, if snippet update reviews are enabled, updates will also be subject to review and approval by another member.
A typical workflow for creating a new team snippet with code reviews enabled:
- Joe creates a new draft snippet and assigns it to Mary.
- Mary reviews the draft and asks for code changes via comments.
- Joe reviews Mary's comments and makes the necessary changes.
- Mary approves the draft, which then becomes a snippet in the team library.
Enabling code reviews
When creating a team
View our guide on creating a team to view steps on enabling code reviews.
For an existing team
- Click on the settings button next to the team title in the left-hand sidebar to open up Team Settings.
- Select Code Reviews in the navigation menu.
- Toggle on the Enable code reviews option.
- Optionally turn on Review snippet updates if you'd like edits to also receive code reviews.
- Click Save Settings to enable code reviews for the team.
Code review UI
Composing or editing a snippet
With code reviews enabled, the editing snippet dialog will have a control in the footer to assign the snippet draft to another team member.
Code review controls
If you are assigned to review a draft snippet, you have the option to comment or approve the code. You will see the these controls in the snippet view's header.
Once the draft snippet has been created, it will appear as an item in the sidebar under My Drafts. The navigation items work as follows:
- All Drafts (manager/owner only): See the full list of draft snippets under review for the team. A team owner or manager can comment on drafts but may not approve them, unless she is also assigned to review a specific draft.
- My Drafts (all members): New drafts or updates created by you. You have the ability to comment, but not approve these.
- Needs My Review: Drafts which are assigned to you. You have the ability to comment or approve these drafts.