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

Fixed resolveSibling method by updating URL resource type #3413

Merged
merged 4 commits into from
Nov 28, 2022

Conversation

MalloD12
Copy link
Contributor

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

This change has changed the resource type and the way it uses to create a relative path to a changelog file.

Fixes #3393

Things to be aware of

  • ResolveSibling logic updated for a Spring resource.

Things to worry about

  • This change has an impact only with SpringBoot.

Additional Context

  • Nothing

@github-actions
Copy link

github-actions bot commented Oct 26, 2022

Unit Test Results

  4 752 files    4 752 suites   34m 33s ⏱️
  4 699 tests   4 463 ✔️    236 💤 0
55 608 runs  50 289 ✔️ 5 319 💤 0

Results for commit d78130c.

♻️ This comment has been updated with latest results.

@OleksandrShkurat
Copy link

OleksandrShkurat commented Oct 26, 2022

My project is also affected by this issue, so I really expect this fix to be released as soon as possible. Currently, I forced to rollback liquibase to 4.16.1

@MalloD12
Copy link
Contributor Author

My project is also affected by this issue, so I really expect this fix to be released as soon as possible. Currently, I forced to rollback liquibase to 4.16.1

Hi @OleksandrShkurat thanks for sharing. I'll do my best to have this change ready and available to merge as soon as possible. I would need first to get some review/feedback from the team/community.

Thanks,
Daniel.

@OleksandrShkurat
Copy link

OleksandrShkurat commented Oct 26, 2022

I've tried your change locally in my project and it helps. Thank you for contribution.

@@ -40,7 +41,7 @@ public liquibase.resource.Resource resolve(String other) {
@Override
public liquibase.resource.Resource resolveSibling(String other) {
try {
Resource otherResource = this.resource.createRelative("../"+other);
UrlResource otherResource = new UrlResource(this.resource.createRelative(other).getURL());
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the correct fix. Switching an existing Resource implementation to UrlResouce class is just working around the problem that there are differences between the Resource implementations that shouldn't be there.

I'm thinking maybe #3355 is the more wide-ranging fix for this?

@Viserius
Copy link

Viserius commented Nov 7, 2022

Any updates yet? @nvoxland

@MalloD12
Copy link
Contributor Author

MalloD12 commented Nov 7, 2022

Any updates yet? @nvoxland

Hi @Viserius,

We have a fix already implemented for this, but we are not able yet to move forward with this due to a test dependency issue we are having with one of our projects. We have part of the team already working on it and I hope we can solve that issue asap so we can move forward with this. I'll keep you guys posted here.

Thanks for your patience,
Daniel.

Copy link
Collaborator

@filipelautert filipelautert left a comment

Choose a reason for hiding this comment

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

Fixes the path handling.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

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

PR fixes Liquibase Springboot startup migrations for changelogs with loadData changesets. The bug manifested when the data file (csv) was relative to the changelog because an incorrect path to the csv was constructed. This PR removes an unecessary ..\ from the path to the csv.

  • Automated functional and test harness executions passing.
  • No additional testing required.

APPROVED

@filipelautert filipelautert merged commit 5eace6e into master Nov 28, 2022
@filipelautert filipelautert deleted the fix-issue-3393 branch November 28, 2022 22:22
@@ -3,6 +3,7 @@
import liquibase.exception.UnexpectedLiquibaseException;
import liquibase.resource.OpenOptions;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;

Choose a reason for hiding this comment

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

this looks like unused import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @konikvranik,

Thanks for pointing this out. I'm going to remove this unused import in a different PR.

@kevin-atx kevin-atx added this to the 1NEXT milestone Dec 2, 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
8 participants