Carry the project host on GitHub item dialog origins
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -134,13 +134,19 @@ vi.mock('./github-api-repository', async (importOriginal) => {
|
||||
// Mirror production: dotcom origin slugs come back pinned to github.com.
|
||||
return slug ? { host: 'github.com', ...slug } : slug
|
||||
},
|
||||
getIssueGitHubApiRepository: (repoPath: string, connectionId?: string | null) =>
|
||||
getIssueOwnerRepoMock(repoPath, connectionId),
|
||||
getIssueGitHubApiRepository: async (repoPath: string, connectionId?: string | null) => {
|
||||
const slug = await getIssueOwnerRepoMock(repoPath, connectionId)
|
||||
// Mirror production: issue slugs come back host-qualified to github.com.
|
||||
return slug ? { host: 'github.com', ...slug } : slug
|
||||
},
|
||||
resolveIssueGitHubApiRepositorySource: async (
|
||||
repoPath: string,
|
||||
_preference: unknown,
|
||||
connectionId?: string | null
|
||||
) => ({ source: await getIssueOwnerRepoMock(repoPath, connectionId), fellBack: false })
|
||||
) => {
|
||||
const slug = await getIssueOwnerRepoMock(repoPath, connectionId)
|
||||
return { source: slug ? { host: 'github.com', ...slug } : slug, fellBack: false }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ export async function getIssue(
|
||||
connectionId,
|
||||
localGitOptions
|
||||
)
|
||||
// Why: a connection-backed request has no local cwd, so the non-GitHub
|
||||
// fallback below would let gh target its default repository. Refuse instead.
|
||||
if (connectionId && !ownerRepo) {
|
||||
return null
|
||||
}
|
||||
await acquire()
|
||||
try {
|
||||
if (ownerRepo) {
|
||||
@@ -126,6 +131,17 @@ export async function listIssues(
|
||||
connectionId,
|
||||
localGitOptions
|
||||
)
|
||||
// Why: a connection-backed request has no local cwd, so the non-GitHub
|
||||
// fallback below would let gh list its default repository. Refuse instead.
|
||||
if (connectionId && !ownerRepo) {
|
||||
return {
|
||||
items: [],
|
||||
error: {
|
||||
type: 'not_found',
|
||||
message: 'Could not resolve GitHub owner/repo for this repository'
|
||||
}
|
||||
}
|
||||
}
|
||||
await acquire()
|
||||
try {
|
||||
if (ownerRepo) {
|
||||
|
||||
Reference in New Issue
Block a user