Repository navigation
Only enable automatic Copilot review triggers when opted in - #2413
Merged
Alexander Holstrup (aholstrup1) merged 5 commits intoOct 20, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Alexander Holstrup (aholstrup1)
marked this pull request as ready for review
October 20, 2026 14:27
Alexander Holstrup (aholstrup1)
requested a review
from a team
as a code owner
October 20, 2026 14:27
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Manual intake dispatches after opt-in can trigger runner preparation and fail because no metadata artifact was uploaded.
1 open issue
What changed in this PR
Makes Copilot review workflows inert by default, with automatic triggers added only through the AL-Go updater after opt-in.
Changes:
- Makes both templates manual-only and adds event guards.
- Generates automatic triggers when
CodeReviewAgent.enabledis true. - Adds regression coverage and updates setup documentation and schema metadata.
| File | Description |
|---|---|
| Tests/WorkflowSanitation/WorkflowFileContent.Test.ps1 | Checks inert templates and job guards. |
| Tests/CheckForUpdates.Action.Test.ps1 | Tests opt-in trigger generation and file selection. |
| Templates/Per Tenant Extension/.github/workflows/CopilotPRReviewRunner.yaml | Makes runner manual-only and guards preparation. |
| Templates/Per Tenant Extension/.github/workflows/CopilotPRReview.yaml | Makes intake manual-only and guards execution. |
| Templates/AppSource App/.github/workflows/CopilotPRReviewRunner.yaml | Applies matching runner changes. |
| Templates/AppSource App/.github/workflows/CopilotPRReview.yaml | Applies matching intake changes. |
| Scenarios/Agents/CopilotCodeReview.md | Explains enabling and disabling reviews. |
| Actions/CheckForUpdates/CheckForUpdates.HelperFunctions.ps1 | Adds automatic triggers only after opt-in. |
| Actions/.Modules/settings.schema.json | Documents the disabled default and activation behavior. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 of 4 tasks
Wael (WaelAbuSeada)
approved these changes
Oct 20, 2026
Maria Zhelezova (mazhelez)
approved these changes
Oct 20, 2026
Alexander Holstrup (aholstrup1)
added a commit
that referenced
this pull request
Oct 21, 2026
### ❔What, Why & How <!-- Include description of the changes that will help reviewers in their task --> Add E2E coverage for Copilot review orchestration and verify that ordinary upgrades do not enable automatic review. The new scenario creates one PTE repository, sets only `CodeReviewAgent.enabled = true`, updates system files, and opens one PR with a small AL change. It checks that both review workflows succeed and the final review artifact exists. It uses default models and skills, does not inspect AI findings or comments, and skips the Linux invocation to avoid running the review twice. Waiting is bounded and does not rerun reviews. The existing upgrade test accepts absent review workflows or manual-only workflows with event guards, accounting for older updaters that copy template files directly. Run-count expectations are unchanged. This follows the behavior introduced by #2413 and should run against templates/actions containing that fix. Local validation: 16 checks in a session-local mocked harness passed, PowerShell parsing and PSScriptAnalyzer passed, and `git diff --check` passed. No live E2E or paid inference was run. Related to issue: N/A ### ✅ Checklist - [x] Add tests (E2E, unit tests) - [ ] Update RELEASENOTES.md - N/A, test-only change - [ ] Update documentation (e.g. for new settings or scenarios) - N/A, scenario steps are documented in the script header - [ ] Add telemetry - N/A <!-- Include more checklist entries, if needed --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

❔What, Why & How
Older AL-Go updaters and newly created repositories copy review workflows directly from the templates, bypassing the current updater's opt-in exclusions. Automatic triggers in those raw files therefore activate workflows before review is enabled.
Both PTE and AppSource templates now ship with only
workflow_dispatch. The intake job requires apull_requestevent; runner preparation requires a successfulworkflow_runevent. Manual dispatch skips the entry jobs and their dependent jobs.When
CodeReviewAgent.enabledis true, Update AL-Go System Files adds the intakepull_requestand runnerworkflow_runtriggers using the existing YAML helper. Original event types, branch defaults/patterns, permissions, concurrency, and security gates are preserved. Disabled/missing settings still exclude or remove both files. Manual triggers remain available but do not perform reviews.Validation:
Invoke-Pester -Path @('.\Tests\CheckForUpdates.Action.Test.ps1', '.\Tests\WorkflowSanitation\WorkflowFileContent.Test.ps1') -PassThru -Output None: 141 passed on PowerShell 7 and 141 passed on Windows PowerShell 5.1, using Pester 5.7.1.d5c257be) file-selection/generation functions and YAML class: 8 passed. Confirms inert templates survive the old updater and reproduces automatic triggers with the pre-change templates. Settings/logging were mocked; this fixture is not committed and does not exercise live upgrade orchestration.Related to issue: N/A
✅ Checklist
Release notes and
Scenarios/settings.mdare intentionally unchanged as requested. The review scenario and settings schema are updated. Telemetry is not applicable.