ChangesetLabelCheck

This check enforces the Liquibase best-practice recommendationto assign labels to every changeset to provide better deployment control and to enhance traceability and granularity of deployments across changesets.

Note: Context and Label are similar, but the best-practice is to use context for deployment environments and labels more like free-form tags for features, content, release, or other process-centric filter.

Uses

Use the check to enhance deployment control of specific changesets by requiring labels be assigned to every changeset in a changelog. Whether in automation or manual testing of proposed schema changes at the dev level, labels provide better deployment control. Using labels allows just the changesets which match specified label filter(s) to be run. For example, a team could label change sets by release, or branch name, or developer name, etc and when a Liquibase job is run, only the specified subset of label-matching changesets will be deployed. This quality check, like other checks, can be configured with a severity level which returns an exit code designed to stop automated jobs, giving your team time to apply this Liquibase best practice.

Run the ChangesetLabelCheck check

The ChangesetLabelCheck check is enabled by default, so you will not need to turn it on if you have not changed your settings previously. To run the ChangesetLabelCheck check, ensure you have a Liquibase Pro license and the checks-scope property includes changelog. The checks-scope parameter is set in the default properties file, environment variable, or any standard method. Then, check the changelog to see if ChangesetLabelCheck is enabled.

Enable the ChangesetLabelCheck check by running the following command in the CLI:

liquibase checks enable --check-name=ChangesetLabelCheck
Short Name Scope Enabled Severity Customization Description
ChangesetLabelCheck changelog

true

Default value: 0

  • 'INFO' | 0
  • 'MINOR' | 1
  • 'MAJOR' | 2
  • 'CRITICAL' | 3
  • 'BLOCKER' | 4

<None>

This check enforces the Liquibase recommendation that labels be assigned to each changeset to provide better deployment control and to enhance traceability of efforts across changesets.