Skip to content

Commit 9f93459

Browse files
committed
Pagination in Task APIs
1 parent 8552daa commit 9f93459

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

Tasks/DownloadBuildArtifacts/task.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"author": "Microsoft Corporation",
99
"version": {
1010
"Major": 0,
11-
"Minor": 135,
11+
"Minor": 136,
1212
"Patch": 0
1313
},
1414
"groups": [
@@ -169,12 +169,15 @@
169169
{
170170
"endpointId": "tfs:teamfoundation",
171171
"target": "definition",
172-
"endpointUrl": "{{endpoint.url}}/{{project}}/_apis/build/definitions?$top=1000",
172+
"endpointUrl": "{{endpoint.url}}/{{project}}/_apis/build/definitions?api-version=3.0-preview&$top=1000&continuationToken={{{continuationToken}}}&queryOrder=2",
173173
"resultSelector": "jsonpath:$.value[?(@.quality=='definition')]",
174174
"parameters": {
175175
"project": "$(project)"
176176
},
177-
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }"
177+
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }",
178+
"callbackContextTemplate": "{\"continuationToken\" : \"{{{headers.x-ms-continuationtoken}}}\"}",
179+
"callbackRequiredTemplate": "{{{#headers.x-ms-continuationtoken}}}true{{{/headers.x-ms-continuationtoken}}}",
180+
"initialContextTemplate":"{\"continuationToken\" : \"{{{system.utcNow}}}\"}"
178181
},
179182
{
180183
"endpointId": "tfs:teamfoundation",

Tasks/DownloadBuildArtifacts/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"author": "Microsoft Corporation",
99
"version": {
1010
"Major": 0,
11-
"Minor": 135,
11+
"Minor": 136,
1212
"Patch": 0
1313
},
1414
"groups": [

Tasks/VsTest/task.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -462,26 +462,29 @@
462462
"visibleRule": "rerunFailedTests = true"
463463
}
464464
],
465-
"sourceDefinitions": [
465+
"dataSourceBindings": [
466466
{
467467
"target": "testPlan",
468-
"endpoint": "/$(system.teamProject)/_apis/test/plans?filterActivePlans=true&api-version=3.0-preview.2",
469-
"selector": "jsonpath:$.value[*].name",
470-
"keySelector": "jsonpath:$.value[*].id",
471-
"authKey": "tfs:teamfoundation"
468+
"endpointId": "tfs:teamfoundation",
469+
"endpointUrl": "{{endpoint.url}}/{{system.teamProject}}/_apis/test/plans?filterActivePlans=true&api-version=3.0-preview.2&$skip={{skip}}&$top=1000",
470+
"resultSelector": "jsonpath:$.value[*]",
471+
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{id}}} - {{{name}}}\" }",
472+
"callbackContextTemplate": "{\"skip\": \"{{add skip 1000}}\"}",
473+
"callbackRequiredTemplate": "{{isEqualNumber result.count 1000}}",
474+
"initialContextTemplate": "{\"skip\": \"0\"}"
472475
},
473476
{
474477
"target": "testConfiguration",
475-
"endpoint": "/$(system.teamProject)/_apis/test/configurations?api-version=3.0-preview.1",
476-
"selector": "jsonpath:$.value[*].name",
477-
"keySelector": "jsonpath:$.value[*].id",
478-
"authKey": "tfs:teamfoundation"
478+
"endpointId": "tfs:teamfoundation",
479+
"endpointUrl": "{{endpoint.url}}/{{system.teamProject}}/_apis/test/configurations?api-version=3.0-preview.1",
480+
"resultSelector": "jsonpath:$.value[*]",
481+
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{id}}} - {{{name}}}\" }"
479482
},
480483
{
481484
"target": "testSuite",
482-
"endpoint": "/$(system.teamProject)/_apis/test/plans/$(testPlan)/suites?$asTreeView=true&api-version=3.0-preview.2",
483-
"selector": "jsonpath:$.value[*]",
484-
"authKey": "tfs:teamfoundation"
485+
"endpointId": "tfs:teamfoundation",
486+
"endpointUrl": "{{endpoint.url}}/{{system.teamProject}}/_apis/test/plans/{{testPlan}}/suites?$asTreeView=true&api-version=3.0-preview.2",
487+
"resultSelector": "jsonpath:$.value[*]"
485488
}
486489
],
487490
"instanceNameFormat": "VsTest - $(testSelector)",

0 commit comments

Comments
 (0)