Skip to content

Conversation

@briceamen
Copy link
Contributor

Summary

  • add database NG plan upgrade command
  • implement plan change wait logic and upgrade flow
  • update command registration and changelog

Testing

  • manual: created dbng and upgraded plan on staging

@notion-workspace
Copy link

@briceamen briceamen requested a review from Copilot January 13, 2026 08:08
@briceamen briceamen self-assigned this Jan 13, 2026
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 a new command to upgrade database next generation (DBNG) plans, including support for waiting until the upgrade completes.

Changes:

  • Added database-upgrade command with plan change logic and optional wait functionality
  • Integrated the new command into the CLI command registry
  • Updated cross-references to include the new command in related database commands

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
dbng/upgrade.go Implements the core upgrade logic with plan validation, addon upgrade API call, and wait functionality for plan changes
cmd/databases_ng.go Adds the database-upgrade command definition with argument parsing and integrates it into SeeAlso references
cmd/commands.go Registers the new database-upgrade command in the global command list
CHANGELOG.md Documents the new database plan upgrade command feature

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

Copy link
Contributor

@matthieu526-scalingo matthieu526-scalingo left a comment

Choose a reason for hiding this comment

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

Good job! Two small comments.

Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Some questions otherwise LGTM

Comment on lines +158 to +159
io.Error("Invalid number of arguments")
return cli.ShowCommandHelp(ctx, c, "database-upgrade")
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: generally with no argument given we just print the help WDYT?

Otherwise, could you share an example of the output either here in comment or in PR's body?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, it should behave like database-create and just print the help when no args are provided. I’ll align with that.

For the output, here’s a sample from staging:

$ scalingo database-upgrade 69652796697f13aac6687e51 postgresql-ng-enterprise-8192
Your postgresql-ng database 69652796697f13aac6687e51 ('ng-plan-change-xxx') is being upgraded…

With --wait, it shows the spinner then:
Your database plan change is complete.

Copy link
Member

Choose a reason for hiding this comment

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

You didn't address my first comment, just to be sure if it was intended because you mentioned that wou'll align with database-create command.


var dbAddon *scalingo.Addon
if db.Database.ResourceID != "" {
if len(addons) == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I am not sure this optimization is needed. The loop is probably not expensive.

@briceamen briceamen changed the title [STORY-3149] Add DBNG plan upgrade command [STORY-3236] Add DBNG plan upgrade command Jan 14, 2026
@notion-workspace
Copy link

Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Just a question

Comment on lines +158 to +159
io.Error("Invalid number of arguments")
return cli.ShowCommandHelp(ctx, c, "database-upgrade")
Copy link
Member

Choose a reason for hiding this comment

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

You didn't address my first comment, just to be sure if it was intended because you mentioned that wou'll align with database-create command.

@briceamen
Copy link
Contributor Author

@curzolapierre yes I did it in this commit 5b261d9

Copy link
Member

@curzolapierre curzolapierre left a comment

Choose a reason for hiding this comment

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

Sorry I miss it my bad

@briceamen briceamen merged commit 53c4945 into master Jan 14, 2026
7 checks passed
@briceamen briceamen deleted the feat/STORY-3149/ng-plan-change-support branch January 14, 2026 16:51
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.

4 participants