I'm interested in this too, specifically how to enforce that stash commits/pull requests contain a valid jira issue number and the validation of issue state when committing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Meant to add, everything I've found so far suggests that local repostitory commits in git cannot validate the jira issue number, although the git pre-commit hooks could be used to enforce (through pattern matching) that an issue number is in the commit message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Helen,
It depends on what level of validation you want/need to support. There are few options. As you mentioned you can validate the message at the local/commit level:
http://stackoverflow.com/questions/1501853/jira-code-validation-commit-hook-for-git
The first example, while a little hard-coded, basically checks the message format. While being a little naive, this can be surprisingly effective. Somewhat similar to the other responses you could also write a script to ping a known JIRA and check the existance of the JIRA issue and fail if it can't be found. The problem with this is that every commit will take a few seconds, which might get annoying.
Finally, just for completeness, you can also enforce the commit message on the Stash side:
https://bitbucket.org/cofarrell/stash-enforce-message-hook-plugin
I wouldn't actually recommend this. Sure, ideally the server would enforce this for you, but the realities of DVCS are that you can't really control content in the same way that you might for SVN. A push containing 100 news commits is going to be a nightmare to rewrite if one of those commits is missing a JIRA key. Depending on your workflow you might enforce that everyone has to create a Pull Request instead of pushing to master and that the branch has to contain a JIRA keys.
The first suggestion, enforcing at the local commit level, is what I would suggest to start with. The biggest hurdle with ths approach is distributing/managing the hooks across your organisation and users.
Regarding validation of issue state, this might be of interest too:
https://marketplace.atlassian.com/plugins/com.hindsighttesting.story-flow-plugin
I hope some of that helps.
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Graeme, this is Jay at Atlassian. In order to answer your question I'd like to know a little bit more about how your team is working - just sent you a note.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.