allow to select rmq plan when creating instance#44
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for selecting a RabbitMQ broker version during instance creation, including shell completion for available versions.
Changes:
- Introduces a new
--rmq-versionflag oninstance createand wires it into the create request payload. - Adds shell completion that fetches and caches available RabbitMQ versions from a metadata endpoint.
- Extends the client with an external-request helper and a
ListVersions()API.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/instance_create.go | Adds --rmq-version flag and passes it through to instance creation requests. |
| cmd/completion_helpers.go | Implements completeVersions to complete RabbitMQ versions based on selected plan. |
| cmd/completion_cache.go | Adds a cache TTL for version completion results. |
| client/regions.go | Adds ListVersions() calling a metadata endpoint to retrieve available RMQ versions. |
| client/instances.go | Adds an rmq_version field to create requests and includes it in form-encoded create calls. |
| client/client.go | Adds makeExternalRequest to support non-customer API metadata calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if req.Version != "" { | ||
| formData.Set("rmq_version", req.Version) | ||
| } |
There was a problem hiding this comment.
New behavior: when req.Version is set, CreateInstance adds rmq_version to the request body. The existing VCR tests for CreateInstance don’t exercise this path, so regressions could slip in (e.g., wrong form field name or missing JSON encoding when CopySettings is used). Add/update a test that creates an instance request with rmq_version set and asserts the outgoing request includes it (or record a new VCR cassette that covers this parameter).
closes #36
Ensuring that we can select RMQ version on create. Couple pointers I learned while testing:
makeExternalRequest.