Fix OneLoc GitHub App installation selection - #11858
Open
missymessa wants to merge 1 commit into
Open
Conversation
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>
Contributor
There was a problem hiding this comment.
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.
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.
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:
Microsoft Reviewers: Open in CodeFlow