Note that this capability is only available for the following MettleCI releases:

  • MettleCI via IBM: releases v1.X or later

  • MettleCI direct from Data Migrators: build vXXXX or later

Each Compliance rule can be augmented with additional rule metadata through the use of Attributes and Tags, each of which is described here.

Rule Tags

Each MettleCI Compliance rule can include extra metadata using a set of user-specified values which are referred to as ‘tags’. Each Compliance rule may specify zero or more ‘tags’ which are free-form text labels associated with each rule.

Rule Tagging provides improved rule metadata management in support of a number of use cases:

Some notes on Tag behaviour:

The example CI/CD build pipelines that ship with MettleCI demonstrate the use of tags to identify which rules inhibit the successful completion of CI.

Rule Attributes

Here’s an example of a rule definition which incorporates some Tags.

# Rule attributes
package datamigrators

# Rule tags (effectively user-defined, free-form attributes)
@Tag(“security”)            # This rule identifies a potential security vulnerability
@Tag(“portability”)         # This rule identifies a issues with assets' portability between environments
@Tag(“maintainability”)     # This rule identifies a potential maintainability issue
@Tag(“CorpDataWarehouse”)   # This rule is specific to the 'CorpDataWarehouse' team
@Tag(“fail-ci”)             # This rule is mandatory and so should fail continuous integration if breached

# Rule definition
<blah blah blah>

Attributes are used to add extra information to the Rule which are used by the various MettleCI tools (Workbench, CLI) to change their behaviour.

If you add a @Tag attribute to a rule you must also add a package value to the top of your Compliance rule. This is required by the technology underlying Compliance, and has no other functional implications. A good practice for the package name is to use a unique identifier which identifies the group assuming ownership (and responsibility for maintenance) of the rule. All out-of-the-box rules have a package name of ‘Data Migrators’, for example.

Include and Exclude options for Compliance operations

The various MettleCI tools which use the Compliance Rule library permit the filtering of the rules which they use by ‘positive’ and 'negative' tag inclusion.

The Compliance Test command (available within the Compliance namespace of the MettleCI Command Line Interface) permits you to use -include-tag and -exclude-tag options to filter the rules which will are used by the command. The way that MettleCI interprets these options means that set of include tags is used first, then the set of exclude tags is removed. In the diagram above, only the rules with tags in set A and NOT in B will be used to select Compliance Rules (formally referred to as the 'relative complement of B in A')

Similarly, the MettleCI Workbench permits you to specify which include and exclude tags will be used when testing your Job’s Compliance interactively from within the Workbench interface.