screwdriver-api 7.0.136 → 7.0.137

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": "7.0.136",
3
+ "version": "7.0.137",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -34,7 +34,8 @@ const {
34
34
  createExternalEvent,
35
35
  getBuildsForGroupEvent,
36
36
  buildsToRestartFilter,
37
- trimJobName
37
+ trimJobName,
38
+ getParallelBuilds
38
39
  } = require('./triggers/helpers');
39
40
 
40
41
  /**
@@ -140,6 +141,18 @@ async function triggerNextJobs(config, app) {
140
141
  // This includes CREATED builds too
141
142
  const groupEventBuilds =
142
143
  externalEvent !== undefined ? await getBuildsForGroupEvent(externalEvent.groupEventId, buildFactory) : [];
144
+
145
+ // fetch builds created due to trigger
146
+ if (externalEvent) {
147
+ const parallelBuilds = await getParallelBuilds({
148
+ eventFactory,
149
+ parentEventId: externalEvent.id,
150
+ pipelineId: externalEvent.pipelineId
151
+ });
152
+
153
+ groupEventBuilds.push(...parallelBuilds);
154
+ }
155
+
143
156
  const buildsToRestart = buildsToRestartFilter(joinedPipeline, groupEventBuilds, currentEvent, currentBuild);
144
157
  const isRestart = buildsToRestart.length > 0;
145
158
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { getParallelBuilds, mergeParentBuilds, getParentBuildIds } = require('./helpers');
3
+ const { mergeParentBuilds, getParentBuildIds } = require('./helpers');
4
4
  const { JoinBase } = require('./joinBase');
5
5
 
6
6
  /**
@@ -31,15 +31,6 @@ class RemoteJoin extends JoinBase {
31
31
  * @returns {Promise<Build|null>}
32
32
  */
33
33
  async execute(externalEvent, nextJobName, nextJobId, parentBuilds, groupEventBuilds, joinListNames) {
34
- // fetch builds created due to trigger
35
- const parallelBuilds = await getParallelBuilds({
36
- eventFactory: this.eventFactory,
37
- parentEventId: externalEvent.id,
38
- pipelineId: externalEvent.pipelineId
39
- });
40
-
41
- groupEventBuilds.push(...parallelBuilds);
42
-
43
34
  // When restart case, should we create a new build ?
44
35
  const nextBuild = groupEventBuilds.find(b => b.jobId === nextJobId && b.eventId === externalEvent.id);
45
36