Open sdraht opened 10 years ago
I have the same issue
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?
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);
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: