Repository navigation
fix(automations): refuse steps the server no longer accepts - #292
Merged
Merged
Conversation
- `automations create|update` refuse a step naming `evaluateExpressions` or `createRevokeTasks` in `automationSteps`/`draftAutomationSteps` (either body spelling, `--steps-file` or `--body-file`), exit 2 before any request is sent (`--dry-run` included), naming the step index and, for `createRevokeTasks`, its replacement `createRevokeTasksV2`. - Live-confirmed server text: "the evaluate expressions step is no longer supported"; "CreateRevokeTasks step is deprecated and no longer allowed. It is replaced by CreateRevokeTasksV2".
A JSON null is the API's "unset", not a use of the arm (protojson skips a
null oneof member), so `{"evaluateExpressions":null}` was refused with a
message claiming the server rejects it. Skip nil values, keep refusing a
present arm, and pin that the null arm reaches the server verbatim. The help
text and both docs now say a null value is not a use.
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
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.
What
automations createandautomations updaterefuse, with exit2and before any request (--dry-runincluded), a step using an arm the server no longer accepts. This applies inautomationStepsanddraftAutomationSteps, in either key spelling, via--steps-fileor--body-file.evaluateExpressionsthe evaluate expressions step is no longer supportedcreateRevokeTasksCreateRevokeTasks step is deprecated and no longer allowed. It is replaced by CreateRevokeTasksV2Why
The public OpenAPI spec still advertises
evaluateExpressions, so agents build automations on it, and only find out at create time. With this check, a--dry-runpreview refuses what a real send would.Verified
Unit tests for both spellings and both arrays.
--debugshows no request is sent. The two 400s above were re-captured live, and the client's refusal matches them word for word. golangci-lint is clean.Follow-ups in this branch
nullarm is not a use of that arm: the server's JSON parser treatsnullas unset, so{"evaluateExpressions": null}is now sent instead of being refused with a message the server never produced. Verified live: a step with a validwaitForDurationplus"evaluateExpressions": nullis accepted and stores onlywaitForDuration, while the arms themselves still 400 exactly as quoted above.nullvalue is unset, not a use, and a test pins that the null arm reaches the server verbatim.