Skip to content

Remove v1 path aliases when scenario/supply-chain bump to v2 #3282

Description

@SebastienMelki

Background

PR #3242 (sebuf migration) renamed five documented v1 URLs because the sebuf RPC path generator derives paths from method names:

Legacy v1 URL New sebuf path
POST /api/scenario/v1/run /api/scenario/v1/run-scenario
GET /api/scenario/v1/status /api/scenario/v1/get-scenario-status
GET /api/scenario/v1/templates /api/scenario/v1/list-scenario-templates
GET /api/supply-chain/v1/country-products /api/supply-chain/v1/get-country-products
GET /api/supply-chain/v1/multi-sector-cost-shock /api/supply-chain/v1/get-multi-sector-cost-shock

To preserve the wire contract, #3242 added thin URL-rewrite alias files:

  • api/scenario/v1/{run,status,templates}.ts
  • api/supply-chain/v1/{country-products,multi-sector-cost-shock}.ts

Each file rewrites the pathname to the new sebuf path and delegates to the domain [rpc].ts gateway via server/alias-rewrite.ts. A matching alias table lives in vite.config.ts (V1_ALIASES) for dev parity.

What to do here

When either service bumps to v2 (i.e. the next breaking contract change):

  1. Delete the 5 alias files.
  2. Delete server/alias-rewrite.ts if nothing else consumes it.
  3. Delete the V1_ALIASES block in vite.config.ts.
  4. Update docs to the new-only paths.

Until then the aliases are harmless: they're pure URL rewrites, keyed on exact pathname, and premium/rate-limit/entitlement checks all fire on the canonical new path.

Why not now

The old URLs are in docs/api-scenarios.mdx, docs/panels/supply-chain.mdx, OpenAPI specs under docs/api/, and possibly partner scripts. Removing them is a v1→v2 break, not a silent follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions