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

Issue 368: Prompt the user *again* if a pending migration is detected. Optionally disable. #371

Merged
merged 11 commits into from
Apr 26, 2021

Conversation

kmanning
Copy link
Collaborator

  • Issue FlywayPlugin: Prompt the user *again* before applying migration #368
  • Applying a migration may be an uncommon case - more commonly, no pending migration may exist
  • Because this is an uncommon occurrence, a user may not be accustomed to validating during the "plan" stage whether or not a pending migration exists.
  • As an extra safe guard, optionally prompt the user again if a migration is detected - reconfirm that the user is aware that a pending migration exists, and approves the application of said migration.
  • This should be optional

@kmanning kmanning marked this pull request as draft April 20, 2021 20:47
@kmanning kmanning linked an issue Apr 20, 2021 that may be closed by this pull request
@kmanning kmanning added this to the v5.16 milestone Apr 20, 2021
@kmanning
Copy link
Collaborator Author

Suggested implementation:

  • Tee the flyway output (and handle failure cases properly)
  • Grep the output for Pending (The various statuses are available here - https://flywaydb.org/documentation/concepts/migrations#migration-states)
  • If a Pending status is detected, prompt the user, "A pending migration was found - please review your flyway output. Do you want to continue and apply the migration?"

@kmanning kmanning force-pushed the issue_368 branch 6 times, most recently from 86c1e07 to 4c03a21 Compare April 23, 2021 19:21
@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2021

Codecov Report

Merging #371 (e42fe51) into master (7c4dbaf) will increase coverage by 0.27%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #371      +/-   ##
==========================================
+ Coverage   80.53%   80.81%   +0.27%     
==========================================
  Files          51       51              
  Lines        1408     1428      +20     
  Branches      311      314       +3     
==========================================
+ Hits         1134     1154      +20     
  Misses        122      122              
  Partials      152      152              
Impacted Files Coverage Δ
src/FlywayMigrationPlugin.groovy 96.07% <95.23%> (+2.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c4dbaf...e42fe51. Read the comment docs.

@kmanning kmanning force-pushed the issue_368 branch 2 times, most recently from 2418022 to e25c3c1 Compare April 23, 2021 19:29
@kmanning kmanning force-pushed the issue_368 branch 6 times, most recently from b5e2782 to 2e6f1ee Compare April 26, 2021 17:23
@kmanning kmanning changed the title Issue 368: Optionally prompt the user *again* if a pending migration is detected Issue 368: Prompt the user *again* if a pending migration is detected. Optionally disable. Apr 26, 2021
@kmanning kmanning force-pushed the issue_368 branch 2 times, most recently from a319fa1 to 57c2154 Compare April 26, 2021 19:10
@kmanning kmanning marked this pull request as ready for review April 26, 2021 19:29
@kmanning kmanning merged commit 9507784 into manheim:master Apr 26, 2021
@kmanning kmanning deleted the issue_368 branch April 26, 2021 19:32
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.

FlywayPlugin: Prompt the user *again* before applying migration
2 participants