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

Smooth out differences in "./" paths #2915

Merged
merged 2 commits into from
Jun 8, 2022
Merged

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Jun 3, 2022

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

To make changeset path tracking more user friendly and to support differences that crop up between versions, we normalize paths coming into liquibase and coming out of the databasechangelog table in order to provide fuzzy matching. For example, currently we ignore things like "classpath:" or / vs. \ differences.

This updates the fuzzy matching logic to also ignore paths that start with ./ or might contain /./ blocks within it.

There are earlier versions and some configurations of liquibase which stored paths like ./com/example/changelog.xml which is logically identical to com/example/changelog.xml and we should not see those paths as different.

Fixes #2259

Things to be aware of

  • Can see the fix by updating the path in databasechangelog table to have a ./ and see that it no longer sees the changeset as different. Or by changing the changelog-file setting to have a ./ at the beginning after previously having ran it without
  • Added unit test for normalizePath, but there are no "end to end" automated tests with this specific difference

Things to worry about

  • Nothing

@nvoxland nvoxland added this to To Do in Conditioning++ via automation Jun 3, 2022
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Unit Test Results

  4 524 files  ±  0    4 524 suites  ±0   33m 9s ⏱️ + 2m 25s
  4 466 tests +  5    4 252 ✔️ +  9     214 💤  - 4  0 ±0 
52 872 runs  +60  47 864 ✔️ +64  5 008 💤  - 4  0 ±0 

Results for commit 20a8645. ± Comparison against base commit a67e29e.

♻️ This comment has been updated with latest results.

@FBurguer FBurguer self-assigned this Jun 8, 2022
@FBurguer
Copy link

FBurguer commented Jun 8, 2022

Liquibase does not longer see as different com/example/changelog.xml and ./com/example/changelog.xml. On the DATABASECHANGELOG table, liquibase saves the path you indicated on the properies file, so if you used ./com/example/changelog.xml is going to save ./com/example/changelog.xml and if you use com/example/changelog.xml its going to save com/example/changelog.xml.

Test Environment
OS: Windows 10
Java 11
h2 2.1.212

@nvoxland nvoxland merged commit 5048d9b into master Jun 8, 2022
Conditioning++ automation moved this from To Do to Done Jun 8, 2022
@nvoxland nvoxland deleted the normalize-dot-slash-paths branch June 8, 2022 19:59
@kataggart kataggart added this to the NEXT milestone Jun 9, 2022
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
Development

Successfully merging this pull request may close these issues.

Breaking change on how the file name is calculated hence how the checksum is calculated
4 participants