§22 S2: create-collection endpoint (bot commit + registry refresh)

POST /api/projects/<id>/collections, owner/admin-gated, commits a
.collection.yaml to the content repo main via bot.create_collection, then
re-mirrors the registry so the collections row appears (§22.2). Adds GET
list/one collection routes. Extends FakeGitea to model directory listings so
the mirror's content-repo walk is exercised end to end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-05 13:10:09 -07:00
parent f57d4080dc
commit 0c654b173d
5 changed files with 266 additions and 11 deletions
+2
View File
@@ -21,6 +21,7 @@ from pydantic import BaseModel, Field
from . import (
api_admin,
api_branches,
api_collections,
api_contributions,
api_deployment,
api_discussion,
@@ -152,6 +153,7 @@ def make_router(
# §22.9/§22.10 (M3): runtime deployment + per-project config (replaces
# VITE_APP_NAME) + the old-URL 308 redirects.
router.include_router(api_deployment.make_router(config))
router.include_router(api_collections.make_router(config, gitea, bot))
# ---------------------------------------------------------------
# §17: /api/health — unauthenticated post-flight probe.