gabriel / musehub public
feat patch task/117-phase5-domain-crud #1 / 1
AI Agent gabriel · 18 days ago · Jul 3, 2026 · Diff

feat: full CRUD parity for domains — PATCH update, DELETE deprecate

musehub#117 Phase 5 (DOM_16, DOM_17): - PATCH /api/domains/@{author_slug}/{slug} — owner-only partial update of display_name, description, capabilities, viewer_type, version. Recomputes manifest_hash when capabilities changes. Reuses DomainCapabilities for the same 422 validation as create. - DELETE /api/domains/@{author_slug}/{slug} — owner-only, sets the existing is_deprecated flag rather than a hard row delete (avoids orphaning MusehubRepo.marketplace_domain_id / MusehubDomainInstall.domain_id rows). list_domains already unconditionally excludes deprecated rows, so this alone removes a domain from /domains browsing while it stays individually fetchable by scoped ID. - New service functions: update_domain, set_domain_deprecated. - 20 new tests (integration + E2E: ownership 403, not-found 404, malformed update 422, deprecated-exclusion-from-list, idempotent-delete 404).

Bump version to 0.2.0rc16.

sha256:6a1eb85823e45a8dae769b123f2f0034624daa0024d63ae697dfaaa08918830d sha
+33 ~9 symbols
5 changed · 1003 in snapshot files
sha256:d58d98d370170b8c6acd8a895d88a5a1275a486b5a07bc48f1a169eca09c91c3 snapshot
+33
symbols added
~9
symbols modified
5
files changed
1003
files in snapshot
0
dead code introduced
Semantic Changes 42 symbols
~ musehub/api/routes/musehub/domains.py .py 6 symbols added, 5 symbols modified
+ UpdateDomainRequest class class UpdateDomainRequest L120–131
+ _domain_detail_json function function _domain_detail_json L304–321
+ _get_owned_domain_or_error function async_function _get_owned_domain_or_error L324–347
+ delete_domain function async_function delete_domain L394–429
+ Response import import Response L25–25
+ update_domain function async_function update_domain L355–385
~ Query
~ musehub/services/musehub_domains.py .py 2 symbols added
+ set_domain_deprecated function async_function set_domain_deprecated L381–406
+ update_domain function async_function update_domain L341–378
~ pyproject.toml .toml 2 symbols modified
~ tests/test_domains.py .py 24 symbols added
+ TestE2EDeleteDomain class class TestE2EDeleteDomain L1571–1651
+ test_delete_204 method async_method test_delete_204 L1572–1582
+ test_delete_404_unknown_domain method async_method test_delete_404_unknown_domain L1626–1634
+ test_delete_idempotent_already_deprecated_404 method async_method test_delete_idempotent_already_deprecated_404 L1636–1651
+ test_delete_requires_auth method async_method test_delete_requires_auth L1603–1612
+ test_delete_requires_ownership method async_method test_delete_requires_ownership L1614–1624
+ test_deleted_domain_gone_from_list_but_fetchable_directly method async_method test_deleted_domain_gone_from_list_but_fetchable_directly L1584–1601
+ TestE2EUpdateDomain class class TestE2EUpdateDomain L1472–1568
+ test_update_200 method async_method test_update_200 L1473–1492
+ test_update_404_unknown_domain method async_method test_update_404_unknown_domain L1524–1536
+ test_update_capabilities_over_dimension_cap_422 method async_method test_update_capabilities_over_dimension_cap_422 L1554–1568
+ test_update_invalid_viewer_type_422 method async_method test_update_invalid_viewer_type_422 L1538–1552
+ test_update_requires_auth method async_method test_update_requires_auth L1494–1506
+ test_update_requires_ownership method async_method test_update_requires_ownership L1508–1522
+ TestIntegrationSetDomainDeprecated class class TestIntegrationSetDomainDeprecated L1409–1469
+ test_deprecate_sets_flag method async_method test_deprecate_sets_flag L1410–1423
+ test_deprecated_domain_excluded_from_list method async_method test_deprecated_domain_excluded_from_list L1440–1453
+ test_deprecated_domain_still_fetchable_by_scoped_id method async_method test_deprecated_domain_still_fetchable_by_scoped_id L1455–1469
+ test_undeprecate_clears_flag method async_method test_undeprecate_clears_flag L1425–1438
+ TestIntegrationUpdateDomain class class TestIntegrationUpdateDomain L1340–1406
+ test_update_capabilities_recomputes_manifest_hash method async_method test_update_capabilities_recomputes_manifest_hash L1364–1380
+ test_update_display_name_and_description method async_method test_update_display_name_and_description L1341–1362
+ test_update_nonexistent_domain_returns_none method async_method test_update_nonexistent_domain_returns_none L1399–1406
+ test_update_partial_leaves_other_fields_unchanged method async_method test_update_partial_leaves_other_fields_unchanged L1382–1397
Files Changed
~5
1003 in snapshot
← Older Oldest on task/117-phase5-domain-crud
All commits
Newer → Latest on task/117-phase5-domain-crud

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:6a1eb85823e45a8dae769b123f2f0034624daa0024d63ae697dfaaa08918830d --body "your comment"