Add remote repository publish and discovery support#2482
Add remote repository publish and discovery support#2482juliusmarminge merged 7 commits intomainfrom
Conversation
- add source control repository service for lookup, clone, and publish - implement GitHub/GitLab repository creation and update discovery handling - wire UI and server flows to use remote repository actions
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Publish push ignores newly configured remote name
- Changed
git.pushCurrentBranch(input.cwd, null)togit.pushCurrentBranch(input.cwd, remoteName)so the push targets the remote that was just configured byensureRemote.
- Changed
Or push these changes by commenting:
@cursor push a5bc715907
Preview (a5bc715907)
diff --git a/apps/server/src/sourceControl/SourceControlRepositoryService.ts b/apps/server/src/sourceControl/SourceControlRepositoryService.ts
--- a/apps/server/src/sourceControl/SourceControlRepositoryService.ts
+++ b/apps/server/src/sourceControl/SourceControlRepositoryService.ts
@@ -292,7 +292,7 @@
};
}
- const pushResult = yield* git.pushCurrentBranch(input.cwd, null);
+ const pushResult = yield* git.pushCurrentBranch(input.cwd, remoteName);
return {
repository: toRepositoryInfo(providerKind, urls),You can send follow-ups to the cloud agent here.
ApprovabilityVerdict: Needs human review Substantial new feature adding remote repository clone and publish capabilities across backend services, CLI integrations, and UI. Introduces new user-facing workflows and has an unresolved comment about dialog state not resetting properly. You can customize Macroscope's approvability policy. Learn more. |
- Pass the ensured remote name through publish flow - Push directly to that remote when publishing a repository - Add coverage for remote-specific push behavior
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: GitLab clone URL used as web URL in browser
- Changed normalizeRepositoryCloneUrls to use raw.web_url (the browser-friendly URL without .git suffix) instead of raw.http_url_to_repo for the url field, consistent with how GitHub's url field works.
Or push these changes by commenting:
@cursor push 153bb29c80
Preview (153bb29c80)
diff --git a/apps/server/src/sourceControl/GitLabCli.ts b/apps/server/src/sourceControl/GitLabCli.ts
--- a/apps/server/src/sourceControl/GitLabCli.ts
+++ b/apps/server/src/sourceControl/GitLabCli.ts
@@ -176,7 +176,7 @@
): GitLabRepositoryCloneUrls {
return {
nameWithOwner: raw.path_with_namespace,
- url: raw.http_url_to_repo || raw.web_url,
+ url: raw.web_url,
sshUrl: raw.ssh_url_to_repo,
};
}You can send follow-ups to the cloud agent here.
- add publishRepository query key mock - add sourceControlPublishRepository mutation options mock Co-authored-by: codex <codex@users.noreply.github.com>
The normalizeRepositoryCloneUrls function was using http_url_to_repo (which has a .git suffix) as the url field. This caused the 'Open on GitLab' button to open a .git-suffixed URL and display it in the UI. Use web_url instead, which is the proper browser URL and also works as an HTTPS clone URL.
The normalizeRepositoryCloneUrls function was using http_url_to_repo (which has a .git suffix) as the url field. This caused the 'Open on GitLab' button to open a .git-suffixed URL and display it in the UI. Use web_url instead, which is the proper browser URL and also works as an HTTPS clone URL. Applied via @cursor push command
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: GitLab test asserts wrong URL field value
- Updated both test assertions to expect
web_urlvalue ("https://gitlab.com/octocat/t3code") instead ofhttp_url_to_repovalue ("https://gitlab.com/octocat/t3code.git"), matching thenormalizeRepositoryCloneUrlsimplementation that now usesraw.web_url.
- Updated both test assertions to expect
Or push these changes by commenting:
@cursor push df1160c81c
Preview (df1160c81c)
diff --git a/apps/server/src/sourceControl/GitLabCli.test.ts b/apps/server/src/sourceControl/GitLabCli.test.ts
--- a/apps/server/src/sourceControl/GitLabCli.test.ts
+++ b/apps/server/src/sourceControl/GitLabCli.test.ts
@@ -175,7 +175,7 @@
assert.deepStrictEqual(result, {
nameWithOwner: "octocat/t3code",
- url: "https://gitlab.com/octocat/t3code.git",
+ url: "https://gitlab.com/octocat/t3code",
sshUrl: "git@gitlab.com:octocat/t3code.git",
});
}),
@@ -243,7 +243,7 @@
assert.deepStrictEqual(result, {
nameWithOwner: "octocat/t3code",
- url: "https://gitlab.com/octocat/t3code.git",
+ url: "https://gitlab.com/octocat/t3code",
sshUrl: "git@gitlab.com:octocat/t3code.git",
});
expect(mockedRun).toHaveBeenNthCalledWith(You can send follow-ups to the cloud agent here.
…using web_url The normalizeRepositoryCloneUrls function was changed to return raw.web_url instead of raw.http_url_to_repo || raw.web_url, but the test assertions still expected the http_url_to_repo value (with .git suffix). Updated both assertions to expect the web_url value (without .git suffix). Applied via @cursor push command
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Publish dialog doesn't reset visibility on close
- Added resets for publishProvider, publishVisibility, and publishProtocol in the dialog's onOpenChange handler so they return to their safe defaults ("github", "private", "ssh") when the dialog closes.
Or push these changes by commenting:
@cursor push f485be5715
You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit df59af7. Configure here.
| setPublishAdvancedOpen(false); | ||
| setPublishError(null); | ||
| setPublishResult(null); | ||
| } |
There was a problem hiding this comment.
Publish dialog doesn't reset visibility on close
Medium Severity
The publish dialog's onOpenChange handler resets most state (publishRemoteName, publishRepository, publishWizardStep, etc.) when the dialog closes, but omits resetting publishProvider, publishVisibility, and publishProtocol. The publishVisibility not resetting is particularly risky — if a user once selects "public" and later re-opens the dialog, it defaults to "public" instead of the safe "private" default, potentially causing accidental public repository creation.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit df59af7. Configure here.



