Replace branch-mirror-status prompt file with PowerShell script#55111
Open
marcpopMSFT wants to merge 4 commits into
Open
Replace branch-mirror-status prompt file with PowerShell script#55111marcpopMSFT wants to merge 4 commits into
marcpopMSFT wants to merge 4 commits into
Conversation
Replace the prompt file with a standalone PowerShell script that checks whether public GitHub release branches have been mirrored to internal Azure DevOps repos. Key fix from original PR #53982: use Invoke-RestMethod with an explicit token from 'az account get-access-token' instead of 'az rest', which fails on Windows due to: 1. Token acquisition issues (can't derive resource from AzDo URLs) 2. Unicode encoding errors ('charmap' codec) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the .github/prompts/branch-mirror-status.prompt.md prompt (VS/VS Code-specific and deterministic) with a standalone PowerShell script that produces the same “branch mirror status” report by querying GitHub (via gh) and Azure DevOps (via az + Invoke-RestMethod).
Changes:
- Added
eng/Get-BranchMirrorStatus.ps1to compute and emit a markdown table of mirror status for configured release branches. - Removed
.github/prompts/branch-mirror-status.prompt.mdnow that the check is implemented as an executable script.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/Get-BranchMirrorStatus.ps1 | New script that checks latest GitHub commit per release branch and verifies it’s present/mirrored in AzDo, emitting markdown output. |
| .github/prompts/branch-mirror-status.prompt.md | Removed the deterministic prompt file in favor of the standalone script. |
Member
Author
|
@lbussell I noticed your other PR went stale and had my local copilot try to fix the scripts. It apparently didn't have access to your branch so created it's own PR. this script works for me. |
- Add [ValidateRange(1, MaxValue)] to SearchDepth parameter - Remove 2>&1 from az token call to avoid stderr corruption - Add --only-show-errors and .Trim() for clean token capture Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…reCategory: InfrastructureError) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lbussell
reviewed
Jul 2, 2026
…I URL Co-authored-by: Copilot <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.
Supersedes #53982.
Replaces the
branch-mirror-status.prompt.mdprompt file with a standalone PowerShell script that checks whether public GitHub release branches have been mirrored to internal Azure DevOps repos.Fix from #53982
The original PR used
az rest --resourcefor AzDo API calls, which fails on Windows due to:az restcan't properly derive the Azure AD resource from AzDo URLs, causing it to skip authenticationaz resthits'charmap' codec can't encode characterwhen the response contains non-ASCII characters on WindowsFix: Use
az account get-access-token --resource <id>to acquire the bearer token once during prerequisite checks, thenInvoke-RestMethodwith the token in headers for all AzDo API calls.Usage
Example Output