Skip to content

fix(api): accept the pre-v0.9.66 v2 names as deprecated aliases - #10472

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/v2-api-deprecated-aliases
Nov 28, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/v2-api-deprecated-aliases

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

#10418 renamed several public v2 names with no alias. The v2 schemas are strict (unknown keys and enum values are refused), so clients written against the earlier names, including older sim CLI builds and MCP clients holding a cached tool schema, now get 400. This restores every name that existed before the release as a deprecated alias, at the contract layer only, so routes and use cases keep seeing just the new names.

One helper (lib/api/contracts/v2/deprecated-names.ts):

  • foldDeprecatedName(schema, old, current): accepts old, folds it into current, and drops it from the parsed value. Sending both is fine when they agree and refused (400) when they differ.
  • deprecatedRequestName / the dryRun response field: tag the old name deprecated: true with a description pointing to the new one.
  • presentDry(dry): emits dry and dryRun together in responses.

The OpenAPI generator now sets deprecated: true on query parameters marked that way. The CLI generator skips deprecated fields, so the CLI keeps sending only the current names.

?dryRun is also read by the source-apply rate bucket, which runs before the query is parsed. Without that, a ?dryRun=true apply would be charged to the write bucket even though it writes nothing.

Every renamed or removed v2 name since the previous production release

Diffed apps/sim/lib/api/contracts/v2, apps/sim/app/api/v2, and the generated CLI contract (packages/sim-cli/src/generated/v2-api.ts) between the previous prod release and this one.

Aliased (all of these existed before):

Endpoint Old New Where
POST /workflows/{id}/execute run.source: "manual" (enum value) "draft" request body
POST /workflows/{id}/execute run.entry.useMockPayload run.entry.sample request body
PUT /workflows/{id}/state ?dryRun / data.dryRun ?dry / data.dry query + response
POST /workflows/{id}/operations ?dryRun / data.dryRun ?dry / data.dry query + response
POST /workflows/{id}/source (+ /source/plan response) ?dryRun / data.dryRun ?dry / data.dry query + response
POST /workspaces/{id}/workflows/source ?dryRun / data.dryRun ?dry / data.dry query + response
POST /workspaces/{id}/source (+ /source/plan response) ?dryRun / data.dryRun ?dry / data.dry query + response

Not aliased:

  • Run fields added in this release (run.dry, allow, mocks, mocksFrom, sideEffects, overrides): new, never shipped under another name.
  • Source catalog legacyIds / legacyCanonicalIds: optional response fields that were removed. A reader that handles their absence still works, and there is nothing to map them to.
  • Workspace source base: files.*.rev no longer accepts a number, version is now required, and the E_SDK_MAJOR_OLD diagnostic is gone. These came from the deliberate workflows-as-code clean slate (improvement(workflow-code): clean slate for workflows and workspace as code #10344) and change value types, not names.
  • Error message text and additive response fields (failure, effect, paused.runId, deployedVersion, rerunFromBlockId, …).

Test plan

  • New lib/workflows/api/deprecated-names.integration.ts runs against real Postgres and Redis, over HTTP and through the Sim MCP server's call_write_operation. All 7 tests are red on origin/staging and green with the fix:
    • PUT /state?dryRun=true and POST /operations?dryRun=true answer dry: true, dryRun: true and write no block row.
    • ?dry=false&dryRun=true is refused with no write.
    • A committed write answers dryRun: false beside dry.
    • replaceWorkflowState with query: { dryRun: true } over MCP writes nothing.
    • Execute with run: { source: "manual", entry: { type: "trigger", useMockPayload: true } } runs the draft with the trigger's sample payload, over HTTP and over MCP.
  • Route tests, red on staging:
    • source: "manual" keeps the draft-run limits (no async, no input beside the sample) and is still refused on the anonymous public path.
    • Conflicting useMockPayload/sample is refused before dispatch.
    • ?dryRun=true on the workspace source apply is charged only to the plan bucket.
    • The workspace workflows-source create passes dryRun through and answers under both names.
  • bun run generate, lint, type-check, check:audits (incl. check:api-validation:strict), test:scripts, sim-cli tests, and the app/api/v2/workflows, app/api/v2/workspaces, lib/api, lib/workflows/api, lib/workspace-source suites all pass.

#10418 renamed public v2 names with no alias, and the v2 schemas reject
unknown keys and values, so clients written against the earlier names now
get 400s. Restore them as deprecated aliases at the contract layer:

- execute: run.source "manual" (now "draft") and run.entry.useMockPayload
  (now sample) are accepted and folded into the current names
- PUT state, POST operations, and the workflow/workspace source applies:
  ?dryRun (now ?dry) is accepted, and dryRun is sent beside dry in the
  response; the source-apply rate bucket honours it too, so a ?dryRun
  request is charged as a dry run

A request that sends both names with different values is refused. The
OpenAPI spec marks the old names deprecated, and the CLI generates no flag
for them.
@vercel

vercel Bot commented Nov 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Building Building Preview Nov 28, 2026 11:21am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 21 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Restores earlier v2 names as deprecated aliases without changing the names routes and use cases receive.

  • Older draft-run names still start the saved workflow.
  • Older dryRun requests keep dry-run behavior across v2 routes.

No actionable issues found. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[HTTP or MCP request] --> B[Parse contract]
  B --> C{Names agree?}
  C -->|No| D[400 response]
  C -->|Yes| E[Keep current names only]
  E --> F[Existing route and use case]
  F --> G[Response with dry and dryRun]
Loading

Reviews (2) · Last reviewed commit: "fix(api): accept the pre-v0.9.66 v2 name..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 689f8a8 into staging Nov 28, 2026
74 of 75 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/v2-api-deprecated-aliases branch November 28, 2026 11:24

This branch was successfully deployed

1 active deployment
Preview — 40146f7a Deployed Nov 28, 2026 by vercel[bot]
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