Summary
Testing
bun fmtbun lintbun typecheckbun run testNote
Medium Risk
Medium risk because it adds new RPC surface area and wiring across server+web for cloning/publishing, and changes
GitVcsDriver.pushCurrentBranchsemantics to optionally push to a specified remote (affecting publish behavior).Overview
Enables remote repository workflows by introducing
SourceControlRepositoryServicewithlookupRepository,cloneRepository, andpublishRepository(create remote repo, add/ensure remote, push if commits exist; otherwise returnremote_added).Extends GitHub/GitLab provider layers to support
createRepository(GitHub parsesgh repo createstdout to avoid eventual-consistency races; GitLab resolves namespace IDs and normalizes clone URLs), adds new WS RPC methods (sourceControl.*) and clientenvironmentApibindings, and updates tests/contracts accordingly.Updates the web UI to support Add project from remote (GitHub/GitLab/URL clone flow in
CommandPalette) and a Publish repository wizard inGitActionsControl; quick actions/menu behavior changes when no primary remote exists. Also adjusts source control discovery to treat Bitbucket as unimplemented (no CLI probing, clearer messaging).Reviewed by Cursor Bugbot for commit df59af7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add remote repository publish and clone discovery support via GitHub and GitLab
SourceControlRepositoryServicewithlookupRepository,cloneRepository, andpublishRepositoryoperations, backed by GitHub CLI and GitLab CLI providers.sourceControl.lookupRepository,sourceControl.cloneRepository,sourceControl.publishRepository) and wires them intoEnvironmentApi.GitActionsControl: users select provider, repo name, visibility, and remote name; if the local repo has no commits, publish returnsremote_addedwithout pushing.open_publish) instead of a disabled push hint when no primary remote is configured.GitVcsDriverCore.pushCurrentBranchnow accepts an optionalremoteNameto push to a specific remote instead of the configured upstream.unknownauth state with an install hint instead of probing for auth, and discovery items may omit theexecutablefield.Macroscope summarized df59af7.