Repository navigation
feat(api)!: retire /api/v1 behind a 410 tombstone - #3200
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Pre-merge checks:
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
The retired native Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
|
Please open and link the siloserver.org follow-up mentioned in the description. CONTRIBUTING.md requires the manual issue when the PR is ready for review; it should cover the tombstone's upgrade-guide destination and the integration URLs admins must regenerate. |
| for _, apiPrefix := range []string{oauthV1Prefix, oauthV2Prefix} { | ||
| http.SetCookie(w, oauthCompletionCookie(completionBinder, h.PublicURL(apiPrefix+oauthCompletePath, nil))) | ||
| } | ||
| http.SetCookie(w, oauthCompletionCookie(completionBinder, h.PublicURL(oauthV2Prefix+oauthCompletePath, nil))) |
Silo retire /api/v1 (PR Silo-Server/silo-server#3200 : 410 Gone). La liste des bibliothèques (création, relance d'une bibliothèque injoignable) et la chaîne des fournisseurs (NFO désactivé) passent par /api/v2/libraries : liste paginée (items, page), identifiant en chaîne, niveaux en liste (content_level, entries). Vérifié sur silo2 (Silo d'avant la PR). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AbUx511UGbcCoLk6U5BQjP
1445904 to
e7cfed3
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Every /api/v1 route on the main API listener now answers 410 Gone with client_upgrade_required, Cache-Control: no-store and a link to the upgrade guide. It runs no authentication and never redirects. GET /api/v1/health and GET /api/v1/ready, and the node health probes, are unchanged. Retired URLs that carry a credential in the path are registered on the tombstone so the request and activity logs keep redacting it. The planned two pre-1.0 bridge releases are waived (#886). The v1 handlers, the v1 branches in shared middleware, playback and OAuth code, and the migration harness (ledger, scenario catalogs, offline routes, v1 route freeze) are removed. Setup the v1 router block did for handlers v2 shares is moved next to their construction. Tests that exercised shared behavior through v1 handlers now run against the v2 entry points. Code that only v1 reached goes with it: the request and response types and request-reading helpers the handlers left behind, the v1 rule vocabulary and catalog grammar switches, the v1 watch-together member projection and host band, the subtitle search bridge, and the request-wrapping admin middleware. BREAKING CHANGE: clients and integrations that still call /api/v1 receive 410 and must move to /api/v2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Fable 5.2 <[email protected]>
e7cfed3 to
0d98333
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Main retired /api/v1 (Silo-Server#3200), which removed the v1 admin account delete this branch had changed; the v2 delete keeps the artwork cleanup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main retired /api/v1 (Silo-Server#3200), deleting the v1 events socket, the v1 watch-together socket and the v1 household gate test this branch edited. Those hunks drop with the code they changed; the v2 gates keep the change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main retired the /api/v1 bridge (Silo-Server#3200), so the v1 route test for collection_type is gone with the handlers it called. Main also removed TestCollectionProblemRendersInvalidArtworkAsValidationProblem (Silo-Server#2817); the conflict keeps that removal and this branch's v2 test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main retired /api/v1 (#3200), which removed the v1 event socket handler. Admission now covers the native v2 events socket and the Jellyfin socket only. The v1-only admission tests are dropped, and the lifecycle tests that drove the v1 handler now drive the v2 ticket handshake. The docs no longer describe a v1 bridge exception. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the conflicts with main's changes since d941225: - Query normalization moved to catalog.NormalizeQueryDefinitionJSON; structural admission moves with it, so backup restores also pass it. - /api/v1 is retired (#3200): drop the v1-only item loaders and doc text and the V1Rules test field. - The web collections pages are translated (#3902): "Count unavailable" and the manual editor's add-blocked messages become catalog keys (synced locally until the silo-translations change merges). - Server smart rules name their own libraries (#3711): a server save sends query_definition only when the rules change. - Save returns to the list (#3709) and smart collections need a rule (#3710): adjust the PR's tests to observe what they still can. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… contracts (#5104) /api/v1 now answers a 410 tombstone (#3200), but many references still described the frozen bridge as live. Remove the present-tense v1 text, correct the v2 status codes and contracts that drifted from the handlers (downloads, playback v3, admin settings, diagnostics, realtime API keys, device headers, parity), document the series date_viewed rule, and state shipped behaviour where notes still called it pending. Consolidate references documented twice: merge the duplicated admin-api sections, move admin settings and catalog search status to their own references, keep push and marker contracts in one place each, and fold admin-system-api, scan-control-api, jellycompat-subtitles-api and notification-webhook-revisions into the documents they repeat. Index every API reference from docs/README.md, settle the Apple and Android follow-up list in update-to-1.0 against the clients, and drop migration-era bookkeeping and branch notes. Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Related issue: #886
Validation tasks: changes #1190 C1
Silo has served two native business APIs since
/api/v2shipped: the frozen alpha/api/v1and/api/v2. The web client and the current Apple and Android apps use only v2. Keeping v1 means every behavior change has to be checked against two transports, and v1-only code paths keep drifting from the v2 rules. The plan in #886 was to carry v1 through two published pre-1.0 bridge releases. The maintainer waived those releases on 2026-10-27, since v2 has shipped long enough.This change retires
/api/v1now. Every/api/v1route on the main API listener answers410 Gonewithclient_upgrade_required. The v1 handlers and the migration tooling that compared v1 with v2 are removed.Approach
Tombstone.
/api/v1,/api/v1/, and every descendant answer410withCache-Control: no-store.{"error":"client_upgrade_required","message":…,"docs_url":"https://siloserver.org/docs/update-to-1.0"}.GET /api/v1/healthandGET /api/v1/ready.GET /api/v1/health.Removed with v1:
mainadded after this branch was opened: the frozen-v1 shaping of playback decisions, the bridge's device and lifecycle source at playback start, the events socket's bridge filter, and the v1 body buffering for household writes.unusedlinter and a reachability check againstmain:V1Rules,ValidateV1Rules) and the catalog parser's opt-in grammar. The parser now has one grammar, the one v2 used.RequireAdmin,RequireActingAdmin, andNewPolicyActingAdminMiddleware. The router usesRequireActingAdminWithover the same deciders.contracts/api/v2/migration.jsonand its schema,internal/contractledger, the scenario catalogs and executor,offline-routes.txt,scripts/apiv2-ledger, and their Makefile and CI targets. They existed to prove v1→v2 parity. Every route had a ratified disposition, and the parity they checked is now tested once against the v2 entry points.Setup v2 depends on. The v1 router block also configured handler instances that v2 shares:
That setup now runs where each handler is built. Methods v2 reaches only through runtime interface assertions are kept, and
internal/apiv2tests now assert those interfaces at compile time. Examples are the personal collection lifecycle, admin collection extras, and the profile-scoped history imports.Tests. Handler tests that exercised shared behavior through a v1 route now call the method v2 uses. Tests of v1-only wire behavior were deleted.
Docs.
CLAUDE.md/AGENTS.mdanddocs/architecture/api-contract.mdrecord the retirement.docs/architecture/v1-scope.mdstays the historical record.docs/update-to-1.0.mdsays integrations move when admins update to this release, not at 1.0. The surface docs underdocs/no longer describe v1 behavior.Clients and compatibility.
silo-appleandsilo-androidmaincall v1 only for the retained health probe. Older app builds that still call v1 stop working against this server.docs_url. An issue for siloserver.org is drafted, not yet filed.Validation
Rebased onto
mainata9c75803, after #3199 merged. Run on that head:go build ./...,go vet ./...,gofmt: clean.make lint-changed: 0 issues.verify-route-inventory,verify-apiv2-openapi,verify-apiv2-contract,verify-apiv2-fixtures,verify-local-paths,verify-migrations,verify-size-ratchet,verify-settings-bindings,verify-playback-fixtures: pass. Every test the CI workflows andscripts/cilists name still exists, and the subprocess-test package list matches.go test ./...: every package passes except two real-ffmpeg tests (TestCopyRemuxSubtitleRenditionRealFFmpeg,TestRunStatsWithRealFFmpeg), which fail the same way onmainon that host.TestSignupCommitPolicyErrorsDB,TestEmailPrefsStayOnTheAccountDB).web/changed.HEADwithout a body, no auth, both probes.main(404) and pass here.mainand then from the head before this rebase (e7cfed31); not repeated after it:/api/v1route answered410client_upgrade_requiredwithCache-Control: no-store, with or without credentials, andHEADhad no body./api/v1/healthand/api/v1/readystill answered 200.[redacted]./api/v2requests and none failed. Playback started through/api/v2/playback/start.403from the v1 create routes as part of its pass. Those routes now answer410and still create no key; the v2 half of the case is unchanged.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3200/
Risks
Breaking for anything still calling
/api/v1:None of these redirect. Admins regenerate the URLs from the server, as
docs/update-to-1.0.mddescribes.Silent loss of setup from the deleted v1 block. The known cases are covered above. A missed one would show up as a v2 operation reporting "unavailable" or skipping a check, not as a build error.
Not changed here: the squashed 1.0 migration baseline and its guard remain open on API v2 Phase 6: Silo 1.0 cutover and v2 lock #886.
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Remove
/api/v1routes and return a 410 Gone tombstone/api/v1route group and dozens of v1-only HTTP handlers across settings, collections, catalog, notifications, admin, subtitle, playback, and watch-together areas ininternal/api/handlers.v1Tombstonehandler in v1_tombstone.go that returns 410 Gone with a JSON upgrade notice and documentation URL; no redirect or authentication logic.ValidateV1Rules,V1Rulesflags), and the v1 legacy watch-together protocol, and removes related Make targets and CI contract paths./api/v1clients now receive 410 Gone; checknewChiRouterin router.go and the removedRequireAdmin/DemoGuardmiddleware in auth.go and demo_guard.go for in-tree consumers. Smart-collection rule validation now runs unconditionally instead of only for non-v1 requests, which can reject definitions the old v1 path accepted.Macroscope summarized 0d98333.