Gerrit - Jira - plugin

1,859 views
Skip to first unread message

kongf...@gmail.com

unread,
Aug 27, 2013, 5:03:55 PM8/27/13
to repo-d...@googlegroups.com
I was not sure where to get help but was hoping someone else has used it.

We are using Jira 5.2.7, and installed the latest plugin, and using gerrit 2.6.1

I configured it with the hostname, port, ssh key, and username, and when I hit the tab for Gerrit Review, I always see the following:


There are no open Gerrit changes for this issue.


I created the Jira account on Gerrit as non-interactive, not sure if that would be an issue, but was able to do a git clone on the box that Jira is running.

If anyone can point me into troubleshooting or what am I missing

Thanks

Luca Milanesio

unread,
Aug 28, 2013, 2:33:42 AM8/28/13
to kongf...@gmail.com, repo-d...@googlegroups.com
I'm the author of the Gerrit Jira plugin (the one that you install on Gerrit, aka hooks-jira) but I guess you are talking about the Jira's Gerrit plug-in (the one you install on Jira) ?

Luca

---------
Sent from my iPhone
Luca Milanesio
Skype: lucamilanesio

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Luca Milanesio

unread,
Aug 28, 2013, 3:25:13 AM8/28/13
to repo-discuss@googlegroups.com Discussion, kongf...@gmail.com
Ping ?

Mike Franon

unread,
Aug 28, 2013, 9:06:02 AM8/28/13
to Luca Milanesio, repo-d...@googlegroups.com
Hi Luca,

Thanks for getting back to me!  I appreciate it.  

This is the one I installed:


Is this the one you are referring to?



If that is not the one which one is yours is it different?




Luca Milanesio

unread,
Aug 28, 2013, 9:14:25 AM8/28/13
to Mike Franon, repo-d...@googlegroups.com
Hi Mike,
the one you mention is a commercial Jira plugin made by by MeetMe, Inc. you should probably contact them.

Kind Regards.

Luca.

Luca Milanesio

unread,
Aug 28, 2013, 9:31:59 AM8/28/13
to Mike Franon, repo-d...@googlegroups.com
Hi Mike,

Once plugin is built, just move it to the $GERRIT_SITE/plugins directory and run gerrit init again.
The plugin introduces a new init step for configuring the connection with Jira: connectivity is checked as well to make sure that everything is working fine.

Hope this helps.

Luca.

On 28 Aug 2013, at 14:24, Mike Franon <kongf...@gmail.com> wrote:



Hi Luca,

I would not mind trying yours.

Is this it?





I am trying to find a readme or documentation on how it works, and how to install, do you have a link to that?  I did not see a readme when I cloned it.

Thanks

Mike Franon

unread,
Aug 28, 2013, 9:24:28 AM8/28/13
to Luca Milanesio, repo-d...@googlegroups.com


Hi Luca,

I would not mind trying yours.

Is this it?





I am trying to find a readme or documentation on how it works, and how to install, do you have a link to that?  I did not see a readme when I cloned it.

Thanks

Mike Franon

unread,
Aug 28, 2013, 9:43:22 AM8/28/13
to Luca Milanesio, repo-d...@googlegroups.com
Great thanks for help appreciated!!

anil tiwari

unread,
Aug 29, 2013, 2:18:12 AM8/29/13
to Luca Milanesio, Mike Franon, repo-d...@googlegroups.com
Hi Luca,
           Is gerrit init is mandatory to run or is this just to make sure proper connectivity with jira,

Thanks,
Anil

Luca Milanesio

unread,
Aug 29, 2013, 2:30:06 AM8/29/13
to anil tiwari, Mike Franon, repo-d...@googlegroups.com
Init is optional and is used to help you putting in place the correct params in gerrit.config.

HTH

---------
Sent from my iPhone
Luca Milanesio
Skype: lucamilanesio

anil tiwari

unread,
Aug 29, 2013, 8:32:19 PM8/29/13
to Luca Milanesio, Mike Franon, repo-d...@googlegroups.com
Hi Luca,
            I installed plugin and did gerrit init. During init I tested for connectivity and it says "Checking Jira connectivity ... [OK]" but when I push the commit it says
