-
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
Treat "," as "or" when parsing context expressions. Fixes #1103 #3426
Conversation
Pre-Review Notes We use "," to mean OR in other expressions, so keeps consistency. Even if "OR" is more explicit. I appreciate the tests too Questions I have:
Potential risks:
What could make the full review difficult:
|
Documentation is already fine ( https://docs.liquibase.com/concepts/changelogs/attributes/contexts.html ), this is really a bugfix to make it work according to documentation. |
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.
Bugfix that makes it work according to documentation.
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.
This PR fixes a bug in Liquibase handling of changeset contexts with logical operators to construct groups of ORs. Here's the example of this from the original issue:
- changeSet:
id: 1
context: "(local, cloud) and (test, pre-prod)"
With the fix in this PR, the changeset contexts are treated as explicit ORs, the equivalent of manually setting the changeset context:"(local or test) AND (test or pre-prod)"
.
- Two new unit tests added to validate correct logical operations are applied based on changeset context.
- Automated functional tests are passing.
- Test harness failures in MariaDB are unrelated to this PR (they are due to changes in how MariaDB returns function metadata with collation).
- No additional testing required.
APPROVED
Impact
Description
Updated ExpressionMatcher logic to replace all occurrences of "," with "or" in the expression being evaluated so that existing "or" matching rules can be applied. Fixes #1103
Things to be aware of
Things to worry about
Additional Context
None at this time.