Repository navigation
build: align Flyway on 10.20.1 and verify PostgreSQL 17 (#1067) - #1073
Merged
Merged
Conversation
flyway-core was managed by Spring Boot 3.2.3 (9.22.3) while flyway-database-postgresql was pinned to 10.10.0. Flyway 9.22.3 reports PostgreSQL 16 and 17 as untested. Pin both artifacts to 10.20.1, the first line with PostgreSQL 17 support and the version Spring Boot 3.4 manages. Refs iflytek#1067 Signed-off-by: 千乘妍 (Xiaoyaner) <[email protected]>
Testcontainers tests hard-coded postgres:16-alpine. Route them through PostgresTestImage, which keeps PG16 as the default and accepts -Dskillhub.test.postgres.image=postgres:17-alpine. PostgresVersionCompatibilityTest checks the server major matches the image, runs a clean migrate/validate without Flyway's unsupported-version warning, and upgrades a populated schema whose history was written by the Flyway 9.22.3 CLI, keeping its checksums and data. Refs iflytek#1067 Signed-off-by: 千乘妍 (Xiaoyaner) <[email protected]>
Refs iflytek#1067 Signed-off-by: 千乘妍 (Xiaoyaner) <[email protected]>
Refs iflytek#1067 Signed-off-by: 千乘妍 (Xiaoyaner) <[email protected]>
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.
Closes #1067
Motivation
flyway-corewas managed by Spring Boot 3.2.3 as 9.22.3, whileflyway-database-postgresqlwas pinned to 10.10.0. Flyway 9.22.3 treats PostgreSQL newer than 15 as untested, so the release image logsFlyway upgrade recommendedeven on the default PostgreSQL 16. The repository also did not say which PostgreSQL versions are supported.Scope (as agreed in #1067)
flyway-coreandflyway-database-postgresqlare now pinned to 10.20.1 via oneflyway.versionproperty inserver/pom.xml. 10.20 is the first line with PostgreSQL 17 support, and 10.20.1 is the version Spring Boot 3.4 manages. Spring Boot itself stays at 3.2.3. The resolved dependency tree ofskillhub-appdiffers frommainonly in these two coordinates.postgres:16-alpine; they readPostgresTestImage.name(), which defaults to PG16 and accepts-Dskillhub.test.postgres.image=....backend-testsnow runs the full backend suite in a matrix over PostgreSQL 16 and 17.PostgresVersionCompatibilityTest:migrate+validatewith no pending/failed migrations and fails if Flyway logs the unsupported-version warningflyway/flyway:9.22.3, the engine shipped by earlier releases) migrate a database to V100, inserts user/namespace/skill/version data, validates the old history with the new engine, migrates to the latest version and validates again. Old history rows (version, script, checksum) must be unchanged and the data must survive.@SpringBootTest/@DataJpaTestPostgreSQL tests (21 full-context classes run Flyway on startup), which now run on both versions.Not included, per the issue: no change to Compose / one-click / Kustomize defaults (still PG16), no 16→17 data migration, no PG18 claim, no Spring Boot upgrade.
Spring Boot 3.2.3 compatibility notes
I checked
FlywayAutoConfigurationfrom Boot 3.2.3 against the Flyway 10.20.1 jars at the bytecode level. The calls that no longer resolve are all on paths SkillHub does not use:cherryPick,licenseKeyandundoSqlMigrationPrefix(Teams-only) are applied only when the matchingspring.flyway.*property is set.@ConditionalOnClasson modules we don't ship.@ConditionalOnClasson the Flyway 9 package name. With 10.x it is skipped, sospring.flyway.postgresql.transactional-lockwould be ignored. SkillHub does not set it.NativeImageResourceProviderCustomizeris GraalVM native-image only.The same was already true on
mainfor the PostgreSQL module (10.10.0). Everything SkillHub configures (enabled,locations, datasource) goes through APIs that are unchanged.Found while verifying (not changed here)
The Helm chart pins its bundled Bitnami PostgreSQL by digest
sha256:db2312d9…, which is PostgreSQL 18.4 (postgres --versionin that image). Since PG18 is out of scope, I left the chart alone and noted it in the FAQ. Helm users who want a verified version can use an external PG16/17 or overridepostgresql.image. Happy to follow up separately if you'd like the chart pinned to 16 or 17.Verification
Local runs (macOS arm64, Java 21, Docker):
PostgresVersionCompatibilityTestmain's Flyway (9.22.3 core) on both 16.15 and 17.11, caused byFlyway upgrade recommended: PostgreSQL 1x is newer than this version of Flyway./mvnw -B test):PG16: 1739 tests in
skillhub-appplus all other modules, 0 failuresPG17:
PostgresVersionCompatibilityTestand all migration/upgrade tests pass. In full-suite runs on my machine, a fewcontroller.Github*IntegrationTestclasses fail intermittently on PG17 (claim()returns empty, or a count of 0 where 3 is expected). This does not follow the Flyway version, so it looks like a local timing/order flake rather than a regression from this change:controller.**package run failed 5 of these classescontroller.**package run passed 604/604, but full-suite runs hit the same classescontroller.Github*classes (99 tests) passed in isolation for every combination of PG16/PG17 × old/new Flyway, and a schema dump after migrating V1–V121 with the 9.22.3 vs 10.20.1 CLI is byte-identical, with identical history checksumsThe new CI matrix will show whether this reproduces on GitHub runners. Similar intermittent failures in the same class appear in earlier
backend-testsruns onmain(e.g. run 39571013930).npm run buildindocs/skillhub): passedRollout impact
Existing deployments keep PG16 and their Flyway history. On first start the new engine validates the existing history, which the legacy-history test covers. No schema changes or new migrations.