Add support for jujutsu VCS #743
Closedponbac(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/743/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
ponbac(GitHub profile, opens in a new tab) closed this
- apps/server/src/vcs/Layers/VcsProcess.ts line 32Resolvedby ponbac(GitHub profile, opens in a new tab)@@ -0,0 +12,21 @@12+function quoteCommand(command: string, args: ReadonlyArray<string>): string {13+ return [command, ...args].join(" ");14+}15+16+function toVcsCommandError(17+ input: Pick<ExecuteVcsProcessInput, "operation" | "command" | "cwd" | "args">,18+ detail: string,19+) {20+ return (cause: unknown) =>21+ Schema.is(VcsCommandError)(cause)22+ ? cause23+ : new VcsCommandError({24+ operation: input.operation,25+ command: quoteCommand(input.command, input.args),26+ cwd: input.cwd,27+ detail,28+ ...(cause !== undefined ? { cause } : {}),29+ });30+}31+32+const execute: VcsProcessShape["execute"] = (input) =>apps/web/src/lib/localStorageShim.ts lines 29 to 37Resolvedby ponbac(GitHub profile, opens in a new tab)@@ -0,0 +17,21 @@17+ }18+ return Array.from(storageBacking.keys())[index] ?? null;19+ },20+ removeItem(key) {21+ storageBacking.delete(String(key));22+ },23+ setItem(key, value) {24+ storageBacking.set(String(key), String(value));25+ },26+ };27+}28+29+export function ensureLocalStorage(): Storage {30+ const candidate = globalThis.localStorage;31+ if (32+ candidate &&33+ typeof candidate.getItem === "function" &&34+ typeof candidate.setItem === "function" &&35+ typeof candidate.removeItem === "function" &&36+ typeof candidate.clear === "function"37+ ) {apps/server/src/orchestration/threadVcsMetadata.ts lines 16 to 16Resolvedby ponbac(GitHub profile, opens in a new tab)@@ -0,0 +1,16 @@1+import type { VcsBackend, VcsRefKind } from "@t3tools/contracts";2+3+interface LegacyThreadVcsMetadataInput {4+ readonly vcsBackend?: VcsBackend | undefined;5+ readonly refName?: string | null | undefined;6+ readonly refKind?: VcsRefKind | null | undefined;7+ readonly workspacePath?: string | null | undefined;8+ readonly branch?: string | null | undefined;9+ readonly worktreePath?: string | null | undefined;10+}11+12+export function normalizeLegacyThreadVcsMetadata(input: LegacyThreadVcsMetadataInput) {13+ const refName = input.refName ?? input.branch ?? null;14+ const workspacePath = input.workspacePath ?? input.worktreePath ?? null;15+ const hasRefKind = input.refKind !== undefined;16+ const hasLegacyBranch = input.branch !== undefined;apps/web/src/components/BranchToolbar.logic.ts line 97Resolvedby ponbac(GitHub profile, opens in a new tab)@@ -44 +77,21 @@77+ const resolvedValue = resolveBranchToolbarValue({78+ envMode: input.envMode,79+ activeWorktreePath: input.activeWorktreePath,80+ activeThreadBranch: input.activeThreadBranch,81+ currentGitBranch,82+ });83+ return {84+ displayValue: resolvedValue,85+ selectedValue: resolvedValue,86+ };87+ }88+89+ const inferredDisplayValue = formatCurrentVcsRefNames(input.currentRefNames);90+ return {91+ displayValue: input.activeThreadBranch ?? inferredDisplayValue,92+ selectedValue:93+ input.activeThreadBranch ?? (input.currentRefNames.length === 1 ? input.currentRefNames[0]! : null),94+ };95+}96+4497 export function deriveLocalBranchNameFromRemoteRef(branchName: string): string {@@ -0,0 +95,21 @@95+ backend: VcsBackend,96+ capabilities: VcsCapabilities,97+ refName: TrimmedNonEmptyStringSchema.pipe(Schema.NullOr),98+ refKind: Schema.NullOr(VcsRefKind),99+ hasWorkingTreeChanges: Schema.Boolean,100+ workingTree: Schema.Struct({101+ files: Schema.Array(102+ Schema.Struct({103+ path: TrimmedNonEmptyStringSchema,104+ insertions: NonNegativeInt,105+ deletions: NonNegativeInt,106+ }),107+ ),108+ insertions: NonNegativeInt,109+ deletions: NonNegativeInt,110+ }),111+ hasUpstream: Schema.Boolean,112+ aheadCount: NonNegativeInt,113+ behindCount: NonNegativeInt,114+ pr: Schema.NullOr(VcsStatusPr),115+});
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
130cef4e-2e28-4607-98fb-8a355fd9b36fYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip
Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Share your feedback on Discord.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share