Consume BC PR review engine instead of hosting it#9210
Conversation
The Copilot PR-review orchestrator and BCQuality clone+filter scripts moved to microsoft/BC-PRReviewerAgent. Replace the inline CopilotPRReviewRunner.yaml (resolve/review/publish jobs) with a thin caller of that engine's reusable review.yml, pinned to a reviewed SHA. BCApps keeps only its policy config (tools/BCQuality/bcquality.config.yaml) and the pull_request intake workflow. Security model unchanged: read-only review job runs the model on the untrusted diff; separate write-scoped publish job posts saved artifacts.
The engine now lives in the new public repo microsoft/BC-PullRequestReviewAgent so BCApps (and partner forks) can consume the reusable workflow cross-repo. Update uses: and engine_ref: to f9f7302.
Pins uses:+engine_ref to the BC-PullRequestReviewAgent v1.0.2 release, which adds private-repo authenticated fetch and reliable findings-file harvest (verified end-to-end). Replaces the pre-release SHA f9f7302.
…-engine # Conflicts: # .github/workflows/CopilotPRReviewRunner.yaml # tools/Code Review/scripts/Invoke-CopilotPRReview.ps1
| run: | ||
| shell: pwsh | ||
| outputs: | ||
| pr_number: ${{ steps.pr.outputs.number }} |
There was a problem hiding this comment.
The 'review' job calls the external reusable workflow 'microsoft/BC-PullRequestReviewAgent/.github/workflows/review.yml@v1.0.2' and passes 'secrets: inherit', forwarding every repo/org secret to that external workflow.
v1.0.2 is a mutable tag, not a commit SHA: every other action reference in this same file (actions/checkout, actions/setup-node, actions/upload-artifact, etc., in the pre-change version) is pinned to a full commit SHA with a version comment, and the called workflow's own header comment explicitly documents the expected pattern as 'uses: microsoft/BC-PullRequestReviewAgent/.github/workflows/review.yml@'. If the v1.0.2 tag were ever moved (accidentally or via a compromised release process) the workflow would silently execute different code with full access to inherited secrets. Given the impact this would represent if it occurred, the concern would normally warrant a major/blocker rating, but per policy this unbacked agent finding is capped at minor -- recommend pinning both the 'uses:' ref and the 'engine_ref' input to the resolved commit SHA for v1.0.2 (currently 7fbb20ce36970abfbc1716effe48d6f72bcb1610), consistent with this workflow's own SHA-pinning convention and the engine's documented guidance.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Copilot PR ReviewIteration 3 · Outcome: completed
Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 2 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
| if-no-files-found: warn | ||
| # Pin BOTH the workflow ref and engine_ref to the same reviewed engine release. | ||
| uses: microsoft/BC-PullRequestReviewAgent/.github/workflows/review.yml@v1.0.3 | ||
| secrets: inherit |
| path: ${{ github.workspace }}/review-output | ||
| if-no-files-found: warn | ||
| # Pin BOTH the workflow ref and engine_ref to the same reviewed engine release. | ||
| uses: microsoft/BC-PullRequestReviewAgent/.github/workflows/review.yml@v1.0.3 |
| secrets: inherit | ||
| with: | ||
| target_repo: ${{ github.repository }} | ||
| engine_ref: v1.0.3 |
| with: | ||
| target_repo: ${{ github.repository }} | ||
| engine_ref: v1.0.3 | ||
| config_path: tools/BCQuality/bcquality.config.yaml |
There was a problem hiding this comment.
Delete config files and lets use workflow parameters as it is safer
| engine_ref: v1.0.3 | ||
| config_path: tools/BCQuality/bcquality.config.yaml | ||
| # BCQuality policy overrides (operator escape-hatch; config file is the default) | ||
| bcquality_repo: ${{ vars.BCQUALITY_REPO }} |
There was a problem hiding this comment.
Encapsulated in the PRReviewRepo
| knowledge_allow: ${{ vars.BCQUALITY_KNOWLEDGE_ALLOW }} | ||
| knowledge_deny: ${{ vars.BCQUALITY_KNOWLEDGE_DENY }} | ||
| # Reviewer behaviour overrides | ||
| copilot_model: ${{ vars.COPILOT_REVIEW_MODEL }} |
There was a problem hiding this comment.
Only add parameters that we need to customize in BCApps, otherwise we accept default parameters from PRReview template
What
Stops BCApps from hosting the Copilot PR-review engine and makes it a caller of the reusable engine that now lives in microsoft/BC-PRReviewerAgent.
This is PR 2 of 3:
review.yml.Changes
tools/Code Review/(orchestrator + README) andtools/BCQuality/scripts/— all moved to the engine repo. (-3384 lines).github/workflows/CopilotPRReviewRunner.yamlfrom three inline jobs to a thinuses: microsoft/BC-PRReviewerAgent/.github/workflows/review.yml@<sha>caller withsecrets: inheritand the existingvars.*mapped to workflow inputs.tools/BCQuality/bcquality.config.yaml(BCApps' auditable policy) andCopilotPRReview.yaml(unprivilegedpull_requestintake), both unchanged.tools/BCQuality/README.mdto describe the policy config only.Security model (unchanged)
The reusable workflow preserves the
pull_request→workflow_runpattern: a read-onlyreviewjob runs the tool-enabled Copilot CLI over the untrusted diff (no write token); a separatepublishjob holdsissues/pull-requests: writeand only posts saved artifacts. The trusted-code provider shifts from BCAppsmaintoBC-PRReviewerAgent@<pinned-sha>.Before merge
@<sha>inuses:andengine_ref:to a reviewed enginemainSHA / release tag.AB#641717