Writing a new Build Engine...
Andrew Harmel-Law (146●1●22●18)
| asked Sep 27 '09, 7:06 a.m.
retagged May 15 '13, 8:09 a.m. by Morten Madsen (305●32●50)
Hi there,
I'm looking into writing my own build engine. I have a few questions I hope someone can help me with. They are as follows: 1. I can get my engine to see when a build has been requested and whether it is a scheduled or a personal one. What I want to do however is load the correct workspace if its a personal request. Can I obtain this information from the BuildRequest and if so how? 2. I want to be able to create a change log file from any changes in a build. I can see the change handles (ChangeSetInfo) but I would like to get the actual change details from these. I'm guessing it's not hard, but I can't see how. That's it for now. I hope someone can help. Thanks in advance. Cheers, Andrew |
11 answers
Hi Andrew,
Could you clarify why you want to write your own build engine? Note that JBE is extensible, so you could add your own pre-build/build/post-build participants instead, which could save you a lot of work. Can you describe what you're trying to do at a higher level? But to answer your questions: 1. What I want to do however is load the correct workspace if its a personal request. Can I obtain this information from the BuildRequest and if so how? The corresponding code in JBE is in com.ibm.team.build.internal.engine.JazzScmPreBuildParticipant. To get the workspace item id, it does:
Where getBuildRequest() is the IBuildRequest for the requested build, given in the participant's initializer. IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID is: public static final String PROPERTY_WORKSPACE_UUID = "team.scm.workspaceUUID"; 2. I can see the change handles (ChangeSetInfo) but I would like to get the actual change details from these. What kind of details do you want? The structure of the change set, the associated work item(s), or both? For getting the associated work items, take a look at the code for com.ibm.team.build.internal.publishing.WorkItemPublisher.publish(IBuildResultHandle, IWorkItemHandle[], ITeamRepository), and its getWorkItemHandles method. The latter does:
Where ChangeSetLinks is helper API in SCM: com.ibm.team.scm.common.links.ChangeSetLinks. You could also use:
Regards, Nick |
Hi Nick, thanks for your very detailed answer
Hi Andrew, Its partially a personal exercise, and partially driven by necessity. I want to use Hudson as my build engine on a project. This is due to the complexity of the architecture - we'll need to build java, msft and PL/SQl code, run all kinds of static analysis tools, and deploy and test across a VM environment. Hudson has support for all this out of the box. What Hudson doesn't (yet) have is support for Jazz. I want to solve that.
What I want to do however is load the correct workspace if its a personal request. Can I obtain this information from the BuildRequest and if so how? The corresponding code in JBE is in com.ibm.team.build.internal.engine.JazzScmPreBuildParticipant. To get the workspace item id, it does:
Where getBuildRequest() is the IBuildRequest for the requested build, given in the participant's initializer. IJazzScmConfigurationElement.PROPERTY_WORKSPACE_UUID is: public static final String PROPERTY_WORKSPACE_UUID = "team.scm.workspaceUUID"; Thanks. That makes sense. I'll give it a try.
I can see the change handles (ChangeSetInfo) but I would like to get the actual change details from these. What kind of details do you want? The structure of the change set, the associated work item(s), or both? Its both I'm looking for I think. To fully implement a Hudson SCM plugin I will need to get a hold of the full change set details and parse them so Hudson can get to grips with them. Thanks again for this. I think this will help me get a handle on what I need. The hard part then will be translating it for Hudson.
Thankyou very much for all this help. I'll post how I get on to this thread for the benefit of others. Cheers, Andrew |
Andrew, note that for integration with Hudson, you can do the workspace accept and fetch (aka load) phases using the Ant tasks in our Build Toolkit, as well as contribute compilation and test results, downloads, logs, etc. back to the RTC build definition as is normally done.
We have an article coming out shortly showing exactly how to do this (using Hudson). But it sounds like you're aiming for an even tighter integration with Hudson, at least for the SCM portion of the build. I'm definitely interested in this, so please let me know how it goes. We also want to provide this kind of support for Maven. See 90042: Maven SCM plugin extension for RTC. |
To clarify further, there are also Ant tasks for kicking off the RTC build (i.e. issuing the build request and completing it), to enable the build to be orchestrated by some other build system like Hudson. The article shows how to do this. For more on the Ant toolkit tasks, see:
https://jazz.net/wiki/bin/view/Main/BuildFAQ#BuildSystemToolkitContents |
Hi Nick,
I'd originally looked at the ANT API but wanted to keep the control from the Jazz server end (I and my team are bigs fans of personal builds) so I realised I needed something more. Like you say, "even tighter integration". Its looking like I'll need to write both a Hudson and a Build Template plugin to really achieve this but that's not a problem - its fun. However, I've see the link you sent me which is great. I'll definately set this up in the interim (I don't want to bet my project on my as-yet not really tested Hudson plugin code.) Andrew, note that for integration with Hudson, you can do the workspace accept and fetch (aka load) phases using the Ant tasks in our Build Toolkit, as well as contribute compilation and test results, downloads, logs, etc. back to the RTC build definition as is normally done. I'll check out the Maven link. It sounds very interesting. I'd like to be able to do this too and that was going to be one of my next ports of call (as well as a Netbeans plugin and a SCM client similar to Tortoise - so our BAs and PM's can check in and out withut having to face the complexity "hell" of a developer IDE.) Actually, if you know of anything in these spaces let me know as I'd ben keen to contribute. Thanks again. Regs, Andrew |
I'm not aware of any work on either a Netbeans integration or a Tortoise-like non-IDE client for Jazz SCM, but you should check out the work on making certain non-developer scenarios accessible via the web UI (planned for 2.0.0.2).
See: 87245: simple web ui for modifying streams / WES for streams and also 87338: SCM Web UI post 2.0 work and investigation and 87336: SCM Web UI post 2.0 - better integration with Build web ui? and its related items. The SCM command line is also an option. Regards, Nick |
That (a simple Web UI) would be excellent. We have 3 BA's on this project who want to keep their UML models in Jazz SCM and I currently have to teach them how to use the Eclipse Client - it feels like overkill for their requirements. A simple Web UI for this would be ideal.
Perhaps its only the Netbeans plugin I'll have to work on... Regs, Andrew I'm not aware of any work on either a Netbeans integration or a Tortoise-like non-IDE client for Jazz SCM, but you should check out the work on making certain non-developer scenarios accessible via the web UI (planned for 2.0.0.2). |
We have an article coming out shortly showing exactly how to do this (using Hudson).It would be very nice if you could e-mail/publish a draft of this article. We are investigating this as well and this would be very helpful information! |
Hi Peter,
I'll hopefully have my 0.1 hudson plugin ready soon and hopefully the code will follow shortly after. If you'd ilke to help me with the development / testing of this let me know as any niput would be gratefully recieved. We have an article coming out shortly showing exactly how to do this (using Hudson).It would be very nice if you could e-mail/publish a draft of this article. We are investigating this as well and this would be very helpful information! Cheers, Andrew |
The article on integrating between Hudson and RTC Build is now published at http://jazz.net/library/article/350
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.