Skip to content

feat(api): offer only creatable admin templates - #1944

Merged
Quick104 merged 5 commits into
feat/collections-revampfrom
feat/api-admin-creatable-templates
Oct 4, 2026
Merged

Quick104 merged 5 commits into
feat/collections-revampfrom
feat/api-admin-creatable-templates

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: changes #194 A1 (Not run; the admin template gallery no longer lists Discover/Franchise summaries, and Starter packs stays the way to apply them); reaches #193 S5 (Pass; acting-admin authorization unchanged and now has its own test)

Admin > Collections > Browse Templates lists every built-in template, TMDB Discover and TMDB Franchise templates included. No route creates a single collection from those two sources, so their cards can't create anything: each shows a summary and a pointer to Starter packs. Now that Starter packs list them (#1941), the gallery cards are redundant.

GET /api/v2/admin/collections/templates now returns only templates with an mdblist, tmdb or tmdb_list source, the same set the personal template list already offers. Discover and Franchise templates stay available to admins through Starter packs.

Stacked on #1941 (feat(collections): Starter packs replace template bundles). It must merge after #1941: before that PR, the gallery's bundle view looked up Discover and Franchise templates in this list.

Approach

  • The personal template list's filter is renamed creatableCollectionTemplates and now also wraps the admin list. It keeps templates by source, drops categories left empty, and keeps the rest in order.
  • No schema change. The operation summary now names the three sources, so the OpenAPI document, the system-info contract digest and the web types are regenerated.
  • /api/v1/admin/collections/templates has its own handler and doesn't change. A new test checks that its output is byte-identical to the full built-in catalog.
  • docs/catalog-api.md describes the admin list. docs/architecture/collection-templates.md notes that both v2 template lists leave out Discover and Franchise templates.
  • The branch also carries the feat/collections-revamp commit that drops the Personal collections: owner-only management and a single share-with-all-profiles switch #1615 breaking-change approvals. This stack branched before that commit landed, and this is the stack's first PR to change openapi.json, so without it the contract diff against the base fails on approvals that match no change. The file now matches feat/collections-revamp.

Apple and Android clients don't call this route, jellycompat has no equivalent, and the user manual needs no change.

Validation

  • Go: build, gofmt, vet and make lint-changed against feat/collection-starter-packs are clean. make test-go passes.
  • The new tests fail on the tests-only commit and pass at the head. They cover the built-in admin list (no Discover or Franchise template, no empty category, every creatable template exactly once), dropping emptied categories in order, every Discover and Franchise built-in carrying that source, and a 403 with no catalog read for a regular account and for a non-primary profile on an admin account. The personal list test is unchanged.
  • The apiv2, api/handlers and collections packages ran against a freshly migrated database. Two DB-backed tests this branch doesn't touch fail there: TestAdminSubtitleListPageDB and TestCatalogTransferPersistsJobsAndSignedLink. They fail the same way on the base branch.
  • Contract: verify-apiv2-openapi, verify-apiv2-contract, verify-apiv2-fixtures, verify-apiv2-web-types, verify-route-inventory, verify-migration-ledger and TestCommittedArtifactMatchesRouter pass. The contract diff reports no change against feat/collection-starter-packs and nothing breaking without approval against feat/collections-revamp.
  • Web: lint, format:check, build, budget:check, tsc -b and make test-web pass.
  • make verify-local-paths passes.

Risks

  • Admins no longer see the Discover and Franchise cards under Browse Templates. Those cards couldn't create a collection; Starter packs still list and add these lists.
  • The schema is unchanged, but the admin list on /api/v2 (not yet locked) now returns fewer templates. A client that read Discover or Franchise templates from it should read the bundle summaries from listAdminCollectionTemplateBundles instead. No known client does.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent read the full diff, confirmed that the new tests fail on the tests-only commit and pass at the head, and checked every caller of the v2 admin list: only the admin template gallery reads it, Starter packs read the bundle summaries, and neither silo-apple nor silo-android references the route. It found one nit. The summary, doc comment and docs said the list holds what "an admin import route can create", but admins also have a Trakt import route, so the wording overstated it. The wording now names the three sources. The filter is unchanged, because adding Trakt would also change the personal list. No findings remain open.

🤖 Generated with Claude Code

Note

Filter v2 admin template list to only creatable templates

Applies the shared creatable-template filter to GET /api/v2/admin/collections/templates in admin_collection_extras.go. The filter keeps only mdblist, tmdb, and tmdb_list sources and drops categories left empty, so TMDB Discover and TMDB collection templates (bundle-only) no longer appear.

  • Renames the importable-template helper to creatableCollectionTemplates and reuses it in personal_collections_lifecycle.go; personal template behavior is unchanged.
  • Adds tests for filtering, emptied categories, builtin source labels, and administrator authorization, plus a v1 regression test that the full catalog stays byte-for-byte intact.
  • Updates docs and regenerated OpenAPI fixtures/schema for the v2 endpoint.
  • Behavioral Change: GET /api/v2/admin/collections/templates no longer returns tmdb_discover or tmdb_collection templates; v1 remains unchanged.

Macroscope summarized 93a4765.

Quick104 and others added 4 commits October 4, 2026 17:02
The admin v2 template list still offers TMDB Discover and franchise
templates, which no admin import route accepts. These tests describe the
list that only holds creatable templates, keep the v1 list byte-identical,
and restate #193 S5 for the route.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The admin v2 template list offered TMDB Discover and franchise templates
that no admin import route accepts, so a gallery card for one could never
be created. The list now uses the same filter as the personal list and
drops categories left empty. Starter packs read those templates from the
bundle summaries instead. The v1 list is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The summary, comment and docs said the list holds what an admin import
route can create, but admins can also import from Trakt, which the
filter leaves out. Name the three sources it actually keeps.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rged

An approval lives only on the pull request that needs it. The #1615
removals merged into feat/collections-revamp with #1875, so these entries
now match no change and fail the contract gate. The record stays in the
file's history; the final merge into main carries them again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00d5b2da-567e-4c9f-b7d5-e4125989fdf8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T23:32:08.202914Z 93a4765 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

The GET /api/v2/admin/collections/templates response feeds the admin CollectionTemplateGallery opened from the create flow. Its Discover/Franchise cards are read-only summaries, so removing them does not change A1’s ability to create collections; Starter packs remains their application path. Still, #194 A1 is the case that sees this gallery change (currently Not run), so the Validation tasks: line should include it. #193 S5 remains unchanged: the acting-admin gate rejects non-admin requests before catalog filtering, and the tested mutation routes are untouched.

Suggested line: Validation tasks: changes #194 A1 (Not run); reaches #193 S5 (Pass; acting-admin authorization unchanged)

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Base automatically changed from feat/collection-starter-packs to feat/collections-revamp October 4, 2026 22:56
…at/api-admin-creatable-templates

# Conflicts:
#	contracts/api/v2/fixtures/get_system_info_ok.json
@Quick104

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Updated the Validation tasks: line to include #194 A1 (changes, Not run) alongside #193 S5.

@Quick104
Quick104 merged commit 6e031cf into feat/collections-revamp Oct 4, 2026
15 checks passed
@Quick104
Quick104 deleted the feat/api-admin-creatable-templates branch October 4, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant