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

API version for TfsRelease service should be configurable #113

Open
pascalberger opened this issue Mar 8, 2018 · 10 comments
Open

API version for TfsRelease service should be configurable #113

pascalberger opened this issue Mar 8, 2018 · 10 comments

Comments

@pascalberger
Copy link
Contributor

Currently the API verison for TfsRelease service is fixed in the code.

As this might change, and TFS On-Prem has a lower API version it would be nice to be able to configure it.

@marcells
Copy link
Owner

marcells commented Mar 9, 2018

It should not be configurable, cause the API could return different information in a different structure which has to be handled in the code.

@marcells
Copy link
Owner

marcells commented Mar 9, 2018

Maybe we can switch it to an older API version. So we are compatible to the on-premise TFS and VSTS.

Could you try this and make a PR?

@search8
Copy link

search8 commented Mar 15, 2018

I was just going to write the same thing. I had mentioned this before for the Tfs service as well. You can default back to whatever version you guys want to support when no version is specified, but since you're allowing to pass along any query string one could want, it does not make sense to hard code the version in my opinion. Currently only 4.0-preview is out for TFS which does not allow me to use the release part of the monitor.

@marcells
Copy link
Owner

The problem is that if a newer api version is defined the response could be invalid, too. We can make it configurable, but we need to keep a default value for it. If anyone changes the api version it is not guaranteed that the service will work.

@search8
Copy link

search8 commented Mar 19, 2018

Yes, exactly. Have a fallback for when it's not specified but allow to overwrite it. Just like you guys did for the collection in the Tfs service: Collection name. Defaults to DefaultCollection.

@meeces2911
Copy link
Contributor

@search8 what version of TFS are you running, because as far as I've been able to tell, this particular API is currently only available in VSTS.
Which means even if you were able to specify your own api version, it still wouldn't work for you.
Seems like the Deployments API is in version 4.1 and above.

@search8
Copy link

search8 commented Mar 23, 2018

We are running TFS 2018 update 1. 4.0-preview works for the release api. I just verified that again.

@search8
Copy link

search8 commented Mar 23, 2018

It only seems to work with version 4.0-preview when you add the Collection to the api path as well, even though the specification does not mention that (it also seems to be for VSTS only).

https://www.visualstudio.com/en-us/docs/integrate/api/rm/definitions

I got it to work like that:

https://<server>:443/DefaultCollection/<teamproject>/_apis/release/deployments?api-version=4.0-preview&definitionId=3&definitionEnvironmentId=5&$top=1

Currently only the time calculations seem to be off. It tells me "finished a few seconds ago" even though it was 2 days and it says it ran for "2017 years, 2 months, 22 days, 8 hours, 39 minutes, and 58s". That should probably be an easy fix.

@search8
Copy link

search8 commented Mar 23, 2018

As far as the dates go I think I'll have to use "lastModifiedOn" for finishedAt and "startedOn" for startedAt. All the other dates are not set for one reason or another (queuedOn) or not even available (completedOn). Not sure how compatible that will be with VSTS. Maybe I'll just push the changes to my fork instead of creating a pull request.

@marcells
Copy link
Owner

marcells commented Apr 2, 2018

If you send me a link then I can check it. I have a VSTS account. You can create one for free, too, if you want to.

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

No branches or pull requests

4 participants