feat: simplify git mounts to use direct URLs instead of repo references
- Change git mount schema from repo_id to remote_url - Remove database lookups for git mount resolution - Clone directly from URL at instance startup - Simplify frontend UI to text input for Git URL - Fix route ordering in git_repositories.py to prevent 422 errors - Update all tests to use remote_url field Breaking change: Git mounts now use remote_url instead of repo_id
This commit is contained in:
@@ -19,7 +19,6 @@ import {
|
||||
type ResolvedProfile,
|
||||
} from "../api/config_profiles";
|
||||
import { listProjects } from "../api/projects";
|
||||
import { listAllUserRepositories, createExternalRepository, type GitRepository } from "../api/git_repositories";
|
||||
import type { Project } from "../types";
|
||||
import { listToolTypes, type ToolType } from "../api/tool_types";
|
||||
import { GitMountEditor } from "../components/git-mount-editor";
|
||||
@@ -34,7 +33,6 @@ export const ConfigProfilesPage = () => {
|
||||
const [profiles, setProfiles] = useState<ConfigProfile[]>([]);
|
||||
const [projects, setProjects] = useState<Project[]>([]);
|
||||
const [toolTypes, setToolTypes] = useState<ToolType[]>([]);
|
||||
const [repositories, setRepositories] = useState<GitRepository[]>([]);
|
||||
|
||||
const [selectedProfileId, setSelectedProfileId] = useState<string | null>(null);
|
||||
const [isCreating, setIsCreating] = useState(false);
|
||||
@@ -72,14 +70,6 @@ export const ConfigProfilesPage = () => {
|
||||
setProjects(projs || []);
|
||||
setToolTypes(types || []);
|
||||
|
||||
// Load all user repositories (including external ones)
|
||||
try {
|
||||
const allRepos = await listAllUserRepositories();
|
||||
setRepositories(allRepos);
|
||||
} catch {
|
||||
setRepositories([]);
|
||||
}
|
||||
|
||||
setStatus("ready");
|
||||
} catch {
|
||||
setStatus("error");
|
||||
@@ -1257,16 +1247,7 @@ export const ConfigProfilesPage = () => {
|
||||
<div className="form-section">
|
||||
<GitMountEditor
|
||||
mounts={formData.git_mounts || []}
|
||||
repositories={repositories}
|
||||
onChange={(git_mounts) => updateFormField("git_mounts", git_mounts)}
|
||||
onCreateRepository={async (name, remoteUrl) => {
|
||||
const repo = await createExternalRepository({
|
||||
name,
|
||||
remote_url: remoteUrl,
|
||||
});
|
||||
setRepositories((prev) => [...prev, repo]);
|
||||
return repo;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user