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

DAT-14642 - Prevents Liquibase from incorrectly attempting to redeploy changesets during checksum upgrade #4193

Merged
merged 12 commits into from
May 5, 2023

Conversation

filipelautert
Copy link
Collaborator

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

Fix handling of ChangeLogHistoryServiceFactory when dealing with checksum upgrades.

@filipelautert filipelautert changed the title Dat 14642 Dat-14642 - Fix handling of ChangeLogHistoryServiceFactory when dealing with checksum upgrades. Apr 28, 2023
@filipelautert filipelautert changed the base branch from master to DAT-13285 April 28, 2023 19:56
@filipelautert filipelautert self-assigned this Apr 28, 2023
Copy link
Contributor

@wwillard7800 wwillard7800 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@filipelautert filipelautert changed the title Dat-14642 - Fix handling of ChangeLogHistoryServiceFactory when dealing with checksum upgrades. DAT-14642 - Prevents Liquibase from incorrectly attemptemting to redeploy changesets during checksum upgrade May 3, 2023
@suryaaki2
Copy link
Contributor

@XDelphiGrl Can you review the PR?

@XDelphiGrl XDelphiGrl changed the title DAT-14642 - Prevents Liquibase from incorrectly attemptemting to redeploy changesets during checksum upgrade DAT-14642 - Prevents Liquibase from incorrectly attempting to redeploy changesets during checksum upgrade May 3, 2023
@XDelphiGrl
Copy link
Contributor

Passing functional tests for Postgres are here: https://github.com/liquibase/liquibase-pro-tests/actions/runs/4872052466. The issue was that there is a test validation fix for the calculate-checksum tests that was not in liquibase-pro-tests master when the build triggered. This run used the test PR with the validation fix and this PR branch of Liquibase.

@suryaaki2 suryaaki2 merged commit c48d7f4 into DAT-13285 May 5, 2023
21 checks passed
@suryaaki2 suryaaki2 deleted the DAT-14642 branch May 5, 2023 19:36
suryaaki2 added a commit that referenced this pull request May 5, 2023
* Compute checksum method updated

* Checksum logic updated for visitors and changes.

* GenerateCheckSum field filter logic updated, plus refactoring on generateCheckSum logic from createProcedure change

* generateCheckSum code refactoring done for Create Procedure, updated same method logic for CreateView change, plus some minor refactorings.

* Fixed unit tests.

* Added createProcedure and changeSet unit tests

* Added back procedure text null check.

* Null check added on normalizing stream constructor method.

* Correction to previous commmit on null check added on normalizing stream constructor

* CURRENT_CHECKSUM_ALGORITHM_VERSION updated from 8 to 9.

* Update checksum test assertions to match with algorithm version change

* Review comments applied.

* Update encoding configuration for CreateProcedure change.

* CreateProcedureChange test name updated.

* Update calculateCheckSum command tests to upgrade expected checksum which changed after upgrading algorithm version.

* CreateProcedure and CreateView tests added, plus minor refactorings.

* Merge

* Updates checksum for tests.

* Exclude fields for PRO change types to avoid recalculating checksum when there are not significant changes.

* Added a generic generateCheckSum method to use it across some different change types extending from CreateProcedureChange.

* Add missing parameter

* - Update change objects (CreateProcedure, CreateView and SQLFile) to make use properties updates when using a SQL file
- Added unit tests for changes made.

* - Support added to exclude change set attribute fields not needed when computing checksum.
- Extract expanding stream content in to a separate component.

* - Undo fields exclusion from generateCheckSum (AbstractSQLChange).
- PropertyExpandingStream refactoring.

* - New checksum unit tests added for some more change attributes for CreateProcedure and CreateView.
- Minor refactoring done on tests.

* Undo db change property changes recently done from CreateProcedure change.

* DAT-14642 - Prevents Liquibase from incorrectly attempting to redeploy changesets  during checksum upgrade (#4193)

* Makes sure that we reset ChangeLogHistoryServiceFactory after upgradingCheckSums.

* Rollback DropAllCommand.java changes.

* Trigger Build

* Rollback changes

* Makes ReleaseLocks Command checksum upgrade consistent with ListLocks

* Fix null md5sum issues during checksum upgrades

* When updating checksums use the stored file path instead of the generated one as we changed the way that we store paths during the years

* Fix validate command

* Fix unexpected-changesets command

* Adding unit tests for PR 4210 .

---------

Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>

---------

Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
Co-authored-by: Daniel Mallorga <75833793+MalloD12@users.noreply.github.com>
Co-authored-by: filipe <filipe@caelum>
Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>
Co-authored-by: suryaaki2 <80348493+suryaaki2@users.noreply.github.com>
@filipelautert filipelautert added this to the 1NEXT milestone May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants