[ci] Copilot CI: Add Windows platform support to maui-copilot pipeline#34575
[ci] Copilot CI: Add Windows platform support to maui-copilot pipeline#34575
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34575Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34575" |
There was a problem hiding this comment.
Pull request overview
This PR updates the maui-copilot Azure DevOps pipeline and supporting scripts to run Copilot PR reviews against Windows- and MacCatalyst-targeted PRs, in addition to the existing Android/iOS support.
Changes:
- Extended
eng/pipelines/ci-copilot.ymlto supportwindowsandcatalystplatforms, including per-platform agent pool selection and Windows-specific setup. - Improved cross-script coordination for GitHub comment posting by passing through the created/updated comment ID to avoid eventual-consistency races.
- Updated review/test helper scripts to recognize the new platform value(s) and collect Windows artifacts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/ci-copilot.yml | Adds windows/catalyst, selects pools per platform, and adjusts environment/tooling setup for cross-platform execution. |
| .github/scripts/Review-PR.ps1 | Expands accepted platform values and wires comment ID from AI summary → finalize posting. |
| .github/scripts/post-ai-summary-comment.ps1 | Emits the created/updated comment ID and falls back to creating a new comment if PATCH isn’t permitted. |
| .github/scripts/post-pr-finalize-comment.ps1 | Accepts an existing comment ID for direct fetch (reduces comment-search race) and falls back gracefully on PATCH failures. |
| .github/scripts/BuildAndRunHostApp.ps1 | Adds Windows test assembly directory to artifact collection and clarifies log display for Windows. |
Comments suppressed due to low confidence (1)
eng/pipelines/ci-copilot.yml:366
- The Copilot CLI install step derives
COPILOT_BIN_DIRfromwhich copilot. Ifcopilotis not on PATH yet (common right afternpm install -g, especially on Windows/Git Bash),whichreturns empty anddirname ""becomes.—leading to##vso[task.prependpath].and the CLI still not being discoverable. Prefer usingnpm bin -g(ornpm config get prefix+ path join) to compute the global bin directory and prepend that, then verifycopilot --version.
- bash: |
echo "Installing GitHub Copilot CLI..."
npm install -g @github/copilot
# Ensure npm global bin is on PATH for subsequent steps (Linux UseNode installs to toolcache)
COPILOT_BIN_DIR=$(dirname "$(which copilot)")
echo "Copilot binary at: $COPILOT_BIN_DIR/copilot"
echo "##vso[task.prependpath]$COPILOT_BIN_DIR"
copilot --version || true
| (Join-Path $RepoRoot "artifacts/bin/Controls.TestCases.iOS.Tests/Debug/net10.0"), | ||
| (Join-Path $RepoRoot "artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0") | ||
| (Join-Path $RepoRoot "artifacts/bin/Controls.TestCases.Mac.Tests/Debug/net10.0"), | ||
| (Join-Path $RepoRoot "artifacts/bin/Controls.TestCases.WinUI.Tests/Debug/net10.0-windows10.0.19041.0") |
| [Parameter(Mandatory = $false)] | ||
| [ValidateSet('android', 'ios', 'windows', 'maccatalyst')] | ||
| [ValidateSet('android', 'ios', 'windows', 'maccatalyst', 'catalyst')] | ||
| [string]$Platform, |
PR #34575 Review — 5-Model ConsensusCI Status: ❌ Consensus Findings (flagged by 2+ of 5 models)🔴 CRITICAL — skipXcode: ${{ or(eq(parameters.Platform, 'android'), eq(parameters.Platform, 'windows'), eq(parameters.Platform, 'catalyst')) }}MacCatalyst builds require Xcode. 🟡 MODERATE — Both scripts search for the oldest comment containing Fix: capture the fallback POST's new comment ID and use it as the target on subsequent runs (rather than re-searching), or track it in a pipeline variable. 🟡 MODERATE — COPILOT_PATH=$(which copilot 2>/dev/null || true)
echo "copilot location: ${COPILOT_PATH:-not found}"
# no exit 1 if not foundIf 🟢 MINOR — catch {
$newTempFile = [System.IO.Path]::GetTempFileName()
$newCommentJson = gh api --method POST ... --input $newTempFile
Remove-Item $newTempFile # never reached if POST throws
}Wrap the POST in 🟢 MINOR — The Recommended Action:
|
…t check, temp file cleanup - Remove 'catalyst' from skipXcode MacCatalyst requires Xcodeexpression - Add fail-fast exit when copilot CLI is not found on PATH (Windows + Linux/macOS) - Make 'windows' pool match explicit with fallback else branch - Wrap fallback POST temp files in try/finally for guaranteed cleanup - Use -ErrorAction SilentlyContinue on Remove-Item in finally blocks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed review feedback from the 5-model consensus in c97affb: Applied fixes:
Not addressed (by design):
|
Multi-Model Re-Review (5 LLMs × consensus filter)Re-review triggered by new commits since our original review. Includes kubaflo's responses. Previous Findings Status
kubaflo's FeedbackWe agree with kubaflo's explanations and fixes. The COMMENT_ID plumbing added in this update ( CI Status:
|
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Adds Windows platform support to the
maui-copilotCI pipeline (AzDO definition 27723), enabling Copilot PR reviews on Windows-targeted PRs.Changes
eng/pipelines/ci-copilot.ymlcatalystandwindowsto Platform parameter valuesandroidPool,iosPool,macPool,windowsPool)sedcommand forDirectory.Build.Override.propson Windows (Git Bash uses GNU sed)script:steps tobash:for cross-platform consistency.github/scripts/Review-PR.ps1catalystto ValidateSet for Platform parameter.github/scripts/BuildAndRunHostApp.ps1.github/scripts/post-ai-summary-comment.ps1/post-pr-finalize-comment.ps1Validation
Successfully ran the pipeline with
Platform=windowson multiple Windows-specific PRs: