The pre-commit validation runs just before a committing server project to the Teamwork Cloud. This validation protects against violations that are not allowed according to the preset validation suites. You will receive a notification prior to commit completion if the validation fails, according to setup. The notifications can be either a warning (with an ability to continue the commit) or error messages (to disallow commit). Pre-commit validation does not run validations on auto-commits (e.g. when upgrading profiles, on element move to the used project, update from a local file and other).
Required options for pre-commit validation
To enable pre-commit validation, you must set up at least two project options:
When set to true, pre-commit validation will only run on the elements that are locally modified or added by the user.
Anchor
Suites
Suites
Exclude Elements from Used Read-Only Project
True or False
When set to true, it will exclude projects that are used in read-only mode and elements that exist in these projects.
Validation Suites
Validation suites
Specify a validation suites list that must be run before committing changes to a server.
Anchor
Commit
Commit
Excluded scope
Excluded scope
Specify the validation scope to be excluded from the rules that belong to pre-commit validation suites. Elements in the selected scope will not be validated before committing changes to a server.
Anchor
Warning
Warning
Minimal Severity That Prohibits Commit
None
- debug.
- info.
- warning.
- error.
- fatal.
Specify the minimal severity violation severity threshold that prohibits commit. Pre-commit validation will be performed before executing commit to a server. It will validate the model and check if there are validation results with reached or exceeded selected severity levels. Commit will be prohibited until these violations are fixed.
Minimal Severity That Produces Warning
None
- debug.
- info.
- warning.
- error.
- fatal.
Specify the minimal severity threshold that produces a warning. Pre-commit validation will be performed before executing commit to a server. It will validate the model and check if there are validation results with reached or exceeded selected severity level. If these violations are found, a warning dialog will appear, allowing you either to review warnings or to execute project commit.
Warning and error dialogs
Anchor
warning
warning
If a warning appears, you are allowed to choose whether to review violations or to continue to commit. If you choose to review violations, the pre-commit validation results panel will be open; otherwise, your project will be committed without showing violations.
Anchor
error
error
If there is an error, you are not allowed to choose. You will get a list of the validation results.
Note
When the pre-commit validation is supposed to show a warning and an error at the same time, the tool will only show an error due to its behavior being more restricted.
Pre-commit Validation Results panel
The Pre-commit Validation Results panel opens after you either get an error message or you select to review violations in the warning message.
Note
It is impossible to ignore Pre-Commit Validation results.
Toolbar
The toolbar allows you to manage the validation results. All buttons are described in the following table
Button icon
Button name
Description
Expand All
Click to recursively expand all the elements in the validation results area.
Collapse All
Click to recursively collapse all the elements in the validation results area.
Click the arrow next to the button to open the menu of the following navigation commands:
Open Specification - opens the Specification window of the selected element in the validation results area.
Go To - opens a submenu whose commands allow you to track and navigate to the elements.
Select Rule in The Containment Tree - selects the failed validation rule in the Containment tree of the selected element in the validation results area.