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

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

Greg Warner February 12, 2014

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

1 vote
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2015

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/

0 votes
Gretchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2014

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
AUG Leaders

Atlassian Community Events