Bug 1015084

Summary: Invalid content specs with Bug Links = JIRA
Product: [Community] PressGang CCMS Reporter: Petr Penicka <ppenicka>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: lnewson, mcaspers
Target Milestone: ---   
Target Release: 1.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 23:45:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Maven Repository in JSON output none

Description Petr Penicka 2013-10-03 12:36:15 UTC
When I tried to push content spec 22448, I got the following error both in the web UI and in CLI csprocessor:

  Starting to parse...
  Saving to the server...
  ERROR: Failed to validate the Bug Links due to an unknown error. Please ensure 
  that the server url is correct and if the problem persists please file a bug.
  ERROR: The Content Specification is not valid.

This happened even with revisions that were previously valid (e.g. rev 540384).

The same issue is encountered also in other content specs that use JIRA bug links.

As a temporary workaround, I disabled bug links using "Bug Links = OFF" and the validation passes, but this is not a long term solution.

Comment 1 Petr Penicka 2013-10-03 12:36:58 UTC
To provide complete info:

CSProcessor client version: 1.0.4

Comment 2 Matthew Casperson 2013-10-03 20:16:28 UTC
The JIRAProject should be WFK2. I have made the changes and the spec now saves.

Comment 4 Matthew Casperson 2013-10-03 20:19:55 UTC
Note that with the Project set to WFK2, the validation checks incorrectly mark "Maven Repository" as an invalid component.

Comment 5 Matthew Casperson 2013-10-03 20:20:26 UTC
Created attachment 807276 [details]
Maven Repository in JSON output

Comment 7 Matthew Casperson 2013-10-03 21:06:13 UTC
The following settings trigger an NPE:

Bug Links = Jira
#JIRAServer = https://issues.jboss.org/
JIRAProject = WFK2
JIRAComponent = Maven Repository
JIRAVersion = 2.4.0.GA

Comment 9 Lee Newson 2013-10-03 23:55:26 UTC
Okay adding more details since I've had a chance to look into this. The project that you had Petr is fine and shouldn't have had to have been "WFK2".

The core reason that any of this occurred is because the JBoss JIRA server was recently upgraded and added some new fields to the JSON response. This in turn was causing the error Matt mentioned about the "UnrecognizedPropertyException".

As such I've added the new fields and as I mentioned in my previous comment (although it was private), this has been fixed properly in 1.2-SNAPSHOT. The NPE has also been fixed in that version as well.

In the mean time though, you'll continue to see the warnings about the component/version not existing and you'll need to use the project "key" instead of name until we can apply a hot fix to the server. However this should not stop the docbuilder or building locally from working.

Comment 10 Lee Newson 2013-10-09 04:55:27 UTC
This version is currently live on the dev server, so moving to ON_QA.

Comment 11 Petr Penicka 2013-10-14 12:12:25 UTC
Am I supposed or able to test this somehow? If so, please provide some instructions and I can do it. 

I just briefly tried to on the production server and the issue persists. I also tried to switch to the test server in csprocessor.ini and create a new book with the JIRA links defined in its content spec (CS22437), but the same error appears there too.

Comment 12 Lee Newson 2013-10-14 23:15:55 UTC
Sorry Petr, this was mainly meant for us since we will be doing testing this week. Once we've done our tests I'll add some details on how to test it.

Comment 13 Matthew Casperson 2013-10-14 23:55:47 UTC
Testing content spec 13968 on the dev server with:

Bug Links = JIRA
JIRAServer = https://issues.jboss.org/
JIRAProject = RichFaces

results in: 

ERROR: Failed to validate the Bug Links due to an unknown error. Please ensure that the server url is correct and if the problem persists please file a bug.
ERROR: The Content Specification is not valid.

Comment 14 Matthew Casperson 2013-10-14 23:57:29 UTC
You can see the above error in revision 522537 of content spec 13968 on the dev server.

Comment 17 Lee Newson 2013-10-16 02:01:44 UTC
Fixed in 1.2-SNAPSHOT build 201310160934

I've updated the server so that it doesn't do a scan to find all the interceptors/providers and instead they are now just manually being defined. This means that the Zanata ApiKeyHeaderDecorator won't be included in all requests and only the ones where the ZanataProxyFactory is used.

Comment 18 Matthew Casperson 2013-10-16 03:14:22 UTC
Confirmed that setting invalid settings for the JIRA project, component and version displays an appropriate warning in the UI and an error from the csprocessor.

Minor issue is that there is some white space added to the output when invalid JIRA settings are used:

[mcasperson@localhost bin]$ csprocessor preview 13968
CSProcessor client version: 1.2-SNAPSHOT, Build 20131016-1033
Loading configuration from /home/mcasperson/.config/csprocessor.ini
Connecting to PressGang server: http://skynet-dev.usersys.redhat.com:8080/pressgang-ccms/rest

Starting to validate...
Attempting to download all the latest topics...
Starting first validation pass...
Starting second validation pass...
Starting bug link validation pass...




















ERROR: No JIRA Project exists for project "RichFacesbad".
ERROR: The Content Specification is not valid.

Comment 19 Lee Newson 2013-10-16 04:21:17 UTC
Fixed in 1.2-SNAPSHOT build 201310161416

This was caused by an exception trying to do e.printStackTrace() instead of using a logger, as such I've updated it to use the logger as it should have.

Comment 21 Matthew Casperson 2013-10-16 05:35:49 UTC
Output is now fixed when invalid JIRA details are entered.