Skip to content

Commit

Permalink
Merge pull request #15 from michelkaporin/master
Browse files Browse the repository at this point in the history
Monitor single build per definition in grouped defs
  • Loading branch information
jlandersen authored Jun 30, 2017
2 parents 7f36fd0 + b905019 commit de9295c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vstsbuildrestclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class VstsBuildRestClientImpl implements VstsBuildRestClient {

public getBuilds(definitions: BuildDefinition[], take: number = 5): Thenable<HttpResponse<Build[]>> {
let url = `https://${this.settings.account}.visualstudio.com/DefaultCollection/${this.settings.project}/_apis/build/builds?definitions=${definitions.map(d => d.id).join(',')}&$top=${take}&api-version=2.0`;
if (definitions.length > 1) { // Return single build per definition, if grouped build definitions were queried
url += `&maxBuildsPerDefinition=1`;
}

return this.getMany<Build[]>(url).then(response => {
if (response.value && response.value.length > 0) {
Expand Down

0 comments on commit de9295c

Please sign in to comment.