screwdriver-api 7.0.49 → 7.0.51

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.49",
3
+ "version": "7.0.51",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -845,7 +845,7 @@ const buildsPlugin = {
845
845
  */
846
846
  const isORTrigger = !joinListNames.includes(current.job.name);
847
847
 
848
- if (joinListNames.length === 0 || isORTrigger) {
848
+ if (isORTrigger) {
849
849
  const internalBuildConfig = {
850
850
  jobFactory,
851
851
  buildFactory,
@@ -1048,6 +1048,7 @@ const buildsPlugin = {
1048
1048
 
1049
1049
  const joinList = nextJobs[nextJobName].join;
1050
1050
  const joinListNames = joinList.map(j => j.name);
1051
+ const isORTrigger = !joinListNames.includes(triggerName);
1051
1052
 
1052
1053
  if (nextBuild) {
1053
1054
  // update current build info in parentBuilds
@@ -1083,22 +1084,30 @@ const buildsPlugin = {
1083
1084
  });
1084
1085
  }
1085
1086
 
1086
- const { hasFailure, done } = await getParentBuildStatus({
1087
- newBuild,
1088
- joinListNames,
1089
- pipelineId: externalPipelineId,
1090
- buildFactory
1091
- });
1087
+ if (isORTrigger) {
1088
+ if (['CREATED', null, undefined].includes(newBuild.status)) {
1089
+ newBuild.status = 'QUEUED';
1090
+ await newBuild.update();
1091
+ await newBuild.start();
1092
+ }
1093
+ } else {
1094
+ const { hasFailure, done } = await getParentBuildStatus({
1095
+ newBuild,
1096
+ joinListNames,
1097
+ pipelineId: externalPipelineId,
1098
+ buildFactory
1099
+ });
1092
1100
 
1093
- // Check if external pipeline has Join
1094
- // and join conditions are met
1095
- await handleNewBuild({
1096
- done,
1097
- hasFailure,
1098
- newBuild,
1099
- jobName: nextJobName,
1100
- pipelineId: externalPipelineId
1101
- });
1101
+ // Check if external pipeline has Join
1102
+ // and join conditions are met
1103
+ await handleNewBuild({
1104
+ done,
1105
+ hasFailure,
1106
+ newBuild,
1107
+ jobName: nextJobName,
1108
+ pipelineId: externalPipelineId
1109
+ });
1110
+ }
1102
1111
  }
1103
1112
 
1104
1113
  return null;