-
Notifications
You must be signed in to change notification settings - Fork 1.9k
update-to-tag fixes when provided tag doesn't exist or there is not tagDatabaseChange in the changelog #6169
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
Conversation
- Integration tests added.
liquibase-standard/src/main/java/liquibase/changelog/StatusChangeLogIterator.java
Outdated
Show resolved
Hide resolved
liquibase-standard/src/main/java/liquibase/changelog/StatusChangeLogIterator.java
Outdated
Show resolved
Hide resolved
…ogIterator to UpdateToTagCommandStep.
|
||
if(GlobalConfiguration.STRICT.getCurrentValue()) { | ||
TagDatabaseChange tagDatabaseChange = getTagDatabaseChange(changeLog.getChangeSets()); | ||
boolean thereIsTagDatabaseChange = tagDatabaseChange != null; |
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.
Seems the boolean value found
at line 107 is doing the same logic as getTagDatabaseChange
: found
is going through all the changelogs
and then getTagDatabaseChange
is doing the same thing - just one use streams and the other one for loops.
Both codes could be merged so you don't need to iterate over changelogs twice. For instance: found could hold a TagDatabaseChange
instead of a boolean
and then you can use it for the STRICT
logic here too.
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.
Yeah, I saw it but decide to go with this change as it is, because found
boolean flag considers both cases together (tagDatabaseChange
exits and the runtime tag matches with the change's tag).
…er (!?); fxied exception message
this is a useful change, but want to notify other stakeholders about this implementation |
@rberezen that's a good point. I do agree that we need to be careful how we continue to add to |
I agree with @rberezen, I think at some point there would be some feature crashing using
What do you guys think? |
Impact
Description
Fixes #6126
When running liquibase update-to-tag --tag=myTag, two different non-ideal things can happen:
To keep backward compatibility with some people's usage we have not made any specific change to the current behavior, but what we have done on this PR is to introduce the usage of
STRICT
global configuration for the two above cases. Now, ifSTRICT=true
in the first case aTagDatabaseChange
not found error message will be displayed and in the second case a message letting the user know there is no matching between the command tag argument and the tag specified in the change.Things to be aware of
Things to worry about
Additional Context