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

Include inherited labels in databasechangelog table #2870

Merged
merged 2 commits into from
Jun 9, 2022
Merged

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented May 24, 2022

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

Changes MarkChangeSetRanGenerator so that if a changeSet was included with an include/includeAll containing a labels attribute, those labels are included in the labels column of databasechangelog. Makes the behavior match what the contexts attribute was generally doing before.

Fixes #2824
Fixes #2883 (please test)

However, when looking at the current behavior, I found the following wrong logic and made the following changes:

  • The contexts from the include are only logged if changeSet has contexts as well
    • Now the include's context is always tracked
    • The tracked context is always null vs. sometimes an empty string
    • New logic is only applied to new changests going forward, we don't update existing values in the databasechangelog table
  • The include/includeAll functions on DatabaseChangeLog took a LabelExpression and not a Labels like it should. In the changelog file, we define just comma separated lists of labels, not a label expression.
    • The java objects now store Labels not LabelExpression objects
    • I added deprecated versions of the DatabaseChangeLog's include(), includeAll(), and setIncludeLabels() functions to match the old versions that took a LabelExpression and converted them into Labels.
    • I did NOT add deprecated version of DatabaseChangeLog.getIncludedLabels() or ChangeSet.getInheriteableLabels() since java cannot overload return values. I don't think those should be methods generally used by extensions and so it is not worth switching to less useful names to preserve the API compatibility.

Additional Context

I'm adding the ReleaseMajor label due to the changes in logic and APIs listed in the description. They should not be serious breaks and will likely not impact anyone, but something for users to be aware of.

- Include "inherited" labels in databasechangelog table
@nvoxland nvoxland requested a review from suryaaki2 May 24, 2022 05:34
@nvoxland nvoxland added ReleaseMajor Fix needs to be part of an x.y release, not an x.y.z patch release and removed BreakingChange labels May 24, 2022
@nvoxland nvoxland added this to To Do in Conditioning++ via automation May 24, 2022
@github-actions
Copy link

github-actions bot commented May 24, 2022

Unit Test Results

  4 548 files  ±  0    4 548 suites  ±0   31m 38s ⏱️ - 5m 9s
  4 508 tests +  2    4 294 ✔️ +  2     214 💤 ±0  0 ±0 
53 376 runs  +24  48 368 ✔️ +24  5 008 💤 ±0  0 ±0 

Results for commit 184019f. ± Comparison against base commit 5048d9b.

♻️ This comment has been updated with latest results.

@kataggart kataggart linked an issue May 30, 2022 that may be closed by this pull request
@kataggart kataggart added the field label Jun 1, 2022
@kataggart kataggart added this to the NEXT milestone Jun 1, 2022
@ecarneiro01 ecarneiro01 self-assigned this Jun 2, 2022
@ecarneiro01
Copy link

I tested the issues linked to this PR and both of them are fixed in this build. I also checked that both of them could be applied simultaneously:

  • Check label values are propagating correctly to changelog files included in a main changelog.
    • include tag. PASS
  • Check context values are propagating correctly to changelog files included in a main changelog.
    • includeAll tag. PASS
    • include tag. PASS

2870.zip

# Conflicts:
#	liquibase-core/src/test/groovy/liquibase/changelog/DatabaseChangeLogTest.groovy
@nvoxland nvoxland merged commit 831da92 into master Jun 9, 2022
Conditioning++ automation moved this from To Do to Done Jun 9, 2022
@nvoxland nvoxland deleted the inherit-labels branch June 9, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DATABASECHANGELOG DATABASECHANGELOG featureLabels field ReleaseMajor Fix needs to be part of an x.y release, not an x.y.z patch release sprint2022-27
Projects
Archived in project
4 participants