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

Global flag to restore behaviour of not failing on duplicated changeset identifiers #5296

Merged
merged 7 commits into from Dec 6, 2023

Conversation

filipelautert
Copy link
Collaborator

@filipelautert filipelautert commented Nov 29, 2023

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

Adjust duplicate changeset validation

Added logic in the class to handle duplicate changeset identifiers based on a global configuration flag. This change provides an allowance for duplicated changesets but only when the flag is enabled in GlobalConfiguration. This was done to maintain backward compatibility with versions prior to 4.19.1 where ignoring duplicates was the default behavior (PR #3790) .

when this flag is set to true Liquibase won't fail with message:

Unexpected error running Liquibase: Validation Failed:
     1 changesets had duplicate identifiers
          a.xml::20231024-122624-01::fl

Doc review

New global flag: --allow-duplicated-changeset-identifiers=<false|true>

  • Allows duplicated changeset identifiers without failing Liquibase execution.
  • DEFAULT: false (current behavior)
  • defaults file: 'liquibase. allowDuplicatedChangesetIdentifiers',
  • environment variable: 'LIQUIBASE_ALLOW_DUPLICATED_CHANGESET_IDENTIFIERS

Fix #3881

…se to behavior as it did before version 4.19.1 (PR #3790)
@filipelautert filipelautert changed the title Added flag allowDuplicatedChangesetIdentifiers Created flag to allowDuplicatedChangesetIdentifiers Nov 29, 2023
Added logic in the class to handle duplicate changeset identifiers based on a global configuration flag. This change provides an allowance for duplicated changesets but only when the flag is enabled in GlobalConfiguration. This was done to maintain backward compatibility with versions prior to 4.19.1 where ignoring duplicates was the default behavior.
This commit refactors and extends the testAllProvidedChangesetsAreLoaded test in XMLChangeLogSAXParserTest.groovy. The change aligns the test with a new feature, supporting the duplication of changeset identifiers, thereby improving the flexibility and scalability of the system. Additional conditional statements were included in the test function to distinguish between duplicated and non-duplicated changeset identifiers. Two scenarios were added in where clause to test both situations.
@filipelautert filipelautert changed the title Created flag to allowDuplicatedChangesetIdentifiers Global flag to restore behaviour of not failing on duplicated changeset identifiers Dec 5, 2023
@filipelautert filipelautert added this to the 1NEXT milestone Dec 6, 2023
@filipelautert filipelautert merged commit 91e1ca6 into master Dec 6, 2023
31 of 32 checks passed
@filipelautert filipelautert deleted the fix-3881-by-adding-a-new-flag branch December 6, 2023 20:21
@adrian-velonis1
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

change at 4.19.1 makes includeAll is finding duplicates
3 participants