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

Builds#build_artifacts fails to retrieve artifacts w/ TeamCity API 9.X #47

Open
fortinmike opened this issue Jun 17, 2015 · 0 comments
Open

Comments

@fortinmike
Copy link

It seems like the root key in JSON output for TeamCity artifacts has changed in v9.X; it used to be "files", now it is "file". This causes teamcity-ruby-client to always return nil from Builds#build_artifacts when using the v9.X API.

https://gist.github.com/fortinmike/ac80adfbade2b2d5e0c7

I suppose this is a bug in TeamCity's API as the XML output stays the same from v8.X to v9.X. Still, this makes teamcity-ruby-client fail to fetch artifacts when using the default non-versioned API endpoint. Took me some time to figure it out.

Maybe falling back like this would be a reasonable workaround?

def build_artifacts(build_id)
    response = get("builds/#{build_id}/artifacts")
    response['files'] || response['file']
end

I have not noticed other issues with teamcity-ruby-client using the v9.X API apart from that.

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

1 participant