Push publishes to the selected remote
- Pass the ensured remote name through publish flow - Push directly to that remote when publishing a repository - Add coverage for remote-specific push behavior
This commit is contained in:
1 parent
92e2845b7c
commit
27697abbad
6 files changed
+297
-211
No files matched your search
@@ -3,10 +3,7 @@ import { assert, it } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer } from "effect";
|
||||
import { ChildProcessSpawner } from "effect/unstable/process";
|
||||
|
||||
import {
|
||||
GitCommandError,
|
||||
type SourceControlProviderError,
|
||||
} from "@t3tools/contracts";
|
||||
import { GitCommandError, type SourceControlProviderError } from "@t3tools/contracts";
|
||||
|
||||
import { ServerConfig } from "../config.ts";
|
||||
import {
|
||||
@@ -156,7 +153,7 @@ it.effect("clones a looked-up repository into the requested destination", () =>
|
||||
it.effect("publishes by creating the repository, adding a remote, and pushing upstream", () => {
|
||||
const createCalls: Array<{ cwd: string; repository: string; visibility: string }> = [];
|
||||
const remoteCalls: Array<{ cwd: string; preferredName: string; url: string }> = [];
|
||||
const pushCalls: string[] = [];
|
||||
const pushCalls: Array<{ cwd: string; remoteName: string | null | undefined }> = [];
|
||||
const provider = makeProvider({
|
||||
createRepository: (input) =>
|
||||
Effect.sync(() => {
|
||||
@@ -194,7 +191,7 @@ it.effect("publishes by creating the repository, adding a remote, and pushing up
|
||||
assert.deepStrictEqual(remoteCalls, [
|
||||
{ cwd: "/workspace", preferredName: "origin", url: CLONE_URLS.sshUrl },
|
||||
]);
|
||||
assert.deepStrictEqual(pushCalls, ["/workspace"]);
|
||||
assert.deepStrictEqual(pushCalls, [{ cwd: "/workspace", remoteName: "origin" }]);
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
makeLayer({
|
||||
@@ -205,9 +202,9 @@ it.effect("publishes by creating the repository, adding a remote, and pushing up
|
||||
remoteCalls.push(input);
|
||||
return "origin";
|
||||
}),
|
||||
pushCurrentBranch: (cwd) =>
|
||||
pushCurrentBranch: (cwd, _fallbackBranch, options) =>
|
||||
Effect.sync(() => {
|
||||
pushCalls.push(cwd);
|
||||
pushCalls.push({ cwd, remoteName: options?.remoteName });
|
||||
return {
|
||||
status: "pushed" as const,
|
||||
branch: "feature/remote-v1",
|
||||
@@ -221,6 +218,43 @@ it.effect("publishes by creating the repository, adding a remote, and pushing up
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("publishes to the remote name returned by ensureRemote", () => {
|
||||
const pushCalls: Array<{ cwd: string; remoteName: string | null | undefined }> = [];
|
||||
|
||||
return Effect.gen(function* () {
|
||||
const service = yield* SourceControlRepositoryService;
|
||||
const result = yield* service.publishRepository({
|
||||
cwd: "/workspace",
|
||||
provider: "github",
|
||||
repository: "octocat/t3code",
|
||||
visibility: "private",
|
||||
remoteName: "origin",
|
||||
protocol: "ssh",
|
||||
});
|
||||
|
||||
assert.equal(result.remoteName, "origin-1");
|
||||
assert.deepStrictEqual(pushCalls, [{ cwd: "/workspace", remoteName: "origin-1" }]);
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
makeLayer({
|
||||
git: {
|
||||
ensureRemote: () => Effect.succeed("origin-1"),
|
||||
pushCurrentBranch: (cwd, _fallbackBranch, options) =>
|
||||
Effect.sync(() => {
|
||||
pushCalls.push({ cwd, remoteName: options?.remoteName });
|
||||
return {
|
||||
status: "pushed" as const,
|
||||
branch: "feature/remote-v1",
|
||||
upstreamBranch: `${options?.remoteName ?? "missing"}/feature/remote-v1`,
|
||||
setUpstream: true,
|
||||
};
|
||||
}),
|
||||
},
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("publish succeeds with status remote_added when the local repo has no commits", () => {
|
||||
let pushCalls = 0;
|
||||
return Effect.gen(function* () {
|
||||
|
||||
@@ -292,7 +292,7 @@ export const make = Effect.fn("makeSourceControlRepositoryService")(function* ()
|
||||
};
|
||||
}
|
||||
|
||||
const pushResult = yield* git.pushCurrentBranch(input.cwd, null);
|
||||
const pushResult = yield* git.pushCurrentBranch(input.cwd, null, { remoteName });
|
||||
|
||||
return {
|
||||
repository: toRepositoryInfo(providerKind, urls),
|
||||
|
||||
@@ -165,6 +165,7 @@ export interface GitVcsDriverShape {
|
||||
readonly pushCurrentBranch: (
|
||||
cwd: string,
|
||||
fallbackBranch: string | null,
|
||||
options?: { readonly remoteName?: string | null },
|
||||
) => Effect.Effect<GitPushResult, GitCommandError>;
|
||||
readonly readRangeContext: (
|
||||
cwd: string,
|
||||
|
||||
@@ -326,5 +326,41 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
|
||||
assert.notEqual(badBranch.exitCode, 0);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("pushes to the requested remote instead of the primary remote", () =>
|
||||
Effect.gen(function* () {
|
||||
const cwd = yield* makeTmpDir();
|
||||
const originRemote = yield* makeTmpDir("git-origin-remote-");
|
||||
const publishRemote = yield* makeTmpDir("git-publish-remote-");
|
||||
yield* initRepoWithCommit(cwd);
|
||||
const driver = yield* GitVcsDriver.GitVcsDriver;
|
||||
yield* git(cwd, ["branch", "-M", "main"]);
|
||||
yield* git(originRemote, ["init", "--bare"]);
|
||||
yield* git(publishRemote, ["init", "--bare"]);
|
||||
yield* git(cwd, ["remote", "add", "origin", originRemote]);
|
||||
yield* git(cwd, ["remote", "add", "origin-1", publishRemote]);
|
||||
|
||||
const pushed = yield* driver.pushCurrentBranch(cwd, null, { remoteName: "origin-1" });
|
||||
|
||||
assert.deepInclude(pushed, {
|
||||
status: "pushed",
|
||||
branch: "main",
|
||||
upstreamBranch: "origin-1/main",
|
||||
setUpstream: true,
|
||||
});
|
||||
assert.equal(
|
||||
yield* git(publishRemote, ["log", "-1", "--pretty=%s", "main"]),
|
||||
"initial commit",
|
||||
);
|
||||
const originMain = yield* driver.execute({
|
||||
operation: "GitVcsDriver.test.originMainMissing",
|
||||
cwd: originRemote,
|
||||
args: ["show-ref", "--verify", "--quiet", "refs/heads/main"],
|
||||
allowNonZeroExit: true,
|
||||
timeoutMs: 10_000,
|
||||
});
|
||||
assert.notEqual(originMain.exitCode, 0);
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1431,7 +1431,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
|
||||
});
|
||||
|
||||
const pushCurrentBranch: GitVcsDriverShape["pushCurrentBranch"] = Effect.fn("pushCurrentBranch")(
|
||||
function* (cwd, fallbackBranch) {
|
||||
function* (cwd, fallbackBranch, options) {
|
||||
const details = yield* statusDetails(cwd);
|
||||
const branch = details.branch ?? fallbackBranch;
|
||||
if (!branch) {
|
||||
@@ -1443,6 +1443,23 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
|
||||
);
|
||||
}
|
||||
|
||||
const requestedRemoteName = options?.remoteName?.trim() || null;
|
||||
if (requestedRemoteName) {
|
||||
const publishBranch = yield* resolvePublishBranchName(cwd, branch);
|
||||
yield* runGit("GitVcsDriver.pushCurrentBranch.pushWithRequestedRemote", cwd, [
|
||||
"push",
|
||||
"-u",
|
||||
requestedRemoteName,
|
||||
`HEAD:refs/heads/${publishBranch}`,
|
||||
]);
|
||||
return {
|
||||
status: "pushed" as const,
|
||||
branch,
|
||||
upstreamBranch: `${requestedRemoteName}/${publishBranch}`,
|
||||
setUpstream: true,
|
||||
};
|
||||
}
|
||||
|
||||
const hasNoLocalDelta = details.aheadCount === 0 && details.behindCount === 0;
|
||||
if (hasNoLocalDelta) {
|
||||
if (details.hasUpstream) {
|
||||
|
||||
@@ -967,9 +967,11 @@ export default function GitActionsControl({
|
||||
const canPublishRepository = isRepo && gitStatusForActions !== null && !hasPrimaryRemote;
|
||||
const canSubmitPublishRepository = (() => {
|
||||
if (publishRepositoryMutation.isPending) return false;
|
||||
const [owner, ...rest] = publishRepository.trim().split("/");
|
||||
const repositoryParts = publishRepository.trim().split("/");
|
||||
const owner = repositoryParts[0]?.trim() ?? "";
|
||||
const rest = repositoryParts.slice(1);
|
||||
const name = rest.join("/").trim();
|
||||
return owner.trim().length > 0 && name.length > 0;
|
||||
return owner.length > 0 && name.length > 0;
|
||||
})();
|
||||
|
||||
const publishHost = publishProvider === "github" ? "github.com" : "gitlab.com";
|
||||
@@ -1413,22 +1415,20 @@ export default function GitActionsControl({
|
||||
aria-labelledby="publish-provider-cards-label"
|
||||
className="grid grid-cols-2 gap-2.5"
|
||||
>
|
||||
{(
|
||||
[
|
||||
{
|
||||
value: "github" as const,
|
||||
label: "GitHub",
|
||||
description: "github.com",
|
||||
Icon: GitHubIcon,
|
||||
},
|
||||
{
|
||||
value: "gitlab" as const,
|
||||
label: "GitLab",
|
||||
description: "gitlab.com",
|
||||
Icon: GitLabIcon,
|
||||
},
|
||||
]
|
||||
).map((option) => {
|
||||
{[
|
||||
{
|
||||
value: "github" as const,
|
||||
label: "GitHub",
|
||||
description: "github.com",
|
||||
Icon: GitHubIcon,
|
||||
},
|
||||
{
|
||||
value: "gitlab" as const,
|
||||
label: "GitLab",
|
||||
description: "gitlab.com",
|
||||
Icon: GitLabIcon,
|
||||
},
|
||||
].map((option) => {
|
||||
const isSelected = publishProvider === option.value;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
@@ -1459,191 +1459,189 @@ export default function GitActionsControl({
|
||||
</DialogPanel>
|
||||
)}
|
||||
{publishWizardStep === 1 && (
|
||||
<DialogPanel className="space-y-5">
|
||||
<div className="space-y-2">
|
||||
<label
|
||||
htmlFor="publish-repository-path"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Repository
|
||||
</label>
|
||||
<div className="flex items-stretch overflow-hidden rounded-md border border-input bg-background focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-ring">
|
||||
<span className="flex shrink-0 items-center gap-1.5 border-r border-input bg-muted/50 px-2.5 font-mono text-xs text-muted-foreground">
|
||||
{publishProvider === "github" ? (
|
||||
<GitHubIcon className="size-3.5" />
|
||||
) : (
|
||||
<GitLabIcon className="size-3.5" />
|
||||
)}
|
||||
{publishHost}/
|
||||
</span>
|
||||
<input
|
||||
id="publish-repository-path"
|
||||
name="publish-repository-path"
|
||||
value={publishRepository}
|
||||
onChange={(event) => {
|
||||
setPublishRepository(event.target.value);
|
||||
setHasUserEditedPublishRepository(true);
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
submitPublishRepository();
|
||||
}
|
||||
}}
|
||||
placeholder={publishPathPlaceholder}
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="w-full bg-transparent px-3 py-2 font-mono text-sm placeholder:text-muted-foreground/60 focus:outline-none"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<span
|
||||
id="publish-visibility-cards-label"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Visibility
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={publishVisibility}
|
||||
onValueChange={(value) =>
|
||||
setPublishVisibility(value as SourceControlRepositoryVisibility)
|
||||
}
|
||||
aria-labelledby="publish-visibility-cards-label"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="grid grid-cols-2 gap-2.5"
|
||||
>
|
||||
{(
|
||||
[
|
||||
{
|
||||
value: "private" as const,
|
||||
label: "Private",
|
||||
description: "Only invited people",
|
||||
Icon: LockIcon,
|
||||
},
|
||||
{
|
||||
value: "public" as const,
|
||||
label: "Public",
|
||||
description: "Anyone on the web",
|
||||
Icon: GlobeIcon,
|
||||
},
|
||||
]
|
||||
).map((option) => {
|
||||
const isSelected = publishVisibility === option.value;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
className={cn(
|
||||
"relative flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background shadow-sm ring-2 ring-primary/35"
|
||||
: "border-border bg-background hover:border-foreground/20 hover:bg-muted/50",
|
||||
)}
|
||||
>
|
||||
<option.Icon
|
||||
className="size-4 shrink-0 text-muted-foreground"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
<span className="block text-xs text-muted-foreground">
|
||||
{option.description}
|
||||
</span>
|
||||
</span>
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setPublishAdvancedOpen((prev) => !prev)}
|
||||
aria-expanded={publishAdvancedOpen}
|
||||
className="flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
|
||||
>
|
||||
<ChevronDownIcon
|
||||
className={cn(
|
||||
"size-3.5 transition-transform",
|
||||
publishAdvancedOpen ? "" : "-rotate-90",
|
||||
)}
|
||||
/>
|
||||
Advanced
|
||||
</button>
|
||||
{publishAdvancedOpen && (
|
||||
<div className="mt-3 grid gap-3 sm:grid-cols-2">
|
||||
<label className="space-y-1.5" htmlFor="publish-remote-name">
|
||||
<span className="text-xs font-medium text-foreground">Remote</span>
|
||||
<Input
|
||||
id="publish-remote-name"
|
||||
value={publishRemoteName}
|
||||
onChange={(event) => setPublishRemoteName(event.target.value)}
|
||||
placeholder="origin"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
/>
|
||||
</label>
|
||||
<div className="space-y-1.5">
|
||||
<span
|
||||
id="publish-protocol-label"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Protocol
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={publishProtocol}
|
||||
onValueChange={(value) =>
|
||||
setPublishProtocol(value as SourceControlCloneProtocol)
|
||||
}
|
||||
aria-labelledby="publish-protocol-label"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="grid grid-cols-2 gap-2"
|
||||
>
|
||||
{(["ssh", "https"] as const).map((value) => {
|
||||
const isSelected = publishProtocol === value;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={value}
|
||||
value={value}
|
||||
className={cn(
|
||||
"rounded-md border px-3 py-1.5 text-center text-sm font-medium outline-none transition",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background ring-2 ring-primary/35 text-foreground"
|
||||
: "border-border bg-background text-muted-foreground hover:border-foreground/20 hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
{value === "ssh" ? "SSH" : "HTTPS"}
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
</div>
|
||||
<DialogPanel className="space-y-5">
|
||||
<div className="space-y-2">
|
||||
<label
|
||||
htmlFor="publish-repository-path"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Repository
|
||||
</label>
|
||||
<div className="flex items-stretch overflow-hidden rounded-md border border-input bg-background focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-ring">
|
||||
<span className="flex shrink-0 items-center gap-1.5 border-r border-input bg-muted/50 px-2.5 font-mono text-xs text-muted-foreground">
|
||||
{publishProvider === "github" ? (
|
||||
<GitHubIcon className="size-3.5" />
|
||||
) : (
|
||||
<GitLabIcon className="size-3.5" />
|
||||
)}
|
||||
{publishHost}/
|
||||
</span>
|
||||
<input
|
||||
id="publish-repository-path"
|
||||
name="publish-repository-path"
|
||||
value={publishRepository}
|
||||
onChange={(event) => {
|
||||
setPublishRepository(event.target.value);
|
||||
setHasUserEditedPublishRepository(true);
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
submitPublishRepository();
|
||||
}
|
||||
}}
|
||||
placeholder={publishPathPlaceholder}
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="w-full bg-transparent px-3 py-2 font-mono text-sm placeholder:text-muted-foreground/60 focus:outline-none"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<span
|
||||
id="publish-visibility-cards-label"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Visibility
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={publishVisibility}
|
||||
onValueChange={(value) =>
|
||||
setPublishVisibility(value as SourceControlRepositoryVisibility)
|
||||
}
|
||||
aria-labelledby="publish-visibility-cards-label"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="grid grid-cols-2 gap-2.5"
|
||||
>
|
||||
{[
|
||||
{
|
||||
value: "private" as const,
|
||||
label: "Private",
|
||||
description: "Only invited people",
|
||||
Icon: LockIcon,
|
||||
},
|
||||
{
|
||||
value: "public" as const,
|
||||
label: "Public",
|
||||
description: "Anyone on the web",
|
||||
Icon: GlobeIcon,
|
||||
},
|
||||
].map((option) => {
|
||||
const isSelected = publishVisibility === option.value;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
className={cn(
|
||||
"relative flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background shadow-sm ring-2 ring-primary/35"
|
||||
: "border-border bg-background hover:border-foreground/20 hover:bg-muted/50",
|
||||
)}
|
||||
>
|
||||
<option.Icon
|
||||
className="size-4 shrink-0 text-muted-foreground"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="block text-sm font-medium text-foreground">
|
||||
{option.label}
|
||||
</span>
|
||||
<span className="block text-xs text-muted-foreground">
|
||||
{option.description}
|
||||
</span>
|
||||
</span>
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setPublishAdvancedOpen((prev) => !prev)}
|
||||
aria-expanded={publishAdvancedOpen}
|
||||
className="flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
|
||||
>
|
||||
<ChevronDownIcon
|
||||
className={cn(
|
||||
"size-3.5 transition-transform",
|
||||
publishAdvancedOpen ? "" : "-rotate-90",
|
||||
)}
|
||||
/>
|
||||
Advanced
|
||||
</button>
|
||||
{publishAdvancedOpen && (
|
||||
<div className="mt-3 grid gap-3 sm:grid-cols-2">
|
||||
<label className="space-y-1.5" htmlFor="publish-remote-name">
|
||||
<span className="text-xs font-medium text-foreground">Remote</span>
|
||||
<Input
|
||||
id="publish-remote-name"
|
||||
value={publishRemoteName}
|
||||
onChange={(event) => setPublishRemoteName(event.target.value)}
|
||||
placeholder="origin"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
/>
|
||||
</label>
|
||||
<div className="space-y-1.5">
|
||||
<span
|
||||
id="publish-protocol-label"
|
||||
className="text-xs font-medium text-foreground"
|
||||
>
|
||||
Protocol
|
||||
</span>
|
||||
<RadioGroup
|
||||
value={publishProtocol}
|
||||
onValueChange={(value) =>
|
||||
setPublishProtocol(value as SourceControlCloneProtocol)
|
||||
}
|
||||
aria-labelledby="publish-protocol-label"
|
||||
disabled={publishRepositoryMutation.isPending}
|
||||
className="grid grid-cols-2 gap-2"
|
||||
>
|
||||
{(["ssh", "https"] as const).map((value) => {
|
||||
const isSelected = publishProtocol === value;
|
||||
return (
|
||||
<RadioPrimitive.Root
|
||||
key={value}
|
||||
value={value}
|
||||
className={cn(
|
||||
"rounded-md border px-3 py-1.5 text-center text-sm font-medium outline-none transition",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
||||
isSelected
|
||||
? "border-primary bg-background ring-2 ring-primary/35 text-foreground"
|
||||
: "border-border bg-background text-muted-foreground hover:border-foreground/20 hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
{value === "ssh" ? "SSH" : "HTTPS"}
|
||||
</RadioPrimitive.Root>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
</div>
|
||||
</div>
|
||||
{publishRepositoryMutation.isPending && (
|
||||
<div
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
className="flex items-center gap-2 rounded-md border border-input bg-muted/40 px-3 py-2 text-xs text-muted-foreground"
|
||||
>
|
||||
<Spinner className="size-3.5" aria-hidden />
|
||||
Publishing repository to {publishProviderLabel}...
|
||||
</div>
|
||||
)}
|
||||
{publishError && !publishRepositoryMutation.isPending && (
|
||||
<div
|
||||
role="alert"
|
||||
className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive"
|
||||
>
|
||||
<p className="font-medium">Publish failed</p>
|
||||
<p className="mt-0.5 text-destructive/90">{publishError}</p>
|
||||
</div>
|
||||
)}
|
||||
</DialogPanel>
|
||||
)}
|
||||
</div>
|
||||
{publishRepositoryMutation.isPending && (
|
||||
<div
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
className="flex items-center gap-2 rounded-md border border-input bg-muted/40 px-3 py-2 text-xs text-muted-foreground"
|
||||
>
|
||||
<Spinner className="size-3.5" aria-hidden />
|
||||
Publishing repository to {publishProviderLabel}...
|
||||
</div>
|
||||
)}
|
||||
{publishError && !publishRepositoryMutation.isPending && (
|
||||
<div
|
||||
role="alert"
|
||||
className="rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive"
|
||||
>
|
||||
<p className="font-medium">Publish failed</p>
|
||||
<p className="mt-0.5 text-destructive/90">{publishError}</p>
|
||||
</div>
|
||||
)}
|
||||
</DialogPanel>
|
||||
)}
|
||||
{publishWizardStep === 2 && publishResult && (
|
||||
<DialogPanel className="space-y-4">
|
||||
|
||||
Reference in new issue
Block a user