-
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
refactor ValidatingVisitor to use factory pattern, error if strict is set and defaults file does not exist (DAT-15920) #5814
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3ee3ddc
refactor ValidatingVisitor to use factory pattern
StevenMassaro df092f3
refactor defaults file error handling to use factory pattern
StevenMassaro 98da0c6
Revert "refactor defaults file error handling to use factory pattern"
StevenMassaro 60eaeda
error if strict is set and defaults file does not exist
StevenMassaro c3a14d9
fix SingletonObjectTest
StevenMassaro 672eeea
clear cached validating visitors after they are used
StevenMassaro aadb1b7
clear cached validating visitors after they are used using a differen…
StevenMassaro cec0c92
add javadoc
StevenMassaro 01bc6b5
Merge branch 'master' into DAT-15920
StevenMassaro f88643f
Merge branch 'master' into DAT-15920
StevenMassaro 8f7e0f7
Revert "clear cached validating visitors after they are used using a …
StevenMassaro 4314c2c
switch factory to produce a generator, which produces a ValidatingVis…
StevenMassaro 5755a5e
remove setRanChangesetList method
StevenMassaro 2e071b3
update javadoc
StevenMassaro e696574
more javadoc
StevenMassaro b0822ca
Merge branch 'master' into DAT-15920
StevenMassaro File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...tandard/src/main/java/liquibase/changelog/visitor/StandardValidatingVisitorGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.changelog.RanChangeSet; | ||
|
||
import java.util.List; | ||
|
||
public class StandardValidatingVisitorGenerator implements ValidatingVisitorGenerator { | ||
@Override | ||
public int getPriority() { | ||
return PRIORITY_DEFAULT; | ||
} | ||
|
||
@Override | ||
public ValidatingVisitor generateValidatingVisitor(List<RanChangeSet> ranChangeSetList) { | ||
return new ValidatingVisitor(ranChangeSetList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
liquibase-standard/src/main/java/liquibase/changelog/visitor/ValidatingVisitorGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.changelog.RanChangeSet; | ||
import liquibase.plugin.Plugin; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* An interface for generating validating visitors, which are used to validate changesets. | ||
*/ | ||
public interface ValidatingVisitorGenerator extends Plugin { | ||
Check notice Code scanning / CodeQL Constant interface anti-pattern Note
Type ValidatingVisitorGenerator implements constant interface
Plugin Error loading related location |
||
|
||
int getPriority(); | ||
|
||
/** | ||
* Generates a validating visitor for the provided list of ran change sets. | ||
* | ||
* @param ranChangeSetList The list of ran change sets to validate. | ||
* @return A validating visitor for the provided list of ran change sets. | ||
*/ | ||
ValidatingVisitor generateValidatingVisitor(List<RanChangeSet> ranChangeSetList); | ||
} |
22 changes: 22 additions & 0 deletions
22
...standard/src/main/java/liquibase/changelog/visitor/ValidatingVisitorGeneratorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package liquibase.changelog.visitor; | ||
|
||
import liquibase.plugin.AbstractPluginFactory; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ValidatingVisitorGeneratorFactory extends AbstractPluginFactory<ValidatingVisitorGenerator> { | ||
@Override | ||
protected Class<ValidatingVisitorGenerator> getPluginClass() { | ||
return ValidatingVisitorGenerator.class; | ||
} | ||
|
||
@Override | ||
protected int getPriority(ValidatingVisitorGenerator obj, Object... args) { | ||
return obj.getPriority(); | ||
} | ||
|
||
public ValidatingVisitorGenerator getValidatingVisitorGenerator() { | ||
return getPlugin(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Useless parameter Note