Carry host on smart-submit link intents
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -55,6 +55,7 @@ import {
|
||||
GITHUB_PROJECT_REF_INPUT_TOO_LARGE_ERROR,
|
||||
isGitHubProjectRefInputTooLarge
|
||||
} from '../../shared/github-project-ref-input'
|
||||
import { githubProjectHost } from '../../shared/github-project-identity'
|
||||
|
||||
// Re-export the public API so existing call sites (`./project-view`) keep
|
||||
// working unchanged. The split is internal-only.
|
||||
@@ -1384,6 +1385,7 @@ export async function getProjectViewTable(
|
||||
const table: GitHubProjectTable = {
|
||||
project: {
|
||||
id: project.id,
|
||||
host: githubProjectHost(args.host),
|
||||
owner: args.owner,
|
||||
ownerType: args.ownerType,
|
||||
number: args.projectNumber,
|
||||
@@ -1429,7 +1431,7 @@ type RawViewerDiscovery = {
|
||||
export async function listAccessibleProjects(
|
||||
args?: ListAccessibleProjectsArgs
|
||||
): Promise<ListAccessibleProjectsResult> {
|
||||
const host = args?.host
|
||||
const host = githubProjectHost(args?.host)
|
||||
const viewerProjects: GitHubProjectSummary[] = []
|
||||
const orgProjects: GitHubProjectSummary[] = []
|
||||
// Why: per-org failures are collected so the picker can render a "some orgs
|
||||
@@ -1488,6 +1490,7 @@ export async function listAccessibleProjects(
|
||||
n.owner?.__typename === 'Organization' ? 'organization' : 'user'
|
||||
viewerProjects.push({
|
||||
id: n.id,
|
||||
host,
|
||||
owner: ownerLogin,
|
||||
ownerType,
|
||||
number: n.number,
|
||||
@@ -1574,6 +1577,7 @@ export async function listAccessibleProjects(
|
||||
}
|
||||
orgProjects.push({
|
||||
id: n.id,
|
||||
host,
|
||||
owner: login,
|
||||
ownerType: 'organization',
|
||||
number: n.number,
|
||||
@@ -1794,6 +1798,7 @@ export async function resolveProjectRef(
|
||||
ownerType,
|
||||
number: parsed.number,
|
||||
title: p.title ?? '',
|
||||
host: githubProjectHost(args.host),
|
||||
// Why: forward the parsed view number from /views/{n} URLs so the
|
||||
// renderer can skip the view-pick step. parsed.kind === 'bare' has no
|
||||
// viewNumber (owner/number shorthand carries no view).
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
type RateLimitBucketKind
|
||||
} from '../rate-limit'
|
||||
import type { GitHubProjectViewError } from '../../../shared/github-project-types'
|
||||
import { githubProjectHost } from '../../../shared/github-project-identity'
|
||||
import {
|
||||
classifyProjectError,
|
||||
driftError,
|
||||
@@ -38,7 +39,7 @@ export type ProjectGhExecOptions = { cwd?: string; host?: string }
|
||||
// Why: owner/project-addressed calls carry only a host (no repo slug), so they
|
||||
// can't reuse githubHostExecOptions — mirror its host pinning for that shape.
|
||||
export function projectGhExecOptions(host: string | undefined): ProjectGhExecOptions {
|
||||
return host ? { host } : {}
|
||||
return { host: githubProjectHost(host) }
|
||||
}
|
||||
|
||||
// ─── Slug validation ──────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user