screwdriver-api 8.0.134 → 8.0.136
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
package/plugins/events/create.js
CHANGED
|
@@ -76,20 +76,20 @@ async function createEvent(config, server) {
|
|
|
76
76
|
const event = await eventFactory.create(config);
|
|
77
77
|
|
|
78
78
|
if (event.builds) {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
// Virtual builds are just CREATED. Not started(QUEUED, RUNNNING, ...).
|
|
80
|
+
const createdBuilds = event.builds.filter(b => b.status === 'CREATED');
|
|
81
|
+
const jobIds = createdBuilds.map(b => b.jobId);
|
|
81
82
|
const virtualNodeNames = getVirtualJobNames(event.workflowGraph);
|
|
82
83
|
|
|
83
|
-
if (virtualNodeNames.length > 0) {
|
|
84
|
-
const
|
|
84
|
+
if (createdBuilds.length > 0 && virtualNodeNames.length > 0) {
|
|
85
|
+
const jobs = await jobFactory.list({
|
|
85
86
|
params: {
|
|
86
87
|
id: jobIds
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
|
|
90
|
-
const virtualJobIds = getVirtualJobIds(virtualNodeNames,
|
|
91
|
-
|
|
92
|
-
const virtualJobBuilds = event.builds.filter(b => virtualJobIds.includes(b.jobId));
|
|
91
|
+
const virtualJobIds = getVirtualJobIds(virtualNodeNames, jobs);
|
|
92
|
+
const virtualJobBuilds = createdBuilds.filter(b => virtualJobIds.includes(b.jobId));
|
|
93
93
|
|
|
94
94
|
for (const build of virtualJobBuilds) {
|
|
95
95
|
await updateBuildAndTriggerDownstreamJobs(
|