Skip to content

[release/9.0] Fix OneLoc GitHub App installation selection - #17314

Merged
missymessa merged 1 commit into
dotnet:release/9.0from
missymessa:missymessa/backport-oneloc-installation-selection-9.0
Aug 11, 2026
Merged

missymessa merged 1 commit into
dotnet:release/9.0from
missymessa:missymessa/backport-oneloc-installation-selection-9.0

Conversation

@missymessa

Copy link
Copy Markdown
Member

Backport of #17312 to release/9.0.

OneLoc GitHub App authentication is enabled by default on this branch. This fix flattens the installations response, requires exactly one owner match, and prevents dotnet builds from receiving the Microsoft installation token.

Validation:

  • PowerShell syntax parsing passes
  • mocked response with Microsoft first selects dotnet correctly
  • mocked response still selects Microsoft correctly
  • git diff --check passes

Tracking: https://dev.azure.com/dnceng/internal/_workitems/edit/11966

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f12710df-91d5-49e4-b327-337932478b0b
Copilot AI lite review requested due to automatic review settings August 11, 2026 14:14

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.

Pull request overview

This PR backports a fix to eng/common/Get-GitHubAppToken.ps1 on release/9.0 to correctly select the intended GitHub App installation when multiple installations exist, avoiding minting a token for the wrong owner (notably preventing dotnet builds from accidentally using the microsoft installation).

Changes:

  • Avoid nested-array behavior from Invoke-RestMethod by assigning the response before wrapping it, ensuring installations are enumerated correctly across pages.
  • Require exactly one installation matching InstallationOwner (fail fast on 0 or >1 matches instead of silently taking the first).
  • Log the selected installation owner and installation ID for diagnosability.

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

@missymessa
missymessa enabled auto-merge (squash) August 11, 2026 14:18
@missymessa
missymessa merged commit 43f1167 into dotnet:release/9.0 Aug 11, 2026
9 of 12 checks passed
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.

3 participants