Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Does FishEye have the equivalent functionality of a pre-commit hook and commit acceptance plugin?

We've been usig a pre-commit hook and the JIRA commit acceptance plugin for many years. We're now using FishEye and I'm looking for equivalent functionality. We're planning to upgrade JIRA beyond the supported version of the commit acceptance plugin.

We require our developers to reference a valid JIRA key before commiting to any of our subversion repositories. Does this functionality exist in FishEye?

thanks.

2 answers

Commit Policy Plugin is a new, maintained JIRA add-on to replace the Commit Acceptance Plugin. 

It does everything the old plugin did, and a lot more by utilizing modern JIRA features like JQL, drop-in installation and the REST API. And, most importantly, it is updated for new JIRA versions.

Documentation: http://www.midori-global.com/products/jira-commit-policy-plugin/documentation/

Well since FishEye is not a repository but a repository viewer the answer would be no.  You don't commit anything to fisheye so there's no "action" available to hook onto.

This should be on your repository.  SVN has pre and post commit hooks for this purpose.  If you have access to your svn environment you can look in the hooks directory and you'll find template hooks there that you can use to edit for this purpose and save them as .sh (unix) or .bat/.cmd (windows) in order to enable them.

We have a number of hooks that do this.  Simple ones just parse the comments for strings that resemble (but don't validate) valid issue numbers.  For example:

-------------------------------------------------------------------------

@echo off

setlocal

set REPOS=%1

set TXN=%2

svnlook dirs-changed %REPOS% -t %TXN% | findstr /b "[Dd]oc">nul

if %errorlevel% gtr 0 (goto wxyz) else exit 0

:wxyz

svnlook log %REPOS% -t %TXN% | findstr /R /i "WXYZ-[0-9][0-9][0-9][0-9]" >nul

if %errorlevel% gtr 0 (goto abc) else exit 0

:abc

svnlook log %REPOS% -t %TXN% | findstr /R /i "ABC-[0-9][0-9][0-9]">nul

if %errorlevel% gtr 0 (goto err) else exit 0

:err

echo                 - YOUR COMMIT WAS DECLINED - 1>&2

echo Please add a Jira issue number to your comment before you commit. 1>&2

echo Format Jira numbers like "WXYZ-1234", "wxyz-1234", or "ABC-1234 abc-1244". 1>&2

echo Separate with spaces if you have more than one to enter. 1>&2

echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1>&2

exit 1

---------------------------------------------------------

Again, these have nothing to do with Fisheye.  They are strictly SVN.  You can refer to the Red Beans book (http://svnbook.red-bean.com/) for more information on SVN hooks.

There are ways to validate against JIRA id's and we are using them but I don't have access to the source code for those.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

549 views 15 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you