UserDefinedContextCheck

UserDefinedContextCheck confirms that a specific context or a context that matches a specific pattern is present on all changesets.

Uses

Use the check to confirm when a specific context or a context that matches a specific pattern is present on all changesets. More specifically, UserDefinedContextCheck uses a regular expression to setup an enumeration for a customer’s existing environments so they use the correct values.

Run the UserDefinedContextCheck check

To run the UserDefinedContextCheck 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 UserDefinedContextCheck is enabled

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

liquibase checks run --check-name=UserDefinedContextCheck
Short Name Scope Enabled Severity Customization Description
UserDefinedContextCheck changelog

False

Default value: 0

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

<None>

This check confirms that a specific context or a context that matches a specific pattern is present on all changesets.

UserDefinedContextCheck configurable attributes

The following table identifies attributes that are configurable by UserDefinedContextCheck.

Attribute Name Type Description Customization Default Value
OPERATOR String/enum

The location to look for the provided SEARCH_STRING value

  • STARTS_WITH – Value of SEARCH_STRING should be found at the beginning of the table.
  • ENDS_WITH – Value of SEARCH_STRING should be found at the end of the table.
  • CONTAINS – Value of SEARCH_STRING can be anywhere in the table.
  • REGEXP – Value of SEARCH_STRING is a regexp that should be matched.
  • EQUALS - Value of SEARCH_STRING should equal this entry.

STARTS_WITH

SEARCH_STRING String/enum

The substring or regular expression to match with the one in the changelog file. Cannot be empty.

When OPERATOR=REGEXP, SEARCH_STRING must be a valid regular expression. Otherwise, all characters are allowed

--
SEVERITY String/enum

Set the severity to return a code of 0–4 when the check is triggered. Default: 0.

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

'INFO' | 0