如何配置TFS代码评审流程,仅允许评审者关闭评审?
Got it, let's break down how to adjust your TFS code review workflow to meet those specific requirements:
TFS Code Review Workflow Adjustment Guide
Core Workflow Changes to Implement
1. Restrict Review Closure Permission to Reviewers Only
- You'll need to customize either the work item type (WIT) settings or project security to lock down this permission:
- Head to your TFS project settings > Work Item Types > Select the "Code Review Request" WIT.
- Edit the workflow transitions: Locate the "Close" transition, then update the allowed users/groups to only include the designated reviewers (map this directly to the "Reviewers" field in the WIT for dynamic permissioning).
- Alternatively, use TFS security groups: Create a dedicated "Code Reviewers" group, add your team's reviewers to it, and grant only this group permission to transition the review to "Closed" status.
- Critical note: Make sure to remove the closure permission from the review creator's group/user to enforce this rule strictly.
2. Enable Bidirectional Comment & Reply Communication
- TFS supports this natively, but you can reinforce it with small tweaks to ensure smooth collaboration:
- Confirm that both the review creator (developer) and reviewers have Contribute permissions on the code review work item. This lets them add comments, reply to existing threads, and attach code snippets/files as needed.
- Encourage using thread-specific comments tied to code blocks (via the TFS code review interface) to keep discussions focused on relevant sections of the code.
- Optional: Add a custom rule in the WIT to require at least one comment exchange before the review can be closed, to ensure meaningful discussion takes place.
3. Formalize Reviewer Validation & Closure Process
- Define a clear, repeatable step for reviewers to sign off before closing:
- Add a custom field to the "Code Review Request" WIT, like
Validation Status, with options: "Pending", "Validated - Approved", "Validated - Needs Changes". - Set a workflow rule that requires reviewers to set this field to "Validated - Approved" before they can trigger the "Close" transition.
- Document this for your team: Once all comments are addressed and the developer confirms changes are made, the reviewer verifies the updated code, marks the validation status as approved, and then closes the review.
- Add a custom field to the "Code Review Request" WIT, like
内容的提问来源于stack exchange,提问作者Irshad Parat
相关产品推荐
相关产品推荐

