Access Build Information from OSLC
I want to access information regarding the workitems associated with a build from OSLC. I have found the information at this web page : https://jazz.net/wiki/bin/view/Main/RTCAutomationOSLCPrototype which looks helpful but I cannot browse through the OSLC structure to find the starting point for getting this, nor does it work when I paste in an OSLC identifier for the project area into the URL shown below:
If I replace the template below with information about my server then I get a not found error :
URL pattern is:https://someServer:port/jazz/oslc/contexts/{projectAreaId}/automation/services
I have taken the projectAreaId from the information reported by the Work item catalog link here : /ccm/oslc/workitems/catalog which returns :
oslc_disc:details rdf:resource="https://myserver:9443/ccm/process/project-areas/_i777YPCqEd-i17guFPVVOw"
So for the {projetAreaId} I used _i777YPCqEd-i17guFPVVOw from the above.
Can someone please guide me to the OSLC access to the build information starting from the top of the OSLC heirarchy.
Ultimately the customers requirement is to advance a work item through the state lifecycle when it has been associated with a successful build. If anyone has experience of doing that with OSLC then please shout.
If I replace the template below with information about my server then I get a not found error :
URL pattern is:https://someServer:port/jazz/oslc/contexts/{projectAreaId}/automation/services
I have taken the projectAreaId from the information reported by the Work item catalog link here : /ccm/oslc/workitems/catalog which returns :
oslc_disc:details rdf:resource="https://myserver:9443/ccm/process/project-areas/_i777YPCqEd-i17guFPVVOw"
So for the {projetAreaId} I used _i777YPCqEd-i17guFPVVOw from the above.
Can someone please guide me to the OSLC access to the build information starting from the top of the OSLC heirarchy.
Ultimately the customers requirement is to advance a work item through the state lifecycle when it has been associated with a successful build. If anyone has experience of doing that with OSLC then please shout.
5 answers
The <repo>/rootservices resource does not point to the automation support because the OSLC Automation implementation in RTC 3.0 is only a prototype. Also note that the spec isn't finalized, so there may be further changes in the API, some of which may be breaking API changes.
To get the catalog for automation services, use e.g.:
https://jazz.net/jazz/oslc/automation/catalog
This yields, e.g.:
Following the services link:
https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/services.xml
yields:
The plan query link:
https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/plans
yields all plans (i.e. build definitions):
The use of olsc_cm:collref for the results query is a bug. It should be rdf:resource.
Following that link yields the results:
Following the contributions link yields the various contributions to the build (logs, downloads, links, etc):
Unfortunately, there's no way, currently, to determine the work items associated with changes in the build via the OSLC Automation API. The links given are only the links explicitly published as link contributions, not the work item links generated as a side effect of accepting changes.
The only other approach I can see is to use the internal REST interface that supports our web UI.
For example, try:
https://jazz.net/jazz/resource/virtual/build/definitions?_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/definition/_AHLqcIkAEd6RvINWj6hoDw?_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/results?definition=rtc.jcb&_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/resultpresentation/_vp1C4AdqEeCmSNb08EOl6Q?_mediaType=text/json&_prettyPrint=true
These yield JSON, not XML. The _mediaType and _prettyPrint query args are just for debugging.
The result for the last link includes:
There would be one such contribution for every included work item.
Hope this helps. Note that the internal REST interface is internal, so it may too may change at any time. It's been pretty stable since 2.0 though.
To get the catalog for automation services, use e.g.:
https://jazz.net/jazz/oslc/automation/catalog
This yields, e.g.:
...
<dc:title>Rational Team Concert</dc:title>
<oslc_disc:details rdf:resource="https://jazz.net/jazz/process/project-areas/_1w8aQEmJEduIY7C8B09Hyw"/>
<oslc_disc:services rdf:resource="https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/services.xml"/>
<ns1:consumerRegistry rdf:resource="https://jazz.net/jazz/process/project-areas/_1w8aQEmJEduIY7C8B09Hyw/links"/>
</oslc_disc:ServiceProvider>
</oslc_disc:entry>
...
Following the services link:
https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/services.xml
yields:
...
<oslc:service>
<oslc:Service>
<oslc:queryCapability >
<oslc:QueryCapability >
<dc:title>Automation Plan Query</dc:title>
<oslc_auto:label>plansquery</oslc_auto:label>
<oslc:queryBase rdf:resource="https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/plans"/>
<oslc:shape rdf:resource="https://jazz.net/jazz/oslc/automation/shapes/plansquery"/>
</oslc:QueryCapability >
</oslc:queryCapability >
<oslc:queryCapability >
<oslc:QueryCapability >
<dc:title>Automation Result Query</dc:title>
<oslc_auto:label>resultsquery</oslc_auto:label>
<oslc:queryBase rdf:resource="https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/results"/>
<oslc:shape rdf:resource="https://jazz.net/jazz/oslc/automation/shapes/resultsquery"/>
</oslc:QueryCapability >
</oslc:queryCapability >
</oslc:Service>
</oslc:service>
...
The plan query link:
https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/plans
yields all plans (i.e. build definitions):
...
<oslc_auto:plan rdf:resource="https://jazz.net/jazz/oslc/automation/plans/_AHLqcIkAEd6RvINWj6hoDw">
<dc:identifier>_AHLqcIkAEd6RvINWj6hoDw</dc:identifier>
<dc:title>rtc.jcb</dc:title>
<dc:description>
...
</dc:description>
<oslc_auto:results oslc_cm:collref="https://jazz.net/jazz/oslc/contexts/_1w8aQEmJEduIY7C8B09Hyw/automation/results?oslc.where=oslc_auto:plan=%22https://jazz.net/jazz/oslc/automation/plans/_AHLqcIkAEd6RvINWj6hoDw%22"/>
</oslc_auto:plan>
...
The use of olsc_cm:collref for the results query is a bug. It should be rdf:resource.
Following that link yields the results:
...
<oslc_auto:AutomationResult rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q">
<dc:identifier>_pZ804AeZEeCmSNb08EOl6Q</dc:identifier>
<dc:name>RTC-T20101214-0748</dc:name>
<oslc_auto:plan rdf:resource="https://jazz.net/jazz/oslc/automation/plans/_AHLqcIkAEd6RvINWj6hoDw"/>
<dc:creator rdf:resource="https://jazz.net/jazz/oslc/automation/persons/_MUackFu9Edyy979fBgA6Ww"/>
<dc:created>2010-12-14T15:48:51.117Z</dc:created>
<oslc_auto:started>2010-12-14T15:48:53.602Z</oslc_auto:started>
<oslc_auto:ended>2010-12-14T15:48:53.601Z</oslc_auto:ended>
<oslc_auto:reason>MANUAL</oslc_auto:reason>
<oslc_auto:state>IN_PROGRESS</oslc_auto:state>
<oslc_auto:verdict>OK</oslc_auto:verdict>
<oslc_auto:subject/>
<oslc_auto:contributions rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q/contributions"/>
</oslc_auto:AutomationResult>
...
Following the contributions link yields the various contributions to the build (logs, downloads, links, etc):
...
<oslc_auto:LinkContribution rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q/contributions/__9yjUAebEeCmSNb08EOl6Q">
<oslc_auto:result rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q"/>
<dc:title>Build results web page</dc:title>
<rdf:type>rtc_build:BuildResultContribution</rdf:type>
<rtc_build:contributionType>
com.ibm.team.build.common.model.IBuildResultContribution.link
</rtc_build:contributionType>
<dc:url>
http://jazzweb.beaverton.ibm.com/rtc/maint/T/RTC-T20101214-0748/index.html
</dc:url>
</oslc_auto:LinkContribution>
<oslc_auto:LogContribution rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q/contributions/_E_dtcAecEeCmSNb08EOl6Q">
<oslc_auto:result rdf:resource="https://jazz.net/jazz/oslc/automation/results/_pZ804AeZEeCmSNb08EOl6Q"/>
<dc:title>Build suppliers properties file</dc:title>
<rdf:type>rtc_build:BuildResultContribution</rdf:type>
<rtc_build:contributionType>
com.ibm.team.build.common.model.IBuildResultContribution.log
</rtc_build:contributionType>
<oslc_auto:fileName>buildSuppliers.properties</oslc_auto:fileName>
<oslc_auto:fileSize>2183 bytes</oslc_auto:fileSize>
<oslc_auto:mediaType>text/plain</oslc_auto:mediaType>
<oslc_auto:fileContent>
https://jazz.net/jazz/resource/virtual/build/result/_pZ804AeZEeCmSNb08EOl6Q/contribution/_E_dtcAecEeCmSNb08EOl6Q/buildSuppliers.properties
</oslc_auto:fileContent>
</oslc_auto:LogContribution>
...
Unfortunately, there's no way, currently, to determine the work items associated with changes in the build via the OSLC Automation API. The links given are only the links explicitly published as link contributions, not the work item links generated as a side effect of accepting changes.
The only other approach I can see is to use the internal REST interface that supports our web UI.
For example, try:
https://jazz.net/jazz/resource/virtual/build/definitions?_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/definition/_AHLqcIkAEd6RvINWj6hoDw?_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/results?definition=rtc.jcb&_prettyPrint=true
https://jazz.net/jazz/resource/virtual/build/resultpresentation/_vp1C4AdqEeCmSNb08EOl6Q?_mediaType=text/json&_prettyPrint=true
These yield JSON, not XML. The _mediaType and _prettyPrint query args are just for debugging.
The result for the last link includes:
...
"contribution": {
"extendedContributionProperties": [
{
"name": "com.ibm.team.build.common.model.IBuildResultContribution.url",
"value": "https:\/\/jazz.net\/jazz\/resource\/itemName\/com.ibm.team.workitem.WorkItem\/148092"
},
...
],
"extendedContributionTypeId": "com.ibm.team.build.linktype.includedWorkItems",
"internalId": "_l2k7IAehEeCmSNb08EOl6Q",
"label": "Defect 148092: Compile problems in BuildResultBuilder.java"
},
...
There would be one such contribution for every included work item.
Hope this helps. Note that the internal REST interface is internal, so it may too may change at any time. It's been pretty stable since 2.0 though.
Nick,
Thanks very much for the information on the build records from OSLC.
You mention that the list of work items associated with the build as a result of being accepted into the workspace is not available in the build. should that information appear within the 'Contributors' data in the area of :
<oslc_auto>
<oslc_auto>
<dc>
<rdf>rtc_build:BuildResultContribution</rdf>
<rtc_build>fixedWorkItems </rtc_build>
</oslc_auto>
The contributionType of 'Fixed work items' does look like a good candidate to have this information in the future since the link above doesn't really give me a great deal at the present.
Thanks very much for the information on the build records from OSLC.
You mention that the list of work items associated with the build as a result of being accepted into the workspace is not available in the build. should that information appear within the 'Contributors' data in the area of :
<oslc_auto>
<oslc_auto>
<dc>
<rdf>rtc_build:BuildResultContribution</rdf>
<rtc_build>
</oslc_auto>
The contributionType of 'Fixed work items' does look like a good candidate to have this information in the future since the link above doesn't really give me a great deal at the present.
Mark, what you're seeing there is our internal representation of 'included in build' work item references poking through. We include all contributions in the OSLC result, but some are expressed in an RTC-specific way (note that the type here is rtc_build:BuildResultContribution, not an oslc_auto or oslc core type).
The internal representation here is a content blob of work item UUIDs (the OSLC result does not currently surface the link to the content blob for these contributions, just for FileContributions and their subtypes.), but that would not be the best way to surface them in OSLC. It would make more sense to have a contribution type that's specific to OSLC Change Management links, or perhaps use the current LinkContribution type but augmented with extra metadata, such as the content type, so consumers can have a clue that it's a work item / CM link.
The cross-domain linking story still needs a lot of fleshing out in OSLC.
For some earlier discussions, see:
http://open-services.net/bin/view/Main/ScmWorkItemIntegrationStory
http://open-services.net/bin/view/Main/ScmBuildIntegrationStory
The internal representation here is a content blob of work item UUIDs (the OSLC result does not currently surface the link to the content blob for these contributions, just for FileContributions and their subtypes.), but that would not be the best way to surface them in OSLC. It would make more sense to have a contribution type that's specific to OSLC Change Management links, or perhaps use the current LinkContribution type but augmented with extra metadata, such as the content type, so consumers can have a clue that it's a work item / CM link.
The cross-domain linking story still needs a lot of fleshing out in OSLC.
For some earlier discussions, see:
http://open-services.net/bin/view/Main/ScmWorkItemIntegrationStory
http://open-services.net/bin/view/Main/ScmBuildIntegrationStory
Mike, re your question about any updates, there have been no changes since then in our OSLC Automation implementation. You may want to track a related plan item: [CCM] Implement OSLC Automation v2 spec (237822)
Comments
You can use the generateChangeLog Ant task, which can list the change sets and associated work items in a particular build (as well as between two specific builds or snapshots). See the doc for it in the RTC Eclipse client help. You'd still need to list builds using OSLC Automation. Another possibility is to do it all using the Java client API, or a scripting layer on top of that, e.g. I've used JRuby in the past to do this kind of thing.
Mike, were you able to get it going using the fixed query in #274594?
Nm, I see that you did. Good to hear.