Skip to content

allow to select rmq plan when creating instance#44

Merged
markusgust merged 5 commits intomainfrom
select-rmq-versions-on-create
Apr 17, 2026
Merged

allow to select rmq plan when creating instance#44
markusgust merged 5 commits intomainfrom
select-rmq-versions-on-create

Conversation

@markusgust
Copy link
Copy Markdown
Contributor

closes #36

Ensuring that we can select RMQ version on create. Couple pointers I learned while testing:

  • It is not possible to pass lmq version (except test- and dev- instances) so the field should only apply to RMQ. Completion only works when selecting rmq plans. Will still allow for version to be passed, it will just be ignored by the api.
  • The undocumented API endpoint returns available versions (not deprecated/beta) which I think is ok to use for completion. But it introduces makeExternalRequest.

@markusgust markusgust marked this pull request as ready for review April 16, 2026 21:00
@markusgust markusgust requested a review from Copilot April 16, 2026 21:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-version flag on instance create and 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.

Comment thread cmd/completion_helpers.go Outdated
Comment thread cmd/instance_create.go Outdated
Comment thread client/instances.go Outdated
Comment thread client/instances.go Outdated
Comment on lines +101 to +103
if req.Version != "" {
formData.Set("rmq_version", req.Version)
}
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment thread client/client.go Outdated
@markusgust markusgust requested review from jage and snichme April 17, 2026 07:16
@markusgust markusgust merged commit eeacdf1 into main Apr 17, 2026
1 check passed
@markusgust markusgust deleted the select-rmq-versions-on-create branch April 17, 2026 07:52
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.

Should be able to select broker version

3 participants