jperry/teamcity-ruby-client

What kind of api request is really being made for build(id:"x")

myanaros opened this issue · 5 comments

This is the request i'm interested in making,

http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/<value_name>

Is this already being made in the backend for calls to TeamCity.build(id:"x") ?

In other words, is it possible to grab information like who is investigating the build or the results of tests with this method? If not, is it even possible to grab this data with the API at all? I can't seem to find the answer in their api documentation.

Hi @myanaros,

I am going to add support for fetching statistics as you mention above. Just calling TeamCity.build(id:"x") will return the details for a build which doesn't include statistics, you can see the response in the vcr cassette.

The statistics returned will be below but in a ruby data structure and the call will be TeamCity.build_statistics(id:'x'):

<properties>
<property name="ArtifactsSize" value="4361"/>
<property name="BuildDuration" value="851"/>
<property name="BuildDurationNetTime" value="851"/>
<property name="SuccessRate" value="0"/>
<property name="TimeSpentInQueue" value="24"/>
</properties>

I will also be adding a call for investigations. I'll let you know when both statistics and investigations are available, should be today some time.

@myanaros - statistics is now supported see #12

I'll release a new version today or tomorrow. Going to close unless you have something else.

Thanks, I'll be using those calls today. Do you know if there is a way to grab code statistics information? Like the values shown here http://confluence.jetbrains.com/display/TCD8/Custom+Chart#CustomChart-listOfDefaultStatisticValues .
I would be willing to work on adding this functionality to the gem.

@myanaros - I added the ability to grab statistics, they don't all show up depends on what you have being reported by your build. The TeamCity.build_statistics(build_id) will get you all the statistics. We can add support to fetch only a particular statistic otherwise just fetching it from the statistics returned will work as well.