Skip to content

Commit 1cfcbb5

Browse files
authored
Merge pull request #5351 from taskcluster/matt-boris/updateGraphQLSchema
fix(graphql): update schema for new counts/capacities per state
2 parents 429371f + d944e17 commit 1cfcbb5

File tree

7 files changed

+71
-3
lines changed

7 files changed

+71
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
audience: general
2+
level: patch
3+
---
4+
Add new counts/capacities to graphql schema.

services/web-server/src/graphql/WorkerManager.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ type WorkerManagerWorkerPoolSummary {
66
config: JSON
77
emailOnError: Boolean!
88
currentCapacity: Int!
9+
requestedCount: Int!
10+
runningCount: Int!
11+
stoppingCount: Int!
12+
stoppedCount: Int!
13+
requestedCapacity: Int!
14+
runningCapacity: Int!
15+
stoppingCapacity: Int!
16+
stoppedCapacity: Int!
917
pendingTasks: Int #this value comes from a separate request to queue
1018
}
1119

services/web-server/test/fixtures/workerPool.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@ query WorkerPool($workerPoolId: String!){
44
owner
55
pendingTasks
66
currentCapacity
7+
requestedCount
8+
runningCount
9+
stoppingCount
10+
stoppedCount
11+
requestedCapacity
12+
runningCapacity
13+
stoppingCapacity
14+
stoppedCapacity
715
}
816
}

services/web-server/test/fixtures/workerPools.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ query ListWorkerPools($connection: PageConnection, $filter: JSON){
66
providerId
77
pendingTasks
88
currentCapacity
9+
requestedCount
10+
runningCount
11+
stoppingCount
12+
stoppedCount
13+
requestedCapacity
14+
runningCapacity
15+
stoppingCapacity
16+
stoppedCapacity
917
}
1018
}
1119
}

services/web-server/test/graphql/workermanager_test.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ helper.secrets.mockSuite(testing.suiteName(), [], function(mock, skipping) {
3131
});
3232

3333
test('get single workerpool', async function() {
34-
helper.fakes.makeWorkerPool('baz/bing', { owner: '[email protected]', currentCapacity: 4 });
34+
helper.fakes.makeWorkerPool('baz/bing', { owner: '[email protected]', currentCapacity: 4, requestedCount: 0, runningCount: 1, stoppingCount: 0, stoppedCount: 0, requestedCapacity: 0, runningCapacity: 1, stoppingCapacity: 0, stoppedCapacity: 0 });
3535
const client = helper.getHttpClient();
3636
const single = await client.query({
3737
query: gql`${workerPoolQuery}`,
@@ -43,11 +43,19 @@ helper.secrets.mockSuite(testing.suiteName(), [], function(mock, skipping) {
4343
assert.equal(single.data.WorkerPool.workerPoolId, 'baz/bing');
4444
assert.equal(single.data.WorkerPool.owner, '[email protected]');
4545
assert.equal(single.data.WorkerPool.currentCapacity, 4);
46+
assert.equal(single.data.WorkerPool.requestedCount, 0);
47+
assert.equal(single.data.WorkerPool.runningCount, 1);
48+
assert.equal(single.data.WorkerPool.stoppingCount, 0);
49+
assert.equal(single.data.WorkerPool.stoppedCount, 0);
50+
assert.equal(single.data.WorkerPool.requestedCapacity, 0);
51+
assert.equal(single.data.WorkerPool.runningCapacity, 1);
52+
assert.equal(single.data.WorkerPool.stoppingCapacity, 0);
53+
assert.equal(single.data.WorkerPool.stoppedCapacity, 0);
4654
});
4755

4856
test('list workerpools', async function() {
49-
helper.fakes.makeWorkerPool('foo/bar', { providerId: 'baz', currentCapacity: 0 });
50-
helper.fakes.makeWorkerPool('baz/bing', { providerId: 'wow', currentCapacity: 2 });
57+
helper.fakes.makeWorkerPool('foo/bar', { providerId: 'baz', currentCapacity: 0, requestedCount: 0, runningCount: 0, stoppingCount: 0, stoppedCount: 0, requestedCapacity: 0, runningCapacity: 0, stoppingCapacity: 0, stoppedCapacity: 0 });
58+
helper.fakes.makeWorkerPool('baz/bing', { providerId: 'wow', currentCapacity: 2, requestedCount: 1, runningCount: 0, stoppingCount: 1, stoppedCount: 0, requestedCapacity: 1, runningCapacity: 0, stoppingCapacity: 1, stoppedCapacity: 0 });
5159
const client = helper.getHttpClient();
5260
const response = await client.query({
5361
query: gql`${workerPoolsQuery}`,
@@ -60,7 +68,23 @@ helper.secrets.mockSuite(testing.suiteName(), [], function(mock, skipping) {
6068
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.providerId, 'wow');
6169

6270
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.currentCapacity, 0);
71+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.requestedCount, 0);
72+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.runningCount, 0);
73+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.stoppingCount, 0);
74+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.stoppedCount, 0);
75+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.requestedCapacity, 0);
76+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.runningCapacity, 0);
77+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.stoppingCapacity, 0);
78+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[0].node.stoppedCapacity, 0);
6379
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.currentCapacity, 2);
80+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.requestedCount, 1);
81+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.runningCount, 0);
82+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.stoppingCount, 1);
83+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.stoppedCount, 0);
84+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.requestedCapacity, 1);
85+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.runningCapacity, 0);
86+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.stoppingCapacity, 1);
87+
assert.equal(response.data.WorkerManagerWorkerPoolSummaries.edges[1].node.stoppedCapacity, 0);
6488

6589
const clippedResponse = await client.query({
6690
query: gql`${workerPoolsQuery}`,

ui/src/views/WorkerManager/WMEditWorkerPool/workerPool.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ query WorkerPool($workerPoolId: String!) {
77
providerId,
88
config,
99
currentCapacity,
10+
requestedCount,
11+
runningCount,
12+
stoppingCount,
13+
stoppedCount,
14+
requestedCapacity,
15+
runningCapacity,
16+
stoppingCapacity,
17+
stoppedCapacity,
1018
pendingTasks
1119
}
1220
}

ui/src/views/WorkerManager/WMViewWorkerPools/WMWorkerPools.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ query workerPools($connection: PageConnection, $filter: JSON) {
1616
config
1717
emailOnError
1818
currentCapacity
19+
requestedCount
20+
runningCount
21+
stoppingCount
22+
stoppedCount
23+
requestedCapacity
24+
runningCapacity
25+
stoppingCapacity
26+
stoppedCapacity
1927
pendingTasks #this value comes from a separate request to queue
2028
}
2129
}

0 commit comments

Comments
 (0)