[Development] Git commit hook keywords

mark.keir at nokia.com mark.keir at nokia.com
Mon Sep 17 03:46:48 CEST 2012


Here is an explanation of how the source linkage in JIRA works.

The way that JIRA sees an issue being linked to a Git commit is via a plugin that talks to a Fisheye server.  You can see the list of repositories that are followed by Fisheye through the main interface of the Fisheye server, https://bugdiffs.qt-project.org/fisheye/browse.
The Fisheye server is configured to look for changes by repository on the Git server the code comes from.  These days, most of the git repos are on Gerrit.  As explained in https://bugreports.qt-project.org/browse/QTQAINFRA-440, if new repositories are to be tracked by Fisheye, allowing the links to appear in JIRA, someone needs to be aware of the requirement to add the new repos for Fisheye tracking and process the request.
As far as how this works, the linking by the plugin to JIRA happens by matching the string for the JIRA issue ID (eg QTBUG-XXXX) to any field in the git commit message.  It is not triggered by a keyword structure.  The branch that is associated with a change (if submitted to multiple branches) is an association created by an indexing system which picks the first entry seen so it may not always be definitive.  As far as I understand the working of the system, JIRA/Fisheye will only see a new commit as available for association once it goes into the "merged" state in Gerrit.

BR
Mark

-----Original Message-----
From: development-bounces+mark.keir=nokia.com at qt-project.org [mailto:development-bounces+mark.keir=nokia.com at qt-project.org] On Behalf Of ext Sergio Ahumada
Sent: Sunday, September 16, 2012 4:35 PM
To: development at qt-project.org
Subject: Re: [Development] Git commit hook keywords

Hi,

On 09/16/2012 01:34 AM, Giuseppe D'Angelo wrote:
> On 16 September 2012 00:09,  <simon.hausmann at nokia.com> wrote:
>> Is there an actual hook that triggers when somebody uses Task-number: QTBUG-1234 in a commit message? I am under the impression that at this point it is merely a convention that could be hooked up with Jira in the future.
>
> I think *something* happens. For instance:
>
> https://bugreports.qt-project.org/browse/QTBUG-23352?page=com.atlassia
> n.jira.plugin.system.issuetabpanels:all-tabpanel
>
> lists the commits that contained the right Task-number word. But I 
> have no idea about who or what is picking up those commit ids and 
> putting them into the JIRA task.
>

If you click "Source" (you need to be logged in) you'll see the SHA1 and repo associated to that Task-number: QTBUG-23352

I think who does that is a tool called FishEye http://www.atlassian.com/FishEye

https://bugreports.qt-project.org/browse/QTBUG-23352?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel

I wanted to implement a git server hook that posts a comment on JIRA when:

- a change is pushed to Gerrit with a Task-number:
- a change gets merged to Gerrit and contains a Task-number:

https://github.com/hobbs/jirret

Cheers,
--
Sergio Ahumada Navea
san at sansano.inf.utfsm.cl
_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list