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

Support non-classpath: protocols in Spring #2524

Merged
merged 2 commits into from
May 31, 2022
Merged

Support non-classpath: protocols in Spring #2524

merged 2 commits into from
May 31, 2022

Conversation

reallyinsane
Copy link
Contributor

Ensure that SpringResourceAccessor uses classpath* protocol for loading resources if no other protocol is given.

  • no protocol -> classpath*:
  • classpath: -> classpath*:
  • classpath*: -> classpath*:
  • file: -> file:

Environment

Liquibase Version:

4.2.0

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>

maven

Liquibase Extension(s) & Version:

none

Database Vendor & Version:

none

Operating System Type & Version:

Windows 11

Pull Request Type

  • [ x] Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

A clear and concise description of the issue being addressed. Additional guidance here.

As described in #1540 it is not possible to provide changelogs from outside classpath. All locations will be searched on classpath only, even if a file protocol is provided. File protocol is used when database changelogs are handled outside the running applications as installation procedure is separated from deployment. So providing file protocol should be possible.

Steps To Reproduce

List the steps to reproduce the behavior.

Just specify changelog location with file protocol.

Actual Behavior

Location is changed to point to classpath.

Expected/Desired Behavior

When file protocol is given, this should remain unchanged.

Fast Track PR Acceptance Checklist:

Need Help?

Ensure that SpringResourceAccessor uses classpath* protocol for loading resources if no other protocol is given.
- no protocol -> classpath*:
- classpath:  -> classpath*:
- classpath*: -> classpath*:
- file:       -> file:
@kataggart kataggart changed the title #1540 Not possible to provide changelogs from outside classpath Feb 14, 2022
@nvoxland nvoxland changed the base branch from master to 1_9 May 21, 2022 05:45
@nvoxland nvoxland changed the base branch from 1_9 to master May 21, 2022 05:45
@nvoxland
Copy link
Contributor

The changes make sense to me. I don't have a spring environment set up for testing it with different protocols, but we rely on spring's resource locator this should at least be a step in the right direction even if there are some protocols that have some unfound issues still.

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label May 21, 2022
@github-actions
Copy link

Unit Test Results

  4 512 files    4 512 suites   31m 39s ⏱️
  4 420 tests   4 206 ✔️    214 💤 0
52 320 runs  47 312 ✔️ 5 008 💤 0

Results for commit 64a1e0b.

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 is specific to the Spring Resource Accessor.

    • Existing code tidied up and file protocol added.
    • New integration test added to validate the file protocol.
  • No additional testing necessary.

APPROVED

Passing Test Harness Execution
Passing Functional Tests

@nvoxland nvoxland merged commit e6fd34f into liquibase:master May 31, 2022
@kataggart kataggart added the path label Jun 6, 2022
@kataggart kataggart added this to the NEXT milestone Jun 6, 2022
@nvoxland nvoxland changed the title Not possible to provide changelogs from outside classpath Support non-classpath: protocols in Spring Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate IntegrationMaven IntegrationSpringboot path SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions ver4.2.0
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Spring Resource Accessor can't access change logs not from a classpath.
5 participants