feat: wire a repo to a real registered marketplace domain (musehub#117 Phase 3)
DOM_12: MusehubDomainInstall turned out to be a user<->domain adoption record, not a repo<->domain link, and the existing MusehubRepo.domain_id column is a plain VCS-plugin category string ('code'/'midi'/'mist') load-bearing for the profile heatmap - musehub_profile.py even actively guards against a real marketplace ID leaking into it from a past incident. Neither was the right mechanism, so added a genuinely new, separate column: MusehubRepo.marketplace_domain_id (migration 0074).
Wired end to end: - PATCH /api/repos/{repo_id}/settings accepts marketplace_domain_id - 404s if the target domain doesn't exist, '' clears the link, owner/ admin-guarded like every other setting on this endpoint. - DOM_13: record_domain_uninstall added (record_domain_install had no counterpart) - install/uninstall bookkeeping fires exactly once per actual link/unlink, never double-counts on a re-sent identical patch, never goes negative, is scoped per-user. - repo_nav.html already had real, dormant logic for a repo_domain badge (documented in its own header comment, never actually populated by any route) - populated it via a new _resolve_repo_domain() in the shared _nav_ctx.py helper, wired into both the main repo home page (ui_repo.py, which builds its nav context inline rather than through the shared helper) and the two insights-dashboard routes already using build_repo_nav_ctx.
19 new tests across test_domains.py (install/uninstall lifecycle, repo home badge E2E) and test_musehub_repos.py (settings patch: link/404/ clear/idempotent). Bumped the migration-count/head golden constants (0073->0074) in test_migrations.py and test_musehub_alembic.py. 171 passed across test_domains.py/test_musehub_repos.py/ test_musehub_ui_repo_home_ssr.py, 49/49 test_migrations.py (full up/ down/re-up cycle), 6/6 test_musehub_alembic.py, zero regressions.
Semantic Changes
53 symbols
Files Changed
+1
~11
1003 in snapshot
0 comments
muse hub commit comment sha256:62dd2e53c948b1f169c6c353b0791b8da11e941895e9fc8d89accddac96778bf --body "your comment"
No comments yet. Be the first to start the discussion.