Repurpose db-migrate to run all pending migrations#2936
Merged
Conversation
✅ Deploy Preview for peppy-sprite-186812 canceled.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2936 +/- ##
============================================
+ Coverage 81.12% 81.16% +0.03%
Complexity 1506 1506
============================================
Files 268 268
Lines 7365 7363 -2
Branches 329 329
============================================
+ Hits 5975 5976 +1
+ Misses 1229 1226 -3
Partials 161 161 ☔ View full report in Codecov by Sentry. |
Signed-off-by: David Goss <david@davidgoss.co>
deefca5 to
6f21abe
Compare
davidjgoss
commented
Oct 21, 2024
| @NonNull final FlywayFactory flywayFactory, | ||
| @NonNull final DataSource source, | ||
| final boolean migrateDbOnStartup) { | ||
| final boolean migrateNow) { |
Member
Author
There was a problem hiding this comment.
Renamed to make more sense in the context of db-migrate
wslulciuc
reviewed
Oct 22, 2024
jonathanpmoraes
referenced
this pull request
in nubank/NuMarquez
Feb 6, 2025
Signed-off-by: David Goss <david@davidgoss.co>
jonathanpmoraes
referenced
this pull request
in nubank/NuMarquez
Feb 6, 2025
* Fixing data quality display. (#2937) Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Dataset Version call simplification (#2938) * Fixing data quality display. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Fixing dataset version calls. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> --------- Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * feat: allow db-migrate without version (#2936) Signed-off-by: David Goss <david@davidgoss.co> * Display full `runID` and check icon when copied (#2940) Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Deferred copy revert. (#2941) Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Long text handling (#2942) * Deferred copy revert. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Long text handling. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Adding search back in. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> --------- Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Use project root for docker volume prefix (#2943) Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * fix: Correct SQL query pagination for DatasetVersion findAll method (#2945) Signed-off-by: Alper İnan <kurumsal.alper@gmail.com> Signed-off-by: Alper <kurumsal.alper@gmail.com> * Update changelog for `0.50.0` Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Replace `redoc-cli` with `redocly` Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Prepare for release 0.50.0 Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Prepare next development version 0.51.0-SNAPSHOT Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Templatize event time in `metadata.json` (#2946) * Templatize event time in `metadata.json` Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Use `metadata.template.json` Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> --------- Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Update CHANGELOG.md * Update `web/docs/demo.gif` (#2948) Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * fix(deps): update dependency io.openlineage:openlineage-java to v1.23.0 (#2907) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update dependency org.assertj:assertj-core to v3.26.3 (#2909) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Willy Lulciuc <willy@datakin.com> * fix(deps): update dependency org.postgresql:postgresql to v42.7.4 (#2912) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update dependency org.opensearch.client:opensearch-rest-client to v2.17.1 (#2911) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Willy Lulciuc <willy@datakin.com> * fix(deps): update dependency org.apache.commons:commons-lang3 to v3.17.0 (#2908) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Ignore `**/stats/**` (#2952) Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Update compatibility for `0.50.0` * fix(deps): update dependency org.opensearch.client:opensearch-java to v2.16.0 (#2910) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * `Dataset.currentVersionUuid` `->` `DatasetVersion.uuid` (#2954) Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> * Update Events Page (#2955) * Tuning the events page for longer events. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Adding events file. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Refetch jobs button. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Refetch jobs button. Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> * Lint Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> --------- Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> Co-authored-by: Willy Lulciuc <willy@datakin.com> * Lineage run attachment issue. (#2953) Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> Co-authored-by: Willy Lulciuc <willy@datakin.com> * feature: Better handling of missing environment variables in setupProxy.js file. (#2956) Signed-off-by: Artur Owczarek <owczarek.artur@gmail.com> --------- Signed-off-by: phixMe <peter.hicks@pdtechsolutions.com> Signed-off-by: David Goss <david@davidgoss.co> Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com> Signed-off-by: Alper İnan <kurumsal.alper@gmail.com> Signed-off-by: Alper <kurumsal.alper@gmail.com> Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Artur Owczarek <owczarek.artur@gmail.com> Co-authored-by: Peter Hicks <phixMe@users.noreply.github.com> Co-authored-by: davidjgoss <david@davidgoss.co> Co-authored-by: Willy Lulciuc <willy@datakin.com> Co-authored-by: Alper İnan <65857758+inanalper@users.noreply.github.com> Co-authored-by: Willy Lulciuc <willy.lulciuc@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Artur Owczarek <owczarek.artur@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
There was no Marquez command to run all pending Flyway migrations. This is needed in the context of wanting to run migrations in a short-lived container ahead of the application deployment, so migrations are not coupled to startup. The
db-migratecommand sort of looks like it should do this, but actually only supports running a single specific Java migration which is from ~20 versions ago.Solution
This PR repurposes
db-migrateto run all pending migrations.The original intent was to leave the existing functionality around the V57 migration in place and support omitting the
versionargument to run all pending migrations. However, this was dependent on the command remaining anEnvironmentCommandwhich caused its own problem, because such a command by nature requires the application'srunmethod to have been called, which contains the migration-on-startup logic. So the scenario would go:migrateOnStartup: falsein the configmarquez.jar db-migrate my-config.ymlMarquezApp::runis called by DropwizardmigrateDbOrErrordetects pending migrations and throws because they ostensibly aren't about to rundb-migratecommandSo instead we have reworked the command to be a
ConfiguredCommandwhich only requires the resolved configuration and bootstrap object, and can be run without the application'srunmethod ever being touched.One-line summary: Repurpose db-migrate to run all pending migrations
Checklist
CHANGELOG.md(Depending on the change, this may not be necessary)..sqldatabase schema migration according to Flyway's naming convention (if relevant)