Skip to content

Conversation

@gargakshit
Copy link
Member

Allows us to create PG17 deployments using flyctl. It defaults to 16 for now.

Example

$ fly mpg create --pg-major-version=17

Allows us to create PG17 deployments using `flyctl`

Signed-off-by: Akshit Garg <akshit@fly.io>
Copy link

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

This PR adds support for specifying the Postgres major version when creating a managed Postgres cluster via the fly mpg create command. The implementation allows users to choose between Postgres 16 and 17, with 16 as the default.

  • Added --pg-major-version flag to the mpg create command with validation
  • Extended the CreateClusterInput struct to include the Postgres major version
  • Implemented validation logic to ensure only supported versions (16 and 17) are accepted

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/command/mpg/create.go Added flag definition, validation logic, and parameter passing for Postgres major version selection
internal/uiex/managed_postgres.go Extended CreateClusterInput struct with PGMajorVersion field for API communication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +119 to +122
pgMajorVersion := flag.GetInt(ctx, "pg-major-version")
if pgMajorVersion != 16 && pgMajorVersion != 17 {
return fmt.Errorf("invalid Postgres major version: %d. Supported versions are 16 and 17", pgMajorVersion)
}
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The validation logic for the Postgres major version should have test coverage. Consider adding a test case that verifies the validation rejects invalid versions (e.g., 15, 18) and accepts valid versions (16, 17). The existing test file mpg_test.go has similar validation tests for regions and other parameters.

Copilot uses AI. Check for mistakes.
Signed-off-by: Akshit Garg <akshit@fly.io>
@gargakshit gargakshit marked this pull request as draft December 4, 2025 08:43
Copy link
Contributor

@bglw bglw left a comment

Choose a reason for hiding this comment

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

🧦 x2

@gargakshit gargakshit marked this pull request as ready for review December 4, 2025 08:44
@gargakshit gargakshit merged commit 6bcf876 into master Dec 4, 2025
54 of 61 checks passed
@gargakshit gargakshit deleted the akshit/mpg-create-pg17 branch December 4, 2025 09:18
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.

3 participants