It's all about the answers!

Ask a question

Jenkins Team Concert Plugin - returning logs to RTC


Zoe Slattery (4011720) | asked May 28 '14, 10:28 a.m.
We are using the Team Concert plugin Version 1.0.12, RTC Build Toolkit 4.0.3, RTC server 4.0.6.

We've observed that after running a Jenkins job that is is initiated from RTC, the log is available as a link in the RTC build result. If a job is initiated by Jenkins polling the SCM the log is not available from RTC. I'd like to have the logs available in RTC and was considering what the best options for doing this were. It looks as though part of the answer might be here https://jazz.net/forum/questions/62642/add-log-to-build-result using the Java API. As we already use this (to get work items that were changed in the build), this would probably be the easiest way for us.

Before going to much further - I wondered if there was a reason why the logs are not added automatically? Have I missed something and it's much more difficult than I think?



Comments
sam detweiler commented May 28 '14, 10:47 a.m. | edited May 28 '14, 10:48 a.m.

I don't know for sure, but I think its an indication of who's in charge.. RTC or agent requested build  

I've written an extension for Jenkins and I know I check to see if a build result was created already,  if not my extension exits.


Zoe Slattery commented May 28 '14, 12:08 p.m.

I think the build result is created whatever happens. It is visible in RTC, it just has no log attached to it.  (See screen shot below)


The result is accessible from Jenkins, so I'm still not sure of the logic of not linking the log to it.



sam detweiler commented May 28 '14, 12:15 p.m.

understand..  at the time the build job starts in Jenkins the buildresult record is not yet created.


Zoe Slattery commented May 28 '14, 12:25 p.m.

 So, are you saying that if the build is initiated by RTC a result record is created at the point when the build is requested, but that if it is initiated by Jenkins the build result is created some (indeterminate?) time later? And, not knowing when it will be created it is hard to attach a log to it?


sam detweiler commented May 28 '14, 12:41 p.m.

effectively, yes.. I don't know exactly when in the job timeline the build result record is created..

and I think it is ONLY created if there is an RTC build definition connected to the Jenkins job.  at least that is how it behaves here on my dev system.


Zoe Slattery commented May 28 '14, 12:45 p.m.

OK - that is helpful thanks. We do always have a build definition attached to the job. I will experiment a bit tomorrow (time permitting). I think if I ran some Java as a post build step I should be able to get the build result and attach something to it.  

showing 5 of 6 show 1 more comments

One answer



permanent link
Heather Fraser-Dube (4512) | answered Jun 04 '14, 8:48 a.m.
JAZZ DEVELOPER
The Jenkins plugin deliberately does not to attach the full Jenkins log to the build result. Instead it publishes a link to the log. The log can be quite large and it takes time to upload (plus takes space) to RTC. Instead it can be accessed from the link. 

The other reason is timing. We can publish the link to the RTC build result when the build starts. Then you can open the link and see the info being written to the log as the build progresses. We think this is a really nice feature of Jenkins (seeing the log during the build) especially with long running builds where you want to see the progress. If we published the log in the build, it can't be done until the build completes.

If you really really want the full log in the build result, I suggest opening an enhancement request. The plugin could have an option for that. It would sense that the plugin do it as part of the termination of the build (when all the log contents have been finalized). 

Comments
Zoe Slattery commented Jun 04 '14, 1:04 p.m.

Hi Heather, thanks so much for the response. I think perhaps I have failed to explain what I am asking properly. I hope the following is clearer. 


There are two screen shots below, both are from an Eclipse view of the same build, the first was initiated by Jenkins polling the SCM, the second was initiated by me requesting a build from RTC. As you can see, the second has a link to a log, the first one doesn't. I would have expected both to have the log link, am I being utterly stupid about something?
SCM Poll initiated

  RTC Initiated build


sam detweiler commented Jun 04 '14, 1:26 p.m.

Zoe, I think Heather answered. It was intentional to use the link only in that case, to leverage the ability to see the active build log that Jenkins provides.


And they chose not to bring the final log file to the build result to replace the link.

Your answer


Register or to post your answer.