Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding pg:upgrade:wait command #3273

Merged
merged 6 commits into from
Apr 9, 2025

Conversation

nilamuthu
Copy link

@nilamuthu nilamuthu commented Apr 4, 2025

Work item

This PR creates the pg:upgrade:wait command.

Please refer to this doc for more information related to pg:upgrade:wait.

Testing

Check out this branch and run yarn && yarn build

  1. Run ./bin/run pg:upgrade:prepare on a Standard-Tier leader DB and then pg:upgrade:wait to see it prepare
nmuthu@nmuthu-ltm8kcc cli % ./bin/run pg:upgrade:prepare HEROKU_POSTGRESQL_PUCE_URL -a pg-upgrade-test-app
 ›   Warning: Destructive action
 ›   This command prepares the upgrade for postgresql-flat-28316 to the latest supported Postgres version and schedules to upgrade it during the next available maintenance window.
 ›

To proceed, type pg-upgrade-test-app or re-run this command with --confirm pg-upgrade-test-app: pg-upgrade-test-app
Preparing upgrade on postgresql-flat-28316... done
Your database is scheduled for upgrade during your next available maintenance window.
Run heroku pg:upgrade:wait to track its status.
You can also run this upgrade manually before the maintenance window with heroku pg:upgrade:run. Note: You can only run the upgrade after it's fully prepared, which can take up to a day.

nmuthu@nmuthu-ltm8kcc cli % ./bin/run pg:upgrade:wait HEROKU_POSTGRESQL_PUCE_URL -a pg-upgrade-test-app
Waiting for database postgresql-flat-28316... ⡿ preparing service for upgrade
  1. Run ./bin/run pg:upgrade:run on a Standard-Tier leader DB with an upgrade prepared and then pg:upgrade:wait to see it run
Screen.Recording.2025-04-08.at.10.57.36.AM.mov
  1. Run ./bin/run pg:upgrade:wait after starting an upgrade on essential db
nmuthu@nmuthu-ltm8kcc cli % ./bin/run pg:upgrade:wait HEROKU_POSTGRESQL_PURPLE_URL -a pg-upgrade-test-app
Waiting for database postgresql-flat-11475... ⣟ version upgrade: provisioning
  1. Run ./bin/run pg:upgrade:wait with no database argument
nmuthu@nmuthu-ltm8kcc cli % ./bin/run pg:upgrade:wait -a pg-upgrade-test-app
 ›   Error: You must provide a database. Run `--help` for more information on the command.
  1. pg:upgrade:wait when upgrade has been scheduled (shouldn't wait)
nmuthu@nmuthu-ltm8kcc cli % ./bin/run pg:upgrade:wait HEROKU_POSTGRESQL_PUCE_URL -a pg-upgrade-test-app
Waiting for database postgresql-flat-11475... upgrade is scheduled on 2025-04-17 20:30:00 UTC. You could also run the upgrade immediately using the pg:upgrade:run.

7.heroku help pg:upgrade:wait

nmuthu@nmuthu-ltm8kcc cli % ./bin/run help pg:upgrade:wait
provides the status of an upgrade and blocks it until the operation is complete

USAGE
  $ heroku pg:upgrade:wait [DATABASE] -a <value> [--wait-interval <value>] [--no-notify] [-r <value>]

ARGUMENTS
  DATABASE  config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with
            `APP_NAME::`

FLAGS
  -a, --app=<value>        (required) app to run command against
  -r, --remote=<value>     git remote of app to use
  --no-notify              do not show OS notification
  --wait-interval=<value>  how frequently to poll in seconds (to avoid rate limiting)

DESCRIPTION
  provides the status of an upgrade and blocks it until the operation is complete

@nilamuthu nilamuthu changed the title Adding pg:upgrade:wait command Feat: Adding pg:upgrade:wait command Apr 4, 2025
@nilamuthu nilamuthu changed the base branch from main to pg-upgrade-enhancements April 4, 2025 00:52
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from 5eb3be6 to 6976716 Compare April 4, 2025 21:53
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 4, 2025 21:53 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 4, 2025 21:53 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 7, 2025 23:02 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 7, 2025 23:02 — with GitHub Actions Inactive
@nilamuthu nilamuthu changed the title Feat: Adding pg:upgrade:wait command feat: adding pg:upgrade:wait command Apr 7, 2025
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from 91d74a4 to 1de380c Compare April 8, 2025 20:14
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 20:14 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 20:14 — with GitHub Actions Inactive
@nilamuthu nilamuthu marked this pull request as ready for review April 8, 2025 20:35
@nilamuthu nilamuthu requested a review from a team as a code owner April 8, 2025 20:35
@nilamuthu nilamuthu requested a review from justinwilaby April 8, 2025 20:35
Copy link
Contributor

@justinwilaby justinwilaby left a comment

Choose a reason for hiding this comment

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

Some very minor changes recommended. Overall, it looks good! Thank you!

@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:04 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:04 — with GitHub Actions Inactive
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from fc0664b to 64e3e1b Compare April 8, 2025 22:07
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:07 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:07 — with GitHub Actions Inactive
@nilamuthu nilamuthu requested a review from justinwilaby April 8, 2025 22:17
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from 64e3e1b to aa01a7f Compare April 8, 2025 22:35
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:35 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:35 — with GitHub Actions Inactive
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from aa01a7f to 62d06f4 Compare April 8, 2025 22:36
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:36 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:36 — with GitHub Actions Inactive
@nilamuthu nilamuthu force-pushed the adding-pg-upgrade-wait branch from 62d06f4 to c9b7883 Compare April 8, 2025 22:39
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:39 — with GitHub Actions Inactive
@nilamuthu nilamuthu temporarily deployed to AcceptanceTests April 8, 2025 22:39 — with GitHub Actions Inactive
Copy link
Contributor

@justinwilaby justinwilaby left a comment

Choose a reason for hiding this comment

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

Great work! LGTM

@nilamuthu nilamuthu merged commit 9083f9c into pg-upgrade-enhancements Apr 9, 2025
8 checks passed
@nilamuthu nilamuthu deleted the adding-pg-upgrade-wait branch April 9, 2025 17:12
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