Global settings
To configure global settings, click Administration ⚙️ at the top of the page, then click YACC Configuration under the ADD-ONS heading from the Bitbucket Administration page side menu.
See Configuration for settings information.
Pre-receive hook settings
Enable per-project settings
Go to your project and from the side menu click Project settings ⚙️ > Hooks. Yet Another Commit Checker is under the Pre Receive heading.
From the Actions column, click the ellipsis (…) and select Enable from the the Status dropdown.
See Configuration for settings information.
Enable per-repository settings
Go to your repository and from the side menu click > Repository settings ⚙️ > Hooks. Yet Another Commit Checker is under the Pre Receive heading.
From the Actions column, click the ellipsis (…) and select Enable from the the Status dropdown.
See Configuration for settings information.
The hook can also be configured via the Bitbucket REST API.
See Using repository hooks for additional information.
Merge check settings
Enable per-project settings
Open your project and from the side menu select Project settings ⚙️ > Merge checks. Yet Another Commit Checker is under the Merge checks heading.
From the Actions column, click the ellipsis (…) and select Enable from the the Status dropdown.
See Configuration for settings information.
Enable per-repository merge check settings
Open your repository and from the side menu select Repository settings ⚙️ > Merge checks. Yet Another Commit Checker is under the Merge checks heading.
Click the ellipsis (…) and select Enable from the the Status dropdown..
See Configuration for settings information.The merge check can also be configured via the Bitbucket REST API.
See Checks for merging pull requests for additional information.
Configuration settings
YACC settings are grouped into tabs, where you can configure the different aspects of the hook.
Tip |
---|
Where are the configuration settings?
From any location, click Learn More to open the Yet Another Commit Checker documentation. |
All YACC Configuration pages contain different options, depending on where you are configuring the settings (
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Status | ||
---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Configuration
General Configuration
Feature | Feature Locations | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overriding global configuration |
| Bitbucket administrator defines who can override hook settings defined on a global level:
Limiting configuration changes does not modify or remove existing hooks configuration so that you can switch this option with no risk to existing configurations. This option can be changed for Pre-receive hooks and Merge checks independently. | ||||||||||||||||||
Scan All Commits in Pull Request |
| When enabled, the pre-receive hook scans all commits in a Pull Request on a merge attempt, even if they have been scanned before. | ||||||||||||||||||
Enable dry run mode |
| When enabled, the pre-receive hook displays an error but does not reject the push action. | ||||||||||||||||||
Skip checks on cross-repository pull requests |
| When enabled, YACC skips the checks for cross repository request merges. Normally a check is performed on one repository, and then on the other. With this feature enabled, the second check is removed.
|
Commits
Commit Requirements
Feature | Feature Locations | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Require Committer Matches Valid User |
| When enabled, YACC checks that the committer email matches any valid Bitbucket Server user. | ||||||||||||||||||||||||||||||||||
Require Matching Committer Email |
| When enabled, the committer email must match the email of a valid Bitbucket Server user. | ||||||||||||||||||||||||||||||||||
Require Matching Committer Name |
| When enabled, the committer name must match the name of the Bitbucket Server user. | ||||||||||||||||||||||||||||||||||
Committer Email Regex |
| When a regex is present, the committer email must match the regex. | ||||||||||||||||||||||||||||||||||
Commit Message Regex |
| When a regex is present, the commit message must match the regex. Leading and trailing whitespace are ignored. requires the commit message to be in the form of:
See Regex is not working for debugging details. |
Jira Issues
The Jira Issues tab allows you to set how Bitbucket responds to Jira issues in commit messages.
Note |
---|
To set Jira Issue Requirements through YACC, you must also configure a Jira Application Link in Bitbucket Server. |
Jira Issue Requirements
Feature | Feature Location | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Jira App Link |
| Jira application links are used to:
When you have multiple application links to your Jira instances, the YACC Jira App Link feature allows you to determine which application links it uses to validate issue keys. The App Link feature has three options:
To create a Jira application link, see Link Bitbucket with Jira. | ||||||||||||||||||||||||||||||||||
Require Valid Jira Issue(s) |
| When enabled, commit messages must contain valid Jira issue IDs. Jira issue IDs are defined as any item that matches the regex This can result in false positives if commit messages contain strings that look like Jira issues. For example, | ||||||||||||||||||||||||||||||||||
Require Matching Jira Issue In Branch Name |
| When enabled, issue keys in the commit message are checked against the branch name. The commit is rejected if the branch name does not contain an issue key. The default branch (typically
Enable the Require Valid Jira Issue(s) option first to use this feature. | ||||||||||||||||||||||||||||||||||
Ignore Unknown Jira Project Keys |
| When enabled, any issue-like items that do not contain a valid Jira project key (for example, | ||||||||||||||||||||||||||||||||||
Issue JQL Matcher |
| When a JQL query is present, detected Jira issues must match this query. |
Additional topics
See Jira Advanced Searching for documentation regarding writing and testing JQL queries.
See Jira authentication failed message article in the Troubleshooting section.
Branches
The Branches tab is used to set branch naming requirements.
Branch Requirements
Feature | Feature Locations | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Branch Name Regex |
| When present, only branches with names that match this regex can be created. This also affects branches created within the Bitbucket Server UI. This only affects new branches and branches created within the Bitbucket UI; existing branches that do not match this regex are allowed. Leading and trailing whitespace are ignored. |
Exclusions
Exclude
Feature | Feature Locations | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Exclude Commits From Bitbucket UI |
| When enabled, YACC skips validation of changes made through the Bitbucket UI. This includes edits from the built-in web editor and the Apply suggestion feature. The latter does not display a rejection message and does not allow repeat attempts even after correcting the commit message (Bitbucket bug report), so it may be useful not to validate such changes. | ||||||||||||||||||||||||||||||||||
Exclude Merge Commits |
| When enabled, merge commits are excluded from commit requirements. This includes merge commits pushed through the command line and merges made via the Pull Request UI. | ||||||||||||||||||||||||||||||||||
Exclude Commit by Regex |
| When present, commits are excluded from all requirements if part of the commit message matches this regex. Leading and trailing whitespace are ignored. | ||||||||||||||||||||||||||||||||||
Exclude Branch by Regex |
| When present, commits on branches that match the specified regex are excluded from all checks. Branch regex exclusion is applied before the Branch Name Regex option; i.e., branch creation is never blocked when a branch matches the Exclude Branch pattern. Leading and trailing whitespace are ignored. | ||||||||||||||||||||||||||||||||||
Exclude Service User Commits |
| When enabled, commits from service users (i.e., using SSH Access Keys) are excluded from commit requirements. | ||||||||||||||||||||||||||||||||||
Exclude User Exclude Group |
| Select from the dropdown lists of Bitbucket User Names or Groups. Commits from these users or members of these groups are excluded from commit requirements. |
Error Messages
Error Message Customization
Feature | Feature Locations | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Error Messages
|
| The Error Messages tab allows you to customize various messages produced by the YACC hook. For each entry, you can add a customized error message that replaces the default error message. |
Example message
To add a customized error message to help ensure internal policies were being followed, a heading message could look like this:
Your commit message does not conform to organizational requirements. Contact your Bitbucket repository administrator for details
Add your message to the appropriate field; in this case, the Header field and click Enable.
When triggered, Bitbucket displays the custom error message:
Advanced Options
Info |
---|
Advanced options are configurations applied globally to all hooks (pre receive/merge hooks) and cannot be overridden in project/repo settings. |
Configuration
Overridden username - By default, YACC uses the user account associated with the committer to make a connection to Jira to validate issues, run JQL queries, etc. This can cause authentication issues when the user pushing the code does not have read access to the corresponding Jira project. Examples include commits from continuous integration or commits made through SSH access keys.
The specified username is used for all Jira queries if this parameter is configured. There must be a valid Bitbucket username associated with a Jira account.
The Overridden username parameter can only be specified in the global settings. The setting is shared between the pre-receive hook and the merge check.
Jira Issues
Allow Lower Case Jira Issue Keys - When enabled, the Require Valid Jira Issue(s) configuration uses case insensitive matching to find Jira tickets.
Click Save Advanced Options after any changes.