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

SpringResourceAccessor: fix issue with incorrect match pattern for files from classPath root #3095

Merged
merged 3 commits into from
Aug 31, 2022
Merged

SpringResourceAccessor: fix issue with incorrect match pattern for files from classPath root #3095

merged 3 commits into from
Aug 31, 2022

Conversation

danilmalkin
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

Issue #2281
Method getCompletePath(String relativeTo, String path) in SpringResourceAccessor class trying to remove file name from relativeTo method argument. In the case of relativeTo is a file in the root of classpath and doesn't have a "/" prefix, the regex in replace() method doesn't match the file name.

Changed regex makes the "/" symbol at the start of the string optional. It helps to remove the file name from relativeTo if it's in the root of the classpath and doesn't have a "/" prefix.

@msavy
Copy link

msavy commented Aug 26, 2022

Has this fix held up well for you @danilmalkin ? This issue has been plaguing us in https://www.github.com/apiman/apiman

@danilmalkin
Copy link
Contributor Author

Has this fix held up well for you @danilmalkin ? This issue has been plaguing us in apiman/apiman

Hi @msavy, yes. I've extended SpringLiquibase and SpringResourceAccessor. Now we use a custom SpringResourceAccessor with a fix from this PR.

@msavy
Copy link

msavy commented Aug 26, 2022

Has this fix held up well for you @danilmalkin ? This issue has been plaguing us in apiman/apiman

Hi @msavy, yes. I've extended SpringLiquibase and SpringResourceAccessor. Now we use a custom SpringResourceAccessor with a fix from this PR.

Brilliant, thanks. I have a workaround/hack for now, but if they don't release this at some point soon we'll figure out a way to integrate your fixes.

By the looks of it, the tests for your change pass; I think it's just because nobody has approved your PRs tests to run that it shows as red.

@nvoxland nvoxland changed the title Issue-2281 fix issue with incorrect match pattern for files from classPath root SpringResourceAccessor: fix issue with incorrect match pattern for files from classPath root Aug 29, 2022
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Aug 29, 2022
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

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

Code review and test results:

Things to be aware of:

Things to worry about:

  • Nothing

@github-actions
Copy link

Unit Test Results

  4 620 files  ±  0    4 620 suites  ±0   33m 22s ⏱️ - 4m 18s
  4 617 tests +  2    4 402 ✔️ +  6     215 💤  - 4  0 ±0 
54 576 runs  +24  49 556 ✔️ +28  5 020 💤  - 4  0 ±0 

Results for commit ae72ae9. ± Comparison against base commit cd2d6b0.

@msavy
Copy link

msavy commented Aug 30, 2022

Thanks again @danilmalkin, and thanks @nvoxland for reviewing and getting that onto master. It's much appreciated.

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.

  • Fix addresses a bug in stripping file names from classpath root when there is not a leading /.
  • Fix limited to Spring.
  • New integration tests added.
  • No additional testing required.

APPROVED

@nvoxland nvoxland merged commit 89fef59 into liquibase:master Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants