Skip to content

Replace branch-mirror-status prompt file with PowerShell script#53982

Open
lbussell wants to merge 3 commits intodotnet:mainfrom
lbussell:branch-mirror-status
Open

Replace branch-mirror-status prompt file with PowerShell script#53982
lbussell wants to merge 3 commits intodotnet:mainfrom
lbussell:branch-mirror-status

Conversation

@lbussell
Copy link
Copy Markdown
Member

There were two problems with branch-mirror-status prompt file introduced in #53902.

  1. Prompt files are VS/VS Code only, so not useful for GitHub Copilot CLI.
  2. Everything in the prompt is completely deterministic. It could be a script instead. So I did that.

Evaluation

Before After Change
Execution time 84.7 seconds 7.56 seconds −77.14 seconds (−91.1%)
Tokens used (Opus 4.6) ↑ 186.7k • ↓ 6.3k • 134.9k (cached) 0 −100%

Example Output

> ./eng/Get-BranchMirrorStatus.ps1
## Branch Mirror Status

| Repo | Branch | Latest GH Commit | Mirrored? | Details |
|---|---|---|---|---|
| dotnet/sdk | release/8.0.1xx | `cc809cd` [release/8.0.1xx] Update dependencies from dotnet/templat... | ✅ | Direct push (same SHA on AzDo branch) |
| dotnet/sdk | release/8.0.4xx | `55801ad` [release/8.0.4xx] Update dependencies from dotnet/source-... | ✅ | Direct push (same SHA on AzDo branch) |
| dotnet/sdk | release/9.0.1xx | `2797529` Replace ubuntu22 VM and Helix images with Azure Linux 3 (... | ✅ | Direct push (same SHA on AzDo branch) |
| dotnet/sdk | release/9.0.3xx | `a041d5f` [automated] Merge branch 'release/9.0.1xx' => 'release/9.... | ✅ | Direct push (same SHA on AzDo branch) |
| dotnet/installer | release/8.0.1xx | `c58a9a9` Replace ubuntu22 VM and Helix images with Azure Linux 3 (... | ✅ | Direct push (same SHA on AzDo branch) |
| dotnet/installer | release/8.0.4xx | `a77a3ff` [automated] Merge branch 'release/8.0.1xx' => 'release/8.... | ✅ | Direct push (same SHA on AzDo branch) |

Copilot AI review requested due to automatic review settings April 17, 2026 23:08
@lbussell lbussell requested a review from marcpopMSFT April 17, 2026 23:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the previously added branch-mirror-status Copilot prompt file with a deterministic PowerShell script that checks whether public GitHub release branches are mirrored to the corresponding internal Azure DevOps branches, producing markdown output suitable for sharing.

Changes:

  • Added eng/Get-BranchMirrorStatus.ps1 to query GitHub (via gh) and AzDo (via az rest) and emit a markdown status table.
  • Removed the Copilot prompt file .github/prompts/branch-mirror-status.prompt.md since prompt files are editor-scoped and the logic is scriptable.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
eng/Get-BranchMirrorStatus.ps1 Implements the branch mirror check and markdown reporting using gh + az rest.
.github/prompts/branch-mirror-status.prompt.md Removes the prior editor-only prompt file now superseded by the script.

Comment thread eng/Get-BranchMirrorStatus.ps1 Outdated
Comment thread eng/Get-BranchMirrorStatus.ps1 Outdated
Comment thread eng/Get-BranchMirrorStatus.ps1 Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread eng/Get-BranchMirrorStatus.ps1
$probeUrl = "$AzDoOrg/internal/_apis/git/repositories?api-version=7.1&`$top=1"
$null = az rest --method get --url $probeUrl --resource $AzDoResourceId --only-show-errors 2>&1
if ($LASTEXITCODE -ne 0) {
$errors += "Cannot access Azure DevOps (dnceng/internal). Run ``az login`` and ensure you have access to the dnceng organization."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in testing this locally, I always hit this error. I'm logged into az already (that experience isn't great btw). I have the az devops extension installed already, and az devops project list lists dnceng. What am I missing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me try on a different box and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants