fix: accept enterprise managed GitHub owner logins (#20450)

Unify owner validation across project pickers and repository overrides. Preserve EMU usernames in API and auth-status branch-prefix resolution, with regression coverage.

Co-authored-by: Neil <neil@stably.ai>
This commit is contained in:
Gon Song
2026-09-16 14:41:15 -07:00
committed by GitHub
co-authored by Neil
parent 6101f0169f
commit 85d1ffc072
16 changed files with 364 additions and 104 deletions
+13 -10
View File
@@ -136,17 +136,20 @@ describe('resolveGitHubRepoExecution', () => {
expect(isGitHubHostAuthenticatedMock).not.toHaveBeenCalled()
})
it('normalizes github.com without spending an auth inventory probe', async () => {
await expect(
resolveGitHubApiRepository('/repo', {
owner: 'acme',
repo: 'widgets',
host: ' GitHub.COM '
})
).resolves.toEqual({ owner: 'acme', repo: 'widgets', host: 'github.com' })
it.each(['acme', 'octocat_acme'])(
'normalizes github.com for %s without an auth inventory probe',
async (owner) => {
await expect(
resolveGitHubApiRepository('/repo', {
owner,
repo: 'widgets',
host: ' GitHub.COM '
})
).resolves.toEqual({ owner, repo: 'widgets', host: 'github.com' })
expect(isGitHubHostAuthenticatedMock).not.toHaveBeenCalled()
})
expect(isGitHubHostAuthenticatedMock).not.toHaveBeenCalled()
}
)
it('backfills the origin host for a host-less caller-specific resolver', async () => {
const ownerRepo = { owner: 'upstream', repo: 'widgets' }