The File Review process sets itself apart from the regular Code Review by allowing you to pinpoint specific files that require changes before they are actually made. Once these necessary changes are committed and added to the code review, you can proceed with the standard review and approval process. While the regular post-commit Code Review is typically initiated by the commit author, the File Review can be created by any team member who wants to suggest changes to a specific part of the code. Usually it's the person who will be reviewing the changes once they are made.
When do I need to create a File Review?
If you discover a problem confined to one or several files, you can create a code review dedicated solely to these files and describe the problem within the review. Then you invite a capable team member or the one responsible for that portion of the code to address the problem. To have the following changes examined and formally approved, you assign yourself or another competent team member as a reviewer.
Another use case for this kind of code review is when a refactoring or other improvements of the code base are in order, but the changes should only impact a known set of files.
Create a File Review
Go to the Files tab.
Select one of the files that need changes and that you want included in the Code Review.
Click and choose New code review from file:
A new code review will be created and named after the file. At this point the review has no commits attached, no author, and it includes just one file.
To add other files that need to be changed, go to the Changes tab and click the Edit initial files icon:
Select all the files which need changes and which you want included in the review:
Go to the Timeline tab and describe what needs to be changed in the included files. You can either post a comment or add a description by clicking :
Invite a team member who you want to make changes, mention
@them in your comment.
Assign one or several team members as reviewers:
The File Review workflow
A team member who wants to suggest changes in certain files creates a code review and includes these files in the review. The review creator invites a responsible team member to make the changes and assigns one or more reviewers to examine future changes.
The invited team member commits the changes and adds his or her commits to the code review.