"Issue XXX not found or visible in Jira Issue-Tracker". tomcat log is showing below error
[2013-08-29 16:44:00,831] WARN  com.googlesource.gerrit.plugins.hooks.validation.ItsValidateComment : Unexpected error accessint ITS
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: com.atlassian.jira.rpc.exception.RemoteAuthenticationException: User not authenticated yet, or session timed out.
 faultActor:
 faultNode:
 faultDetail:
    {}com.atlassian.jira.rpc.exception.RemoteAuthenticationException:null
    {http://xml.apache.org/axis/}hostname:us02gerrit01p

com.atlassian.jira.rpc.exception.RemoteAuthenticationException: User not authenticated yet, or session timed out.

[2013-08-29 16:44:00,249] DEBUG org.apache.axis.client.Call : operation=name:        getIssue
returnQName: getIssueReturn
returnType:  {http://beans.soap.rpc.jira.atlassian.com}RemoteIssue
returnClass: class com.atlassian.jira.rpc.soap.client.RemoteIssue
elementQName:null
soapAction:  null
style:       rpc
use:         encoded
numInParams: 2
method:null
 ParameterDesc[0]:
  name:       in0
  typeEntry:  null
  mode:       IN
  position:   0
  isReturn:   false
  typeQName:  {http://www.w3.org/2001/XMLSchema}string
  javaType:   class java.lang.String
  inHeader:   false
  outHeader:  false

 ParameterDesc[1]:
  name:       in1
  typeEntry:  null
  mode:       IN
  position:   1
  isReturn:   false
  typeQName:  {http://www.w3.org/2001/XMLSchema}string
  javaType:   class java.lang.String
  inHeader:   false
  outHeader:  false

 FaultDesc[0]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemotePermissionException
  Class: com.atlassian.jira.rpc.soap.client.RemotePermissionException

 FaultDesc[1]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemoteAuthenticationException
  Class: com.atlassian.jira.rpc.soap.client.RemoteAuthenticationException

 FaultDesc[2]:
  name: null
  qname: {http://localhost:8090/jira/rpc/soap/jirasoapservice-v2}fault
  type: {http://exception.rpc.jira.atlassian.com}RemoteException
  Class: com.atlassian.jira.rpc.soap.client.RemoteException


[2013-08-29 16:44:00,249] DEBUG org.apache.axis.client.Call : operation.getNumParams()=2
[2013-08-29 16:44:00,249] DEBUG org.apache.axis.client.Call : getParamList number of params: 2
[2013-08-29 16:44:00,250] DEBUG org.apache.axis.client.Call : Enter: Call::invoke(RPCElement)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.SOAPPart : Enter: SOAPPart ctor(FORM_SOAPENVELOPE)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.i18n.ProjectResourceBundle : org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.SOAPPart : Setting current message form to: FORM_SOAPENVELOPE (currentMessage is now org.apache.axis.message.SOAPEnvelope)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.SOAPPart : Exit: SOAPPart ctor()
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.i18n.ProjectResourceBundle : org.apache.axis.i18n.resource::handleGetObject(addBody00)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.message.SOAPBody : Adding body element to message...
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.client.Call : Enter: Call::invoke()
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.MessageContext : MessageContext: setTargetService(jirasoapservice-v2)
[2013-08-29 16:44:00,251] DEBUG org.apache.axis.i18n.ProjectResourceBundle : org.apache.axis.i18n.resource::handleGetObject(noService10)
[2013-08-29 16:44:00,252] DEBUG org.apache.axis.ConfigurationException : Exception:
org.apache.axis.ConfigurationException: No service named jirasoapservice-v2 is available
org.apache.axis.ConfigurationException: No service named jirasoapservice-v2 is available
    at org.apache.axis.configuration.FileProvider.getService(FileProvider.java:233)
    at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
    at org.apache.axis.MessageContext.setTargetService(MessageContext.java:755)



I am able to login successfully with the same userid and password in jira but thats not working when I configure the same for hooks-jira plugin.

I was wondering if I need to install jira-rpc plugin and enable "Accept remote API calls" at Jira side to make hooks-jira work ?

Thanks,
Anil

Luca Milanesio

unread,
Aug 30, 2013, 2:10:55 AM8/30/13
to anil tiwari, Mike Franon, repo-d...@googlegroups.com
You need to allow SOAP API execution.

The check during Gerrit init does only connectivity and login but does invoke any Issue Tracker API.

HTH

---------
Sent from my iPhone
Luca Milanesio
Skype: lucamilanesio

anil tiwari

unread,
Aug 30, 2013, 2:16:23 AM8/30/13
to Luca Milanesio, Mike Franon, repo-d...@googlegroups.com
Hi Luca,
           Thanks for reply. I debugged the plugin code and I found that when plugin executes getIssue() then it throws exception. How to allow SOAP API execution, do I need to configure something in JIRA side ?

Thanks,
Anil

Luca Milanesio

unread,
Aug 30, 2013, 5:54:39 AM8/30/13
to anil tiwari, Mike Franon, repo-d...@googlegroups.com
Yes, there is a settings on your Jira configuration to allow execution of SOAP APIs.
Possibly the user you are currently using, is valid but not allowed to use the SOAP APIs.

HTH

Luca.

anil tiwari

unread,
Aug 30, 2013, 5:35:56 PM8/30/13
to Luca Milanesio, Mike Franon, repo-d...@googlegroups.com

Hi Luca,
           As per my knowledge below  2 setting is required -
1. In system settings "Accept remote API calls" should be  ON. (myjira.com/rpc/soap/jirasoapservice-v2 shows that RPC is enabled).
2. If a user can perform that action using jira UI, that user can also perform same action through SOAP RPC call.

I know this is not hooks-jira plugin problem, something is missing in Jira side.

Thanks,
Anil

Joe Hansche

unread,
Sep 12, 2013, 11:00:35 AM9/12/13
to repo-d...@googlegroups.com, Luca Milanesio
Mike,

I'm the author of the MeetMe JIRA plugin. The problem you are describing is caused by not having a proper search predicate configured for the plugin in JIRA.  Take a look at https://github.com/MeetMe/jira-gerrit-plugin#getting-started for more information.

The easy way to test your search predicate is by performing the search in the Gerrit web UI's search box at the top-right.  If nothing is returned there, then the plugin also cannot display anything.  E.g., if you use "message:JIRA-123" in the gerrit search and you get nothing back (or you get only opened/unmerged reviews), then that is exactly what the plugin will also get back and display -- there is no way for the JIRA plugin to magically get results that you would not otherwise get from the web UI's search function.

Most cases of this can be explained by reading through this Github issue: <https://github.com/MeetMe/jira-gerrit-plugin/issues/3>. This also has a couple workarounds you can use to get around the issues.  Since it is an issue with not having a fast index to query your changes, there's nothing that the JIRA plugin can do to make that better.  You will need to change the way your gerrit reviews are indexed in order for this to work properly and return results quickly.

As I explain in that issue #3, the way that we handle this in-house is by using a patchset-created hook to scan each review's commit message for what looks like a JIRA issue, and manually insert/delete records in the tracking_ids table.  That allows us to use the "tr:%s" search predicate, which is indexed in Gerrit and returns very fast (and also shows abandoned and merged changes).  If you cannot use a hook to manually modify the database, you will instead need to use the tracking_ids configuration, and all commit messages will require a "Bug: JIRA-123" (example) footer.  Using the footer, the built-in Gerrit tracking_ids configuration will automatically manage the tracking_ids table for you, and then the "tr:%s" predicate will work as expected.  In our shop, however, we didn't want to force all commits to have the JIRA footer (because most developers here commit one-line commit messages, and only reference the JIRA issues in the summary line of the commit message), which is why we had to use a hook to manage the table ourselves.

Hope that helps.
Joe
Reply all
Reply to author
Forward
0 new messages