Skip to content

Use GitHub App for VMR artifact comparison - #9688

Merged
akoeplinger merged 10 commits into
dotnet:mainfrom
missymessa:dev/mjanecke/vmr-artifact-reader-app
Oct 2, 2026
Merged

akoeplinger merged 10 commits into
dotnet:mainfrom
missymessa:dev/mjanecke/vmr-artifact-reader-app

Conversation

@missymessa

@missymessa missymessa commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Intent

Replace the shared BotAccount-dotnet-bot-repo-PAT used by the VMR artifact-comparison pipeline with short-lived, least-privilege GitHub App installation tokens.

Related work items:

  • AB#12315
  • AB#12791
  • AB#12930 tracks switching from the flowed Arcade source helper to root eng/common after the next bootstrap update.

Changes

  • Mint separate installation tokens for the selected-repository dotnet, NuGet, and microsoft App installations through the dedicated WIF service connection.
  • Use the already-flowed src/arcade/eng/common/Get-GitHubAppToken.ps1 helper until the next Arcade bootstrap refreshes root eng/common.
  • Rely on the App's Contents: read permission and each installation's selected-repository boundary.
  • Select the appropriate token from each source-manifest repository URL and fail closed for unknown owners or repositories.
  • Remove the classic PAT variable-group dependency and PAT fallback.
  • Make individual darc gather-drop failures fatal instead of continuing silently.
  • Add executable tests for repository mappings, owner-specific token routing, fail-closed behavior, Arcade-helper usage, and PAT removal.

Validation

Pipeline 1447 build 3087000 validated this exact commit (3f9c07bba3496271d048e23caf51548e881ed081):

  • GitHub App token-flow tests passed.
  • Dedicated WIF authentication and secret-scoped Key Vault access succeeded.
  • Installation tokens were created for dotnet, NuGet, and microsoft using the flowed Arcade helper.
  • Gather Drop succeeded for all eight configured repositories without PAT fallback, 401, or 403 responses.
  • VMR change validation accepts the PR because it no longer modifies protected root eng/common files.

The overall canary later failed in the unrelated asset-comparison step because the selected unified build contains 126 non-baselined AssemblyVersionMismatch findings. The authentication and Gather Drop steps completed successfully.

Replace the shared classic PAT with repository-restricted installation tokens for dotnet, NuGet, and microsoft repositories.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: ca981fa5-8dc6-4a81-91a0-d9205e10180f
Co-authored-by: Copilot <[email protected]>

Copilot-Session: ca981fa5-8dc6-4a81-91a0-d9205e10180f
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@missymessa
missymessa marked this pull request as ready for review September 28, 2026 16:12
@missymessa
missymessa requested review from a team as code owners September 28, 2026 16:12
Copilot AI lite review requested due to automatic review settings September 28, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Installation tokens may expire during the 180-minute job and require refresh or bounded retry.

Review effort: Lite
Findings: None

What changed in this PR

Replaces the VMR artifact-comparison pipeline’s shared PAT with scoped GitHub App installation tokens.

Changes:

  • Adds owner/repository token routing with fail-closed validation.
  • Uses the Arcade helper to mint separate installation tokens.
  • Removes PAT dependencies and makes gather failures fatal.
  • Adds authentication-flow tests.
File Summary
eng/​VmrGitHubAuthentication.psm1 Repository validation and token routing
eng/​tests/​VmrGitHubAppToken.Tests.ps1 Authentication-flow regression tests
eng/​pipelines/​templates/​steps/​vmr-compare.yml GitHub App token acquisition and pipeline integration; long-running jobs need token refresh or retry
eng/​pipelines/​templates/​stages/​vmr-compare.yml Removes the PAT variable group
eng/​GatherDrops.ps1 Uses routed tokens and fails on gather errors

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@missymessa
missymessa requested a review from mmitche September 29, 2026 19:10
missymessa and others added 2 commits September 30, 2026 09:42
Remove the temporary workflow regression script and document the installation-token lifetime and helper-path constraint.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 8a2c76b3-5196-4de4-85bf-a838c46d5b71
@missymessa

Copy link
Copy Markdown
Member Author

@mmitche The review feedback is addressed in a05c3e1. The temporary workflow test was removed, token lifetime/use timing is documented, and I added the verified reason the flowed helper remains necessary until the compatible helper bootstraps to root eng/common. Please re-review when ready.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants