Skip to content

fix: require --file for canvases update without positional id#4401

Closed
shiroyasha wants to merge 1 commit into
mainfrom
cursor/agent-15644ea3
Closed

fix: require --file for canvases update without positional id#4401
shiroyasha wants to merge 1 commit into
mainfrom
cursor/agent-15644ea3

Conversation

@shiroyasha

Copy link
Copy Markdown
Collaborator

Summary

Implements superplanehq/superplane#4231: superplane canvases update now only accepts canvas YAML via --file / -f (no [name-or-id] positional). The canvas to update is identified solely by metadata.id in the YAML, matching the issue and lucaspin’s comment that the command should not accept <name-or-id> and should only use the YAML.

Changes

  • pkg/cli/commands/canvases/root.go: Use: "update", Args: cobra.NoArgs, MarkFlagRequired("file").
  • pkg/cli/commands/canvases/update.go: always load from file; removed loadCanvasFromExisting and unused describeCanvasByID.
  • pkg/cli/commands/canvases/change_requests.go: error hint updated to superplane canvases update -f <path-to-yaml> --draft ....
  • pkg/cli/commands/canvases/update_test.go: TestUpdateRequiresFile for missing/empty --file.

Review / comments

  • Human (lucaspin): addressed by removing the positional argument and requiring YAML-only update via --file.
  • Human (shiroyasha): clarification only; no conflicting direction.

Testing

  • Added unit test for --file requirement.
  • Full go test ./pkg/cli/commands/canvases/... was not runnable in this agent environment (generated openapi_client package absent from the checkout); CI should run the full suite.
Open in Web Open in Cursor 

Align superplane canvases update with YAML-only targeting per #4231:
- Cobra use/args and MarkFlagRequired for --file
- Remove active-canvas / name-or-id path; canvas id comes from metadata.id
- Update change-requests hint to match new invocation

Co-authored-by: Igor Šarčević <igisar@gmail.com>
@superplanehq-integration

Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@shiroyasha shiroyasha closed this Apr 26, 2026
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.

2 participants