Skip to content

Conversation

@jgarec
Copy link
Contributor

@jgarec jgarec commented Mar 24, 2024

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

fixes #5724
fixes #5681

To handle previous changeset deployed with 4.6.0 <= liquibase < 4.23.1; where filename contains relatives paths , this PR now compares filenames of incoming changeset and already executed changeset in the same way.

Things to be aware of

Things to worry about

Check current PR #5681 which impact the same code.

Additional Context

@filipelautert
Copy link
Collaborator

filipelautert commented Mar 25, 2024

@jgarec thanks for the detailed issue and PR . I ran some tests and it failed on Windows, so I pushed some extra replaces to your fix and now it seems fine.

@Alf-Melmac this PR also fixes #5681 . I copied your new test from #5682 to this branch and it works as now we remove the classpath and : from the string as it was before. I also managed to reproduce your issue from https://github.com/Alf-Melmac/liquibase-issue-changeset-with-classpath and using this branch I get now: ERROR: relation "test_table" already exists.

If both of you could give this PR another round of test I would be grateful.

@Alf-Melmac
Copy link
Contributor

@filipelautert Thanks! The removal of Paths.get looks promising. I'll check against the production setup tomorrow.

@jgarec
Copy link
Contributor Author

jgarec commented Mar 26, 2024

@filipelautert, Still ok for me with your fix 👍

@Alf-Melmac
Copy link
Contributor

Can confirm that it also works in the actual project 👍

Copy link
Contributor

@tati-qalified tati-qalified left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested multiple path types with different liquibase versions (4.9.1, 4.16.1, 4.24.0), to see if this build would recognise the path formats.

As far as I can tell, it works as expected.
Here are some of the recognised syntaxes:

  • changelog.xml or ./changelog.xml
  • ../changelog.xml
  • folder1/subfolder/../changelog.xml or ./folder1/subfolder/../changelog.xml
  • classpath:/folder1/changelog.xml
  • classpath:/folder1/subfolder/../changelog.xml
  • same but setting a searchpath instead of using classpath:

If there are any other formats I should test, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

4 participants