A team uses a monorepo with multiple projects in one Git repository. They want to enforce that each commit message must reference a work item from Azure Boards. Which branch policy should they configure?
Trap 1: Automatically include work items in pull request descriptions
This is not a branch policy; it's a repository setting that auto-links work items based on commit messages.
Trap 2: Require a work item linking policy in branch policies
Require a work item linking policy in branch policies is a native Azure DevOps branch policy that blocks pull request completion until at least one work item is linked to the PR. This directly enforces traceability from code changes to backlog items, making it the correct mechanism for a monorepo where multiple projects share one repository.
Trap 3: Configure a minimum number of reviewers policy
Configuring a minimum number of reviewers policy only enforces that a specified number of people approve the pull request; it has no mechanism to validate or require linked work items. Thus, it can be used alongside a work item linking policy but does not by itself ensure any work item is associated with the change.
- A
Automatically include work items in pull request descriptions
Why it fails: This is not a branch policy; it's a repository setting that auto-links work items based on commit messages.
- B
Require a work item linking policy in branch policies
Why it fails: Require a work item linking policy in branch policies is a native Azure DevOps branch policy that blocks pull request completion until at least one work item is linked to the PR. This directly enforces traceability from code changes to backlog items, making it the correct mechanism for a monorepo where multiple projects share one repository.
- C
Configure a minimum number of reviewers policy
Why it fails: Configuring a minimum number of reviewers policy only enforces that a specified number of people approve the pull request; it has no mechanism to validate or require linked work items. Thus, it can be used alongside a work item linking policy but does not by itself ensure any work item is associated with the change.
- D
Use a build validation policy to check commit messages
A build validation policy runs a configured pipeline (e.g., a script that greps commit messages) and can fail the build if a message lacks a work item ID, but this is an indirect, custom workaround. It does not natively enforce work item linking in the pull request metadata, is prone to bypass via malformed commit messages, and is not the designated Azure DevOps policy for this requirement.