fix(registry): clean content_repo failure in hygiene; retire META_REPO from .env.example; clarity + idempotency test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-06-03 23:28:08 -07:00
parent cecc6c0b41
commit 48fd6f9675
4 changed files with 38 additions and 21 deletions
@@ -110,15 +110,21 @@ def test_registry_mirror_is_idempotent(app_with_fake_gitea):
"""Re-running the registry mirror is safe — it upserts (overwrites) the
projects row from projects.yaml each time without raising. M3 retirement
of seed_default_project: the registry mirror is now the sole authority."""
from app import db
import asyncio
from app import db, registry as registry_mod
app, _ = app_with_fake_gitea
with TestClient(app):
# After startup the row should have content_repo from projects.yaml.
got = db.conn().execute(
"SELECT content_repo FROM projects WHERE id = 'default'"
).fetchone()["content_repo"]
assert got == "meta"
before = db.conn().execute("SELECT COUNT(*) AS n FROM projects").fetchone()["n"]
cfg = app.state.config
gitea = app.state.gitea
asyncio.run(registry_mod.refresh_registry(cfg, gitea))
after = db.conn().execute("SELECT COUNT(*) AS n FROM projects").fetchone()["n"]
assert after == before
row = db.conn().execute(
"SELECT content_repo FROM projects WHERE id='default'"
).fetchone()
assert row["content_repo"] == "meta"
def test_registry_repo_config_wired(app_with_fake_gitea, monkeypatch):