fix(docs): keep a retagged operation's URL working instead of 404ing - #417
Conversation
The API reference went live on 09-17 against the tags the spec carried then. Two days later two refactors retagged it: `Extensions: RoboLedger` became eight `RoboLedger: *` tags on the extensions surface, and `Auth` shed its passkey, MFA and SSO operations into three tags of their own. Every page under the old tags moved, and the old URLs — which sat in the sitemap Google downloaded daily for those three days — answer 404. The redirects added with the extensions split cover `roboledger-*`, `roboinvestor` and `graphql`, which are the slugs the spec carries *now*. Those URLs only existed under /docs/api for the nineteen hours between the API's retag and this app's split. The slugs that were published for three days are `extensions-roboledger`, `extensions-roboinvestor` and `extensions-graphql`, and none of them redirect. Rather than write a rule per operation, resolve by slug: an operation slug comes from the operationId and does not move when the tag does, so when the tag in the URL no longer holds the operation, look for it in the whole catalog and 308 to wherever it lives now. That covers all 57 RoboLedger operations, the RoboInvestor ones, the fourteen carved out of Auth, and the next retag, without anyone remembering to add a rule. Two operations sharing a slug stays a 404 — the destination would be a guess. Bare tag pages still need rules, since a tag that became eight has no single successor; those three go to the extensions hub, RoboInvestor and GraphQL respectively. Nothing links to the dead URLs and Search Console reports them unknown to Google, so no signal has been lost yet — this closes the window before one is.
|
Change classification: normal — platform or application code changed. A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The |
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 2m 24s —— View job Review of PR #417
Overall: looks solid, ready to merge. Resolving by operation slug instead of a rule per moved operation is the right call — it's derived from
Two minor, non-blocking observations:
Testing: I wasn't able to execute |
Why
The API reference went live on 09-17 against the tags the spec carried then. Two days later two refactors retagged it —
Extensions: RoboLedgerbecame eightRoboLedger: *tags on the extensions surface, andAuthshed its passkey, MFA and SSO operations into three tags of their own. Every page under the old tags moved, and the old URLs answer 404.Those URLs sat in the sitemap Google downloaded daily for the three days they were live.
The redirects added with the extensions split cover
roboledger-*,roboinvestorandgraphql— the slugs the spec carries now. Under/docs/apithose only existed for the nineteen hours between the API's retag and this app's split. The slugs published for three days wereextensions-roboledger,extensions-roboinvestorandextensions-graphql, and none of them redirected.What changed
Resolve by slug rather than write a rule per operation. An operation slug comes from the operationId and does not move when the tag does, so when the tag in the URL no longer holds the operation,
findMovedApiOperationlooks for it in the whole catalog — both surfaces — andOperationReference308s to wherever it lives now. That covers all 57 RoboLedger operations, the RoboInvestor ones, the fourteen carved out of Auth, and the next retag, with nothing to remember. Two operations sharing a slug stays a 404, because the destination would be a guess.Bare tag pages still need rules, since a tag that became eight has no single successor:
extensions-roboledgerandroboledgergo to the extensions hub,extensions-roboinvestorandextensions-graphqlto their pages.Verified
Against a server running on the production spec, not a test client:
/docs/api/extensions-roboledger/docs/extensions/docs/api/extensions-roboledger/close-period/docs/extensions/roboledger-fiscal-close/close-period/docs/api/extensions-roboledger/create-event-block/docs/extensions/roboledger-ledger-events/create-event-block/docs/api/extensions-roboinvestor/create-security/docs/extensions/roboinvestor/create-security/docs/api/extensions-graphql/graphql-endpoint/docs/extensions/graphql/docs/api/auth/get-passkey-registration-options/docs/api/auth-passkeys/get-passkey-registration-options/docs/api/auth/verify-mfa/docs/api/auth-mfa/verify-mfa/docs/api/auth/no-such-operation/docs/api/auth/login-userEvery destination returns 200 — no loops. Four new unit tests on the resolver, including the ambiguity case.
npm run test:allgreen: 584 tests, format, lint, typecheck, cf-lint.Scope
No signal has been lost yet — nothing links to the dead URLs and Search Console reports them unknown to Google. This closes the window before one is.
🤖 Generated with Claude Code