Adding files to code reviews
Add files to code reviews when other users need to review them. The following information explains how to perform reviews from the Source Tree window. You can also add files to reviews when performing the following actions.
Keep the following in mind:
- You can only add files to unapproved reviews. If you have security permissions to edit other authors' code reviews, you can add files to any unapproved reviews. Otherwise, you must be the author to add files to the review.
- How the file is added to the code review affects how the contents are displayed during the review. If the file is added to the review from the Source Tree window or when adding files or analyzing risk, the entire file contents are displayed for review. If the file is added to the review when checking in changes, viewing file history, or promoting or rebasing files, the differences between file versions are displayed for review. See Reviewing files in code reviews.
1. Select a file and choose Activities > Code Review > Add to Code Review. You can also drag files to code reviews from the Source Tree window to quickly add the current version to a review.
The Add to Code Review dialog box opens.
2. Select the Code review to add the files to.
- To create a new review, select <New code review> and enter the review details. See Creating code reviews.
- To add the file to an existing review, select the review from the list or click Select to view review details and determine which review to add the file to. See Selecting code reviews. The authors, reviewers, and notes for the selected review are displayed. Click the Files tab to view files already in the review. Click the History tab to the view the review history.
3. Click OK.
The file is added to the review.
Other ways to add files to code reviews
You can add new files you are adding to Surround SCM to code reviews. When the files are opened in a review, the entire file contents are displayed. See Adding files to Surround SCM.
1. Expand the Code review options in the Add Files dialog box.
2. Select Add to code review and select the review to add the file to.
- To add the file to a new review, select <New code review>. The Create Code Review dialog box opens when you add the file. See Creating code reviews.
- To add the file to an existing review, select the review from the list or click Select to view code review details and determine which review to add the file to. See Selecting code reviews.
You can add updated files to code reviews when you check in changes. When the files are opened in a review, the differences between file versions are displayed. See Checking in updated files.
1.Expand the Code review options in the Check In Files dialog box.
2. Select Add new version to code review and select the review to add the file to.
- To add the file to a new review, select <New code review>. The Create Code Review dialog box opens when you check in the file. See Creating code reviews.
- To add the file to an existing review, select the review from the list or click Select to view code review details and determine which review to add the file to. See Selecting code reviews.
You can add all files in a changelist or individual files from a committed changelist to code reviews. When the files are opened in a review, the differences between file versions are displayed. See Managing changelists.
1.Select a changelist or file in a committed changelist in the Changelists dialog box.
2. Click Add to Code Review.
- If you selected a pending changelist, the Select Code Review dialog box opens. Select the review to add the files to after the changelist is committed. See Selecting code reviews.
- If you selected a committed changelist or file, the Add to Code Review dialog box opens. To create a new review, select <New code review> and enter the review details. See Creating code reviews. To add the files to an existing review, select the review from the list or click Select to view review details and determine which review to add the files to. See Selecting code reviews.
You can add files to code reviews after promoting or rebasing changes between branches. When the files are opened in a review, the differences between file versions are displayed. See Merging files between branches.
1.Select a file in the Promote Status or Rebase Status dialog box and click Add to Review.
The Add to Code Review dialog box opens.
2. Select the Code review to add the files to.
- To create a new review, select <New code review> and enter the review details. See Creating code reviews.
- To add the file to an existing review, select the review from the list or click Select to view code review details and determine which review to add the file to. See Selecting code reviews.
You can add file versions to code reviews when viewing historical file information. When the files are opened in a review, the differences between file versions are displayed. See Viewing file history.
1.Select a file version in the History dialog box.
2. Click a button to add the file version to a review or review the changes.
- To add the file version to a review, click . Select the review in the Add to Code Review dialog box or create a new review. See Selecting code reviews and Creating code reviews.
- To review the changes in the file version, click . You are prompted to add the file version to a review when you add the first comment. See Adding review comments to files. You can add the file version to an existing review or create a new review. See Selecting code reviews and Creating code reviews.
You can add files to code review when analyzing issue risk to indicate they may need attention. When the files are opened in a review, the entire file contents are displayed. See Analyzing issue risk in files.
1.Select a file in the Analyze Risk dialog box.
2. Click a button to add the file to a review or review the file.
- To add the file to a review, click . Select the review in the Add to Code Review dialog box or create a new review. See Selecting code reviews and Creating code reviews.
- To review the file, click . You are prompted to add the file to a review when you add the first comment. See Adding review comments to files. You can add the file to an existing review or create a new review. See Selecting code reviews and Creating code reviews.
You can select related files to add to code reviews by changelist, label, or Helix ALM issue, test case, or requirement. When the files are opened in a review, the differences between file versions are displayed.
1.Choose View > Code Reviews.
The Code Reviews window opens.
2. Select the review to add files to and click Add Files.
The Add Files to Code Review dialog box opens.
3. Select a source type in Select files and versions by list and then select a source to display files from.
- Changelist displays files included in the selected committed changelist. Select a changelist from the list or click Select to search for a changelist or view changelist details. See Selecting changelists.
- Label displays files with the selected labeled applied to them. Select a label from the list or click Select to search for a label or view label details. See Selecting labels.
- Issue, Test Case, and Requirement display files attached to the selected Helix ALM item. Select an item from the list or click Select to search for an item or view item details. See Selecting Helix ALM items.
4. Select the files to add to the review and click Add to Code Review.
The files are added to the review.