Skip to content

Fix OneLoc GitHub App installation selection - #11858

Open
missymessa wants to merge 1 commit into
dotnet:mainfrom
missymessa:fix-oneloc-github-app-installation-selection
Open

Fix OneLoc GitHub App installation selection#11858
missymessa wants to merge 1 commit into
dotnet:mainfrom
missymessa:fix-oneloc-github-app-installation-selection

Conversation

@missymessa

@missymessa missymessa commented Aug 21, 2026

Copy link
Copy Markdown
Member

OneLoc currently receives a token for the first GitHub App installation (microsoft) instead of selecting the requested dotnet installation. That causes 403 Resource not accessible by integration when localization tries to create locfiles/* branches or update PRs.

This syncs the focused installation-selection fix already merged in dotnet/arcade#17312 and propagated to dotnet/dotnet main. It flattens the installations response before filtering, requires exactly one owner match, and logs the selected installation.

Evidence:

  • The App-token step succeeds, but OneLoc branch/PR writes fail with 403.
  • Replaying the same operation with the correctly selected dotnet installation token succeeds.
  • The change is limited to �ng/common/Get-GitHubAppToken.ps1 (14 insertions, 4 deletions).
Microsoft Reviewers: Open in CodeFlow

Sync the corrected App installation selection from dotnet/dotnet so OneLoc mints the requested organization installation token.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@missymessa
missymessa requested review from a team and a lite review from Copilot August 21, 2026 15:48
@missymessa
missymessa requested a review from a team as a code owner August 21, 2026 15:48
@dotnet-policy-service dotnet-policy-service Bot added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 21, 2026

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

Fixes GitHub App installation selection in Get-GitHubAppToken.ps1 so OneLoc mints an installation token for the requested owner (e.g., dotnet) rather than implicitly using the first installation returned (e.g., microsoft), preventing 403 “Resource not accessible by integration” failures during branch/PR writes.

Changes:

  • Adjusts paging logic to flatten the installations REST response before accumulation to avoid nested-array behavior.
  • Filters installations by owner with an explicit “exactly one match” requirement (fail-fast on 0 or >1 matches).
  • Logs the selected installation ID and owner for easier troubleshooting.

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

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

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants