-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
…relative, when it's not required
Has this fix held up well for you @danilmalkin ? This issue has been plaguing us in https://www.github.com/apiman/apiman |
Hi @msavy, yes. I've extended |
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. |
There was a problem hiding this 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:
- Changes make sense to me
- We are working on a larger refactoring effort in Created new liquibase.resource.Resource interface #3064 but I think this will merge OK into there once it is done
- Only impacts Spring
- Adds automated tests
Things to worry about:
- Nothing
Thanks again @danilmalkin, and thanks @nvoxland for reviewing and getting that onto master. It's much appreciated. |
There was a problem hiding this 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
Impact
Description
Issue #2281
Method
getCompletePath(String relativeTo, String path)
inSpringResourceAccessor
class trying to remove file name fromrelativeTo
method argument. In the case ofrelativeTo
is a file in the root of classpath and doesn't have a "/" prefix, the regex inreplace()
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.