Repository navigation
[Refactor] Resolve GitHub task credential scope once - #3627
Open
roomote-roomote[bot] wants to merge 1 commit into
Open
roomote-roomote[bot] wants to merge 1 commit into
roomote-roomote[bot] wants to merge 1 commit into
Conversation
Contributor
|
No code issues found. See session Reviewed credential scope resolution, environment expansion and installation anchoring, unavailable-repository handling, additional Git credentials, and expiry/error behavior against the previous implementation and tests. Current-head CI tests, lint, type checks, and Knip passed; remaining build/compatibility/security checks were still running when inspected. Reviewed 0e16b52 |
roomote-roomote
Bot
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
October 29, 2026 22:23
This branch has not been deployed
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.
Related issue
Internal maintainability work on the multi-installation task credentials promoted in #3623 and extended in #3624. No linked issue. Checked #3618: its worker-side atomic credential publication changes are independent of this server-side scope resolution.
Why this PR exists
What changed
Resolve a task's stamped active GitHub repository rows once and group them by installation in a small credential plan. Both the primary API token and additional Git-only credentials consume that plan, replacing the normal multi-installation throw/catch fallback and repeated stamp queries.
Environment expansion remains a separate compatibility lookup; stamps already contained in that expansion reuse its rows. A spanning stamp without an environment now needs one repository lookup rather than three during worker credential creation. The production resolver is 42 lines smaller.
There is no intended behavior change: explicit environments and unstamped selections still require one installation; primary-repository and oldest-active-installation anchoring retain their precedence; unavailable stamped repositories keep their skip/fail behavior. API-only callers mint only the primary token. Additional tokens remain repository-scoped and Git-only, with unchanged permanent/transient mint failure handling and earliest-expiry scheduling.
How it was tested
task-run-token.test.ts: 28 tests passed, including the existing scope, fallback, expiry, and mint-error baseline.pnpm --filter @roomote/github check-typespassed.git diff --checkpassed.Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locallypnpm changeset