Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/server/src/project/RepositoryIdentityResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
expect(identity?.displayName).toBe("T3Tools/t3code");
expect(identity?.origin).toEqual({
canonicalKey: "github.com/julius/t3code-fork",
remoteUrl: "git@github.com:julius/t3code-fork.git",
displayName: "julius/t3code-fork",
});
}).pipe(Effect.provide(RepositoryIdentityResolver.layer)),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/project/RepositoryIdentityResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function buildRepositoryOrigin(
const originKey = normalizeGitRemoteUrl(originUrl);
if (originKey === canonicalKey) return undefined;
const displayName = repositoryPathOf(originKey, originUrl);
return { canonicalKey: originKey, ...(displayName ? { displayName } : {}) };
return { canonicalKey: originKey, remoteUrl: originUrl, ...(displayName ? { displayName } : {}) };
}

function buildRepositoryIdentity(input: {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/AddProjectToMachineDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ function AddProjectToMachineDialog({ request }: { request: AddProjectToMachineRe
const [targetId, setTargetId] = useState(request.targetEnvironmentId);
const target = targets.find((t) => t.environmentId === targetId) ?? targets[0] ?? null;
const source = environments.find((env) => env.environmentId === request.projectRef.environmentId);
const sourceUrl = project?.repositoryIdentity?.locator.remoteUrl ?? "";
const sourceUrl =
project?.repositoryIdentity?.origin?.remoteUrl ??
project?.repositoryIdentity?.locator.remoteUrl ??
"";
const [protocol, setProtocol] = useState<CloneProtocol | null>(() => cloneUrlProtocol(sourceUrl));
const sshUrl = cloneUrlForProtocol(sourceUrl, "ssh");
const httpsUrl = cloneUrlForProtocol(sourceUrl, "https");
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export type RepositoryIdentityLocator = typeof RepositoryIdentityLocator.Type;

export const RepositoryOrigin = Schema.Struct({
canonicalKey: TrimmedNonEmptyString,
remoteUrl: Schema.optionalKey(TrimmedNonEmptyString),
displayName: Schema.optionalKey(TrimmedNonEmptyString),
});
export type RepositoryOrigin = typeof RepositoryOrigin.Type;
Expand Down
Loading