Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Error in Builds.rb (Build statistics job call) #13

Closed
myanaros opened this issue Jul 15, 2013 · 2 comments
Closed

Fix for Error in Builds.rb (Build statistics job call) #13

myanaros opened this issue Jul 15, 2013 · 2 comments

Comments

@myanaros
Copy link

The build_statistics method is passing the entire hash to faraday, instead of the build_id value.

diff --git a/lib/teamcity/client/builds.rb b/lib/teamcity/client/builds.rb
index daab485..fad149b 100644
--- a/lib/teamcity/client/builds.rb
+++ b/lib/teamcity/client/builds.rb
@@ -39,7 +39,7 @@ module TeamCity
       # @param build_id [String]
       # @return [Array<Hashie::Mash>, nil] returns nil if there are no statistics
       def build_statistics(build_id)
-        response = get("builds/#{build_id}/statistics")
+        response = get("builds/#{build_id[:id]}/statistics")
         response['property']
       end

Passing the id value fixed the issue for me.

@jperry
Copy link
Owner

jperry commented Jul 15, 2013

@myanaros - I am intentionally having you just pass the build_id instead of a hash, not sure how this is a bug? After I create a version out of these changes I plan to make the api more consistent since some take a hash and some take a few arguments. See this issue I already have.

@jperry
Copy link
Owner

jperry commented Jul 15, 2013

@myanaros - Do you have a preference to the api? State your opinion on the issue I created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants