screwdriver-api 7.0.146 → 7.0.148

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.146",
3
+ "version": "7.0.148",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -102,7 +102,7 @@
102
102
  "screwdriver-build-bookend": "^4.0.0",
103
103
  "screwdriver-cache-bookend": "^3.0.0",
104
104
  "screwdriver-command-validator": "^3.0.0",
105
- "screwdriver-config-parser": "^10.0.0",
105
+ "screwdriver-config-parser": "^10.4.1",
106
106
  "screwdriver-coverage-bookend": "^2.0.0",
107
107
  "screwdriver-coverage-sonar": "^4.1.1",
108
108
  "screwdriver-data-schema": "^23.2.0",
@@ -93,7 +93,7 @@ async function triggerNextJobs(config, app) {
93
93
  for (const [nextJobName, nextJob] of Object.entries(currentPipelineNextJobs)) {
94
94
  const nextJobId = nextJob.id || (await getJobId(nextJobName, currentPipeline.id, jobFactory));
95
95
  const { isVirtual: isNextJobVirtual, stageName: nextJobStageName } = nextJob;
96
- const resource = `pipeline:${currentPipeline.id}:event:${currentEvent.id}`;
96
+ const resource = `pipeline:${currentPipeline.id}:groupEvent:${currentEvent.groupEventId}`;
97
97
  let lock;
98
98
  let nextBuild;
99
99
 
@@ -82,11 +82,21 @@ class AndTrigger extends JoinBase {
82
82
  }
83
83
  }
84
84
 
85
+ if (!nextBuild) {
86
+ // If the build to join is in the child event, its event id is greater than current event.
87
+ nextBuild = relatedBuilds.find(b => b.jobId === nextJobId && b.eventId > this.currentEvent.id);
88
+ }
89
+
85
90
  const newParentBuilds = mergeParentBuilds(parentBuilds, relatedBuilds, this.currentEvent);
91
+ let nextEvent = this.currentEvent;
92
+
93
+ if (nextBuild) {
94
+ nextEvent = await this.eventFactory.get({ id: nextBuild.eventId });
95
+ }
86
96
 
87
97
  return this.processNextBuild({
88
98
  pipelineId: this.pipelineId,
89
- event: this.currentEvent,
99
+ event: nextEvent,
90
100
  nextBuild,
91
101
  nextJobName,
92
102
  nextJobId,