Skip to main content
Skip table of contents

CONFIG_VALIDATIONS

CONFIG_VALIDATIONS is a configuration package that is used to add commit message validations to Package commits.


See also:


Usage

  1. Open the configuration package from Designer package list.

  2. Click Export package in the Actions tab.

  3. Click Download.

  4. Edit JSON file.

  5. Import edited JSON back to Designer with Import Package.

After a successful import, changes to the configuration package have been applied to Designer only. It is recommended to deploy the same changes to Runtime environments as well.


Contents

Validation configuration

Validation configurations are managed inside the JSON array block named, validations.

Key

Value type

Example

Description

validationId

String

87259b16-28be-11eb-ad54-2bb3624824bb|

The unique identifier of the validation. Can be generated with online tools, such as UUID Generator.

validationName

String

COMMIT_MESSAGE_EACH_LINE_STARTS_WITH

The unique name of the validation.

description

String

Commit message validation that checks if each new line of it starts with JIRA-.|

Description of the validation, serves to provide additional information about the validation.

validationRule

String

(?s)(JIRA-)(.)*

Validation rule - the logic that will be applied during validation process and determine whether an object under validation is valid or not. In case with commit message validation, the rule is a regular expression.

validationMessage

String

Each line of commit message must start with JIRA

If validation is not successful, validation message can be used to describe the reason for it (e.g. for end users). For example, validation message can be shown in UI as part of form validation, in the message appearing under a form field when the field contains invalid value.

validationMode

String

ERROR

The mode of validation, currently accepts 3 kinds of values: NONE, WARNING or ERROR. NONE means that validation will be skipped. This is useful when validation needs to be saved in the system to serve as an example. WARNING and ERROR modes would apply the given validation rule in the same way, but the difference will be in the way validation failure is treated. For example, commit message validation error would produce in UI a red text with validation message and block the form submission, while a warning text would be colored as green and not block the form submission.

validationType

String

COMMIT_MESSAGE

The validation type. Currently, only commit message validation is supported with 2 possible values: COMMIT_MESSAGE or COMMIT_MESSAGE_LINE. The difference between these options is that COMMIT_MESSAGE applies a regular expression (defined in validationRule) to the whole commit message, while COMMIT_MESSAGE_LINE does it to each line of it (or "paragraph") separately.

You can add a new validation or update the contents of an existing one.

Example: Validation configuration

JSON
"validations": [
    ...
    {
      "validationId": "0bfc9682-28bf-11eb-ad6f-fb56de3fff2a",
      "validationName": "COMMIT_MESSAGE_STARTS_WITH_FULL_TICKET_NUMBER",
      "description": "Example of commit message validation that checks if it starts with JIRA- and a ticket number (sequence of digits)",
      "validationRule": "(?s)(JIRA-\\\\d{1,})(.)*",
      "validationMessage": "Commit message must start with JIRA- and a ticket number consisting of at least 1 digit",
      "validationMode": "ERROR",
      "validationType": "COMMIT_MESSAGE"
    },
    ...
]
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.