Repository navigation
fix(api): accept the pre-v0.9.66 v2 names as deprecated aliases - #10472
Merged
Merged
Conversation
#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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryRestores earlier v2 names as deprecated aliases without changing the names routes and use cases receive.
No actionable issues found. Tests were not run during this review.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
simCLI builds and MCP clients holding a cached tool schema, now get400. 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): acceptsold, folds it intocurrent, and drops it from the parsed value. Sending both is fine when they agree and refused (400) when they differ.deprecatedRequestName/ thedryRunresponse field: tag the old namedeprecated: truewith a description pointing to the new one.presentDry(dry): emitsdryanddryRuntogether in responses.The OpenAPI generator now sets
deprecated: trueon query parameters marked that way. The CLI generator skips deprecated fields, so the CLI keeps sending only the current names.?dryRunis also read by the source-apply rate bucket, which runs before the query is parsed. Without that, a?dryRun=trueapply 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):
POST /workflows/{id}/executerun.source: "manual"(enum value)"draft"POST /workflows/{id}/executerun.entry.useMockPayloadrun.entry.samplePUT /workflows/{id}/state?dryRun/data.dryRun?dry/data.dryPOST /workflows/{id}/operations?dryRun/data.dryRun?dry/data.dryPOST /workflows/{id}/source(+/source/planresponse)?dryRun/data.dryRun?dry/data.dryPOST /workspaces/{id}/workflows/source?dryRun/data.dryRun?dry/data.dryPOST /workspaces/{id}/source(+/source/planresponse)?dryRun/data.dryRun?dry/data.dryNot aliased:
run.dry,allow,mocks,mocksFrom,sideEffects,overrides): new, never shipped under another name.legacyIds/legacyCanonicalIds: optional response fields that were removed. A reader that handles their absence still works, and there is nothing to map them to.files.*.revno longer accepts a number,versionis now required, and theE_SDK_MAJOR_OLDdiagnostic 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.failure,effect,paused.runId,deployedVersion,rerunFromBlockId, …).Test plan
lib/workflows/api/deprecated-names.integration.tsruns against real Postgres and Redis, over HTTP and through the Sim MCP server'scall_write_operation. All 7 tests are red onorigin/stagingand green with the fix:PUT /state?dryRun=trueandPOST /operations?dryRun=trueanswerdry: true, dryRun: trueand write no block row.?dry=false&dryRun=trueis refused with no write.dryRun: falsebesidedry.replaceWorkflowStatewithquery: { dryRun: true }over MCP writes nothing.run: { source: "manual", entry: { type: "trigger", useMockPayload: true } }runs the draft with the trigger's sample payload, over HTTP and over MCP.source: "manual"keeps the draft-run limits (no async, noinputbeside the sample) and is still refused on the anonymous public path.useMockPayload/sampleis refused before dispatch.?dryRun=trueon the workspace source apply is charged only to the plan bucket.dryRunthrough and answers under both names.bun run generate,lint,type-check,check:audits(incl.check:api-validation:strict),test:scripts, sim-cli tests, and theapp/api/v2/workflows,app/api/v2/workspaces,lib/api,lib/workflows/api,lib/workspace-sourcesuites all pass.