feat: support external repositories for git mounts

- Make project_id nullable in git_repositories table (migration)
- Allow external repos not tied to any project
- Update validation to allow user-owned external repos in git mounts
- Add /projects/repositories endpoint to list all user repos
- Update frontend to fetch all user repos for git mount selector
- TypeScript and build pass
This commit is contained in:
Alex Blank
2026-05-27 10:28:31 +02:00
parent e7adfb462b
commit 93b415c53e
7 changed files with 85 additions and 15 deletions
+7 -11
View File
@@ -19,7 +19,7 @@ import {
type ResolvedProfile,
} from "../api/config_profiles";
import { listProjects } from "../api/projects";
import { listRepositories, type GitRepository } from "../api/git_repositories";
import { listAllUserRepositories, 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";
@@ -72,17 +72,13 @@ export const ConfigProfilesPage = () => {
setProjects(projs || []);
setToolTypes(types || []);
// Load repositories from all projects
const allRepos: GitRepository[] = [];
for (const project of projs || []) {
try {
const repos = await listRepositories(project.id);
allRepos.push(...repos);
} catch {
// Skip projects we can't access
}
// Load all user repositories (including external ones)
try {
const allRepos = await listAllUserRepositories();
setRepositories(allRepos);
} catch {
setRepositories([]);
}
setRepositories(allRepos);
setStatus("ready");
} catch {