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

Treat "," as "or" when parsing context expressions. Fixes #1103 #3426

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

rozenshteyn
Copy link
Contributor

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

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

  • None at this time.

Things to worry about

  • None at this time.

Additional Context

None at this time.

@nvoxland
Copy link
Contributor

nvoxland commented Nov 7, 2022

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:

  • None

Potential risks:

  • None

What could make the full review difficult:

  • Check if there are docs to update

@filipelautert filipelautert self-assigned this Nov 10, 2022
@filipelautert filipelautert added sprint2022-38 SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Nov 10, 2022
@github-actions
Copy link

github-actions bot commented Nov 10, 2022

Unit Test Results

  4 740 files  ±  0    4 740 suites  ±0   35m 44s ⏱️ + 1m 8s
  4 695 tests  - 16    4 459 ✔️  - 19     236 💤 +3  0 ±0 
55 560 runs  +12  50 252 ✔️ +  7  5 308 💤 +5  0 ±0 

Results for commit d991f7d. ± Comparison against base commit fe07fae.

♻️ This comment has been updated with latest results.

@filipelautert
Copy link
Collaborator

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.

@filipelautert filipelautert added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Nov 11, 2022
Copy link
Collaborator

@filipelautert filipelautert left a 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.

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.

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

@filipelautert filipelautert merged commit 28509bf into liquibase:master Nov 18, 2022
@filipelautert filipelautert added this to the 4.18.0 milestone Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions sprint2022-38 TypeBug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

mixing parenthesis with comma does not work
5 participants