How can I get GitHub Enterprise commit info from the oslc_cm:tracksChangeSet link programatically?
Using RTC 6.0.1, I've setup the integration to GitHub Enterprise and see that I can create oslc_cm:tracksChangeSet links on the work item after a push to my GitHub Enterprise. This all works great. From RTC Web, I can hover over this link in the work item, and get the UI dialog that shows me information about the commit, the comment, the repo, etc. This works great. However, to be useful in an Enterprise setup, I need to create some automation that processes this link. In my case, a simple custom Advisor is trying to grab this info and use it to control process.
Here is an example of the oslc_cm:tracksChangeSet link from my setup (I've x'ed out the hostname). This work item only has one commit linked to it:
"oslc_cm:tracksChangeSet": [
{
"dcterms:title": "A test comment: workitem 13",
"rdf:resource": "https://xxxxxxxxxxxxx:9443/ccm/com.ibm.team.git.internal.resources.IGitResourceRestService/commit?value=H4sIAAAAAAAAAI2QzW7CMBCE7zyFlXOD_7HjE30Hjr74Zw0WhETEERJV372xKiP11r3t6NuZ0X7t0DZd6AzqPlGBpaAwjSPci0HP6XHNBUZEeffxy8XKMUJVT0RP1YkejOCG6201hDQKKhU93G7unKfjuuyzH_ebbwOuFVCSS8c0F5RoIVj0SSudooaBMBYYa_D9j1tTl6oOjktIEILS-iC9HARwCNFHx3hIoAdPHYvxbbXWo0sp82Istvicy2X1rZzF7xCLnyn2bp6h5Bc8LK4_ycXifwfuvn8A-067a1oBAAA."
}
]
If I do a GET of the rdf:resource, I get a 200 back, but no content. I was hoping to get a nice formatted JSON string of what I see in the hover dialog from the Web.
If I paste in this link into my browser, I get redirected to the GitHub repo and can see the entire commit nicely, with a diff, etc. But, I need just a few pieces of this info out of this commit data for my processing. From the workitem context, I don't know the GitHub Enterprise repo or the commit's SHA1 value. I suspect this is encoded in the stuff that is after the value= above.
Can I ask the service: com.ibm.team.git.internal.resources.IGitResourceRestService to return some simple commit data for me? This would make my life so much easier.....
If that is not possible, how can I get my GitHub Enterprise repo and my commit SHA1 value from the string: "H4sIAAAAAAAAAI2QzW7CMBCE7zyFlXOD_7HjE30Hjr74Zw0WhETEERJV372xKiP11r3t6NuZ0X7t0DZd6AzqPlGBpaAwjSPci0HP6XHNBUZEeffxy8XKMUJVT0RP1YkejOCG6201hDQKKhU93G7unKfjuuyzH_ebbwOuFVCSS8c0F5RoIVj0SSudooaBMBYYa_D9j1tTl6oOjktIEILS-iC9HARwCNFHx3hIoAdPHYvxbbXWo0sp82Istvicy2X1rZzF7xCLnyn2bp6h5Bc8LK4_ycXifwfuvn8A-067a1oBAAA."
2 answers
Hi Dave,
Comments
Hi, here is something that I've already been subscribed to: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert%20%28SAFe%29#action=com.ibm.team.workitem.viewWorkItem&id=387171
Hi Dave,
I've created 423784: Add a service/API that provides basic information for Git commits associated with work items to track this.
Cheers
--Rupa
Technical Lead, Rational Team Concert