screwdriver-api 8.0.60 → 8.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screwdriver-api",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.62",
|
|
4
4
|
"description": "API server for the Screwdriver.cd service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"screwdriver-config-parser": "^12.2.3",
|
|
113
113
|
"screwdriver-coverage-bookend": "^3.0.0",
|
|
114
114
|
"screwdriver-coverage-sonar": "^5.0.0",
|
|
115
|
-
"screwdriver-data-schema": "^25.
|
|
115
|
+
"screwdriver-data-schema": "^25.11.0",
|
|
116
116
|
"screwdriver-datastore-sequelize": "^10.0.0",
|
|
117
117
|
"screwdriver-executor-base": "^11.0.0",
|
|
118
118
|
"screwdriver-executor-docker": "^8.0.1",
|
|
@@ -7,6 +7,23 @@ const { Status, BUILD_STATUS_MESSAGES } = require('../../builds/triggers/helpers
|
|
|
7
7
|
* @typedef {import('screwdriver-models/lib/event')} Event
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param workflowGraph
|
|
13
|
+
* @returns {Array<Number>}
|
|
14
|
+
*/
|
|
15
|
+
function getVirtualJobIds(workflowGraph) {
|
|
16
|
+
const virtualJobIds = [];
|
|
17
|
+
|
|
18
|
+
workflowGraph.nodes.forEach(node => {
|
|
19
|
+
if (node.virtual) {
|
|
20
|
+
virtualJobIds.push(node.id);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return virtualJobIds;
|
|
25
|
+
}
|
|
26
|
+
|
|
10
27
|
/**
|
|
11
28
|
* Create a new event.
|
|
12
29
|
* Updates the status of all the virtual builds at the beginning of the event workflow to "SUCCESS"
|
|
@@ -23,9 +40,10 @@ async function createEvent(config, server) {
|
|
|
23
40
|
const { eventFactory } = server.app;
|
|
24
41
|
const { username, scmContext } = config;
|
|
25
42
|
const event = await eventFactory.create(config);
|
|
43
|
+
const virtualJobIds = getVirtualJobIds(event.workflowGraph);
|
|
26
44
|
|
|
27
45
|
if (event.builds) {
|
|
28
|
-
const virtualJobBuilds = event.builds.filter(b => b.
|
|
46
|
+
const virtualJobBuilds = event.builds.filter(b => virtualJobIds.includes(b.jobId));
|
|
29
47
|
|
|
30
48
|
for (const build of virtualJobBuilds) {
|
|
31
49
|
await updateBuildAndTriggerDownstreamJobs(
|