Skip to content

fix: migration method selection navigation bug (W-23306091)#3802

Open
sbosio wants to merge 1 commit into
mainfrom
sbosio/bugfix-migration-method-selection
Open

fix: migration method selection navigation bug (W-23306091)#3802
sbosio wants to merge 1 commit into
mainfrom
sbosio/bugfix-migration-method-selection

Conversation

@sbosio

@sbosio sbosio commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The issue was caused because selectedMigrationMethod was overloaded as both the data value (POST body) and the control gate deciding whether to show the method prompt. Once set —interactively or via flag— it stayed truthy, so the prompt was skipped on the next pass (after "Go back", or for a second migration in the same session).

The fix was to introduce a new attribute to record if the method was provided via flag and ensure the selectedMigrationMethod gets reset each time a new migration is configured.

Added one unit test that selects one of the methods and then goes back to select the other one and verifies the POST is done with the correct method (the last one selected) and that the prompt appears two times as expected.

Type of Change

Patch Updates (patch semver update)

  • fix: Bug fix

Testing

Notes:
You'll need to have at least a classic Postgres database on your app (and recommended, optionally an available and empty Advanced one).

Steps:

  1. Checkout this branch and run
    npm install && npm run build
  2. Run
    heroku data:pg:migrate --app example-app
    Follow the interactive steps to configure a migration from the classic DB to the Advanced one with any migration method. On the confirmation step select Go back and observe you're redirected to the destination database selection step instead of the migration method selection and you cannot change the migration method. Cancel the migration configuration with CTRL+C.
  3. Repeat the test with the fixed command
    ./bin/run data:pg:migrate --app example-app
    Verify that now you're allowed to go back to the migration method selection step and change the migration method before confirmation.

Screenshots (if applicable)

Captura de pantalla 2026-07-03 a la(s) 13 46 10

Related Issues

GUS work item: W-23306091

@sbosio sbosio requested a review from a team as a code owner July 3, 2026 16:52
@sbosio sbosio temporarily deployed to AcceptanceTests July 3, 2026 16:52 — with GitHub Actions Inactive
@sbosio sbosio temporarily deployed to AcceptanceTests July 3, 2026 16:52 — with GitHub Actions Inactive
@sbosio sbosio deployed to AcceptanceTests July 3, 2026 16:52 — with GitHub Actions Active
@sbosio sbosio temporarily deployed to AcceptanceTests July 3, 2026 16:52 — with GitHub Actions Inactive
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.

1 participant