Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

StartDate/FinishDate empty since update to TeamCity 8.1 #66

Open
sdraht opened this issue Feb 25, 2014 · 3 comments
Open

StartDate/FinishDate empty since update to TeamCity 8.1 #66

sdraht opened this issue Feb 25, 2014 · 3 comments

Comments

@sdraht
Copy link

sdraht commented Feb 25, 2014

I use Builld.StartDate (FinishDate would work as well) to detect which builds I already know and which are new (and to describe the builds with their date):
var newBuilds = this.client.Builds.SuccessfulBuildsByBuildConfigId(this.buildType).Where(b => b.StartDate > this.lastCheck);
Unfortunately these dates are always empty since upgrade to TeamCity 8.1,
http://confluence.jetbrains.com/display/TCD8/Upgrade+Notes also states that there has been some change in the REST API:

REST API
...
In the lists of builds, "startDate" attribute is not longer included in the "build" node. It has become an element instead of attribute to match the full build data representation.
Would be nice if this could be fixed without breaking compatibility to older TeamCity versions.

@guillaume86
Copy link

I have the same issue

@nchaly
Copy link

nchaly commented Oct 24, 2014

Just a speculation -

For workaround you could patch Builds.ByBuildLocator: add fields=$long,build($short,startDate,finishDate) to url.

In terms of good design that would require some additional work. First, a caller should specify additional fields taking server version into consideration. Second, fields specification should be provided somehow to caller. Probably some IFieldsSpec, with default one returning nothing, and Build81FieldSpec returning $long,build($short,startDate,finishDate)? This can be also combined with attribute-based (however it would be concealed from library clients).

Probably, this should go the same way as SQL (never make select *), and specify fields explicitly all the time?

@guillaume86
Copy link

Yes I used this line to get everything back:

var buildWrapper = _caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0}&fields=$long,build($short,startDate,finishDate,changes(change($short,comment)))", locator);

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

No branches or pull requests

3 participants