Simple, and easy to use, commit checker for Atlassian Stash. There are many commit checkers out there. This plugin aims at being simple and user friendly. The admin GUI (here and here) allows the Stash administrator to add custom messages for each rejection reason. Here is a sample reject message and here is a sample accept message. This is a screenshot of a push being rejected.
Available in Atlassian Marketplace.
- Check author in commit
- email is same as users email in Stash.
- name is same as users name in Stash.
- Check that author name, and/or email, in commit exists for any user in Stash
- Check committer in commit
- email is same as users email in Stash.
- name is same as users name in Stash.
- Optionally check author email against regular expression instead of equality to email in Stash. Like:
- ^${STASH_USER}@.*
- ^[^@]*@company.domain$
- Check that changed content does not match a specific regexp, like unresolved merge.
- Check size of commits, so that large files don't accidently gets pushed.
- Check JQL query. Can be used to check that any JIRA is in a specific state. There is an extra variable, ${REGEXP}, available for use in the query.
- Example: issue = ${REGEXP} AND status = "In Progress" AND assignee in ("${STASH_USER}")
- Simple configuration of rules that must apply to commit messages. Organized in groups.
- A group can be used for matching, for example, issues. It can state that "at least one", "all of" or "none" of the issues can be mentioned in the commit messages.
- Rules are added to the group. A rule can, for example, define Jira as a regular expression and the name "Jira".
- If a group matches a commit, it can reject it or just show a message to the comitter.
- Check only branches matching a regular expression.
- Check that branch name matches specific regexp.
- Exclude merge commits.
- Exclude tag commits.
- Check commits in pull requests
- Show a general reject message.
- Show a general accept message.
- Optionally accept all commits from service users.
- Dry run mode, where all commits are accepted. But verification results are shown.
- Supporting variables to be used in error messages and checks.
- STASH_EMAIL, Email of user in Stash.
- STASH_NAME Name of user in Stash.
- COMMITTER_EMAIL, Email of committer name.
- COMMITTER_NAME, Name of committer email.
- AUTHOR_EMAIL, Email of author email.
- AUTHOR_NAME, Name of author name.
- STASH_USER, Username of user in Stash.
The included features should:
- Be easy to configure as an administrator of Stash. Any rejection reason delivered to the committer should be configurable.
- Be easy to use as a committer. With user friendly rejection messages, that clearly explains what was wrong and how to fix it.
You will need Atlas SDK to compile the code.
You can generate Eclipse project:
atlas-compile eclipse:eclipse
Package the plugin:
atlas-package
Run Stash, with the plugin, on localhost:
export MAVEN_OPTS=-Dplugin.resource.directories=`pwd`/src/main/resources
atlas-run
Make a release:
mvn release:prepare
mvn release:perform