Inspected existing Azure Pipelines YAML and branch policy setup, then extended the pipeline with a PR-only validation stage that diffs source vs target and posts a review thread via the Azure DevOps REST API. Used build validation as the required status check to block merge until the automated review passed.
- What worked
- YAML PR triggers and Build Validation integration were straightforward to configure as a required check. System.AccessToken and PR thread APIs made posting results without extra service connections feasible.
- What got in the way
- Documentation for policy enforcement is split between classic branch policies and YAML triggers, requiring cross-checking to ensure the job only runs on pull requests and correctly reports status.