Skip to content

Comments

[DAT-20351] Migrate to Java 21 and update dependencies in pom to the latest version (plus Junit4 to Jupiter migration)#275

Open
andrulban wants to merge 7 commits intoddbfrom
DAT-17807
Open

[DAT-20351] Migrate to Java 21 and update dependencies in pom to the latest version (plus Junit4 to Jupiter migration)#275
andrulban wants to merge 7 commits intoddbfrom
DAT-17807

Conversation

@andrulban
Copy link

No description provided.

…latest version (plus Junit4 to Jupiter migration) (#268)

Original PR with all comments and descriptions -> #268


* [DAT-20351] - update to java21 and Groovy 4, all tests are passed except of liquibase.changelog.filter.ShouldRunChangeSetFilterTest.should_decline_not_changed_changeset_when_has_run_on_change. We need to figure out why behaviour of RunChangesetFilter changed during this upgrade
* [DAT-20351] - fixup ShouldRunChangeSetFilterTest
* [DAT-20351] - fixup integration tests, minor clean up *.groovy files
* [DAT-20351] - update snakeyaml 1.17 -> 2.4, minor *.java tests clean up
* [DAT-20351] - improved coverage reporting
to see dependencies, licenses and coverage info ran either [mvn -U clean install site]
or [mvn -U clean verify site]
* [DAT-20351] - post review changes
* [DAT-20351] - post review changes - second round
* [DAT-20351] - post review changes - third round
* [DAT-20351] - one more 'AfterEach' move up
@andrulban andrulban requested a review from v-petrovych August 19, 2025 11:31
v-petrovych and others added 4 commits August 21, 2025 17:09
… to pom (as we don't generate main JAR as we don't have src module) and add phases to generate test JAR and attach surefire plugin to run during test (because of packaging type pom) (#277)

* [DAT-20351] - update to java21 and Groovy 4, all tests are passed except of liquibase.changelog.filter.ShouldRunChangeSetFilterTest.should_decline_not_changed_changeset_when_has_run_on_change. We need to figure out why behaviour of RunChangesetFilter changed during this upgrade
* [DAT-20351] - fixup ShouldRunChangeSetFilterTest
* [DAT-20351] - fixup integration tests, minor clean up *.groovy files
* [DAT-20351] - update snakeyaml 1.17 -> 2.4, minor *.java tests clean up
* [DAT-20351] - improved coverage reporting
to see dependencies, licenses and coverage info ran either [mvn -U clean install site]
or [mvn -U clean verify site]
* [DAT-20351] - post review changes
* [DAT-20351] - post review changes - second round
* [DAT-20351] - post review changes - third round
* [DAT-20351] - one more 'AfterEach' move up
* [DAT-20627] - try to remove maven source plugin config from parent plugin management to avoid issue on CI/CD
* [DAT-20627] - move source plugin configuration from core to parent level
* [DAT-20627] - try to update maven assembly plugin
* [DAT-20627] - this one is working locally!
* [DAT-20627] - return the latest version of resource plugin, as it was downgraded by mistake (only source plugin should downgraded a bit)
* [DAT-20682] Change packaging type to pom (as we don't generate main JAR as we don't have src module) and add phases to generate test JAR and attach surefire plugin to run during test (because of packaging type pom) (#279)
* [DAT-20682] Change packaging type to pom (as we don't generate main JAR as we don't have src module) and add phases to generate test JAR and attach surefire plugin to run during test (because of packaging type pom)
* [DAT-20682] Add comments into POM file
---------

Co-authored-by: Andrii Tytarchuk <27773495+andrulban@users.noreply.github.com>
… tests for Sonar Cloud (#282)

* [DAT-21138] - 1) Extended code point limit for Yaml 2) introduce unit tests for Sonar Cloud

* [DAT-21391] - post-code review changes
- Add continue-on-error to security report step to prevent timeout failures from breaking the workflow

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Jan 26, 2026

Claude finished @andrulban's task in 2m 38s —— View job


PR Review Complete

Todo List:

  • Read CLAUDE.md for repo guidelines (not present)
  • Get PR diff to see actual changes
  • Review critical production code changes (YAML parsers, pom.xml)
  • Check for bugs, security issues, or logic errors
  • Post review findings

Review Summary

LGTM - No significant issues found in this Java 21 migration and dependency update PR.

Key Changes Reviewed

Production Code Changes:

  • SnakeYAML 1.17 → 2.4: LoaderOptions API correctly used with setCodePointLimit(Integer.MAX_VALUE) to handle large YAML files
  • Representer Updates: Properly adapted constructors to accept DumperOptions (required by SnakeYAML 2.x API)
  • Property Annotations: Added required getAnnotations() and getAnnotation() methods throwing UnsupportedOperationException (appropriate for generated properties)

Build & Dependencies:

  • Java 11 → 21 migration completed
  • JUnit4 → Jupiter migration across 100+ test files
  • PowerMock removed, replaced with Mockito Jupiter
  • Groovy compiler plugin modernized
  • liquibase-cdi module removed (entire module deletion)

Test Coverage:

  • New unit tests added for YAML parsers to verify code point limit handling
  • JUnit migration patterns correctly applied (assertions moved to message-last format)
  • Groovy tests migrated from JUnit4 imports to Jupiter

No bugs, security vulnerabilities, or logic errors detected in the changed code.

* [DAT-21063] - preserve catalog name case only
@claude
Copy link

claude bot commented Feb 9, 2026

Claude finished @v-petrovych's task in 1m 21s —— View job


PR Review Complete

Todo List:

  • Read CLAUDE.md for repo guidelines (not present)
  • Get PR diff to see actual changes
  • Review critical production code changes
  • Check for bugs, security issues, or logic errors
  • Post review findings

Review Summary

LGTM - No significant issues found in this Java 21 migration and dependency update PR.

Files Reviewed

Production Code Changes:

  • YAML parsers (YamlChangeLogParser.java:22-24, YamlSnapshotParser.java:27-29): SnakeYAML 1.17 → 2.4 upgrade correctly implements LoaderOptions.setCodePointLimit(Integer.MAX_VALUE) to handle large YAML files
  • YAML serializers (YamlSerializer.java:161-163, YamlSnapshotSerializer.java:106-108): Representer constructors properly updated to accept DumperOptions parameter (required by SnakeYAML 2.x API)
  • LiquibaseProperty (YamlSerializer.java:234-241): Added required getAnnotations() and getAnnotation() methods throwing UnsupportedOperationException (appropriate for generated properties)
  • PostgresDatabase.java:228-230: Catalog name case preservation logic added (preserves uppercase catalog names)

Build & Dependencies (pom.xml):

  • Java 11 → 21 migration
  • JUnit4 → Jupiter (5.13.3), PowerMock removed, Mockito Jupiter (5.18.0) added
  • SnakeYAML 1.17 → 2.4, commons-cli 1.5.0 → 1.9.0, Groovy 2.3.10 → 4.0.26
  • Maven plugins updated to latest versions
  • liquibase-cdi module removed entirely

Test Coverage:

  • New unit tests added for YAML parsers to verify code point limit handling
  • 100+ test files migrated from JUnit4 to Jupiter (assertions moved to message-last format)

No bugs, security vulnerabilities, or logic errors detected.

… logic (#287)

The driverUsesSpFkeys() method in ForeignKeySnapshotGenerator had a
flawed semver comparison that caused FK referential action rules
(ON DELETE/ON UPDATE) to be misread after upgrading the MSSQL JDBC
driver from 12.4.0 to 13.2.1 (driver package 1.0.66 → 1.0.72).

Root cause:
The old condition `driverMajorVersion >= 6 && driverMinorVersion >= 3`
incorrectly evaluates for any driver with major > 6 but minor < 3.
For driver 13.2.1: `13 >= 6 && 2 >= 3` → false, causing the method
to wrongly return true (thinks driver uses sp_fkeys convention).

This meant when the fastFetch() path called JDBC getImportedKeys(),
the returned standard JDBC constant 3 (importedKeyNoAction) was
interpreted using sp_fkeys convention where 3 = importedKeySetDefault.
Meanwhile the bulkFetch() path used Liquibase's custom MSSQL SQL
(ObjectProperty/CnstIsDeleteCascade) which only returns 0 or 1,
accidentally producing the correct result.

The mismatch between these two paths caused diff to report phantom
FK changes (e.g. "deleteRule changed from importedKeyNoAction to
importedKeySetDefault") even when both databases had identical
NO ACTION rules, resulting in non-empty diffChangeLogs.

Observed failure: Liquibase-CLI-testing repo,
customer_schema_mssql_phytelmaster.feature:113 expected an empty
diffChangeLog but got changesets dropping and recreating FK
PopulationRuleCodeSet_PopulationRuleCodeSetConfiguration_FK1.

Fix: Change the version comparison to properly handle semver:
`driverMajorVersion > 6 || (driverMajorVersion == 6 && driverMinorVersion >= 3)`

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 12, 2026

Claude finished @andrulban's task in 1m 3s —— View job


Todo List:

  • Read CLAUDE.md for repo guidelines (not present)
  • Get PR diff to see what changed in this sync
  • Review changed lines for critical issues
  • Post review findings

Review Summary

LGTM - The latest commit (c79221f) contains a critical bug fix with correct implementation.

Change Reviewed

ForeignKeySnapshotGenerator.java:282 - Fixed flawed semver comparison in MSSQL JDBC driver version check

Old condition (buggy):

if (driverMajorVersion >= 6 && driverMinorVersion >= 3)

New condition (correct):

if (driverMajorVersion > 6 || (driverMajorVersion == 6 && driverMinorVersion >= 3))

Why this fix is correct:

  • The old logic incorrectly evaluated driver version 13.2.1 as 13 >= 6 && 2 >= 3 → false (wrong!)
  • The new logic correctly handles semver: major version > 6 OR (major == 6 AND minor >= 3)
  • Fixes phantom FK diff changes that were reported due to misinterpreted referential action rules

No security vulnerabilities, logic errors, or other issues detected.

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.

3 participants