screwdriver-api 7.0.196 → 7.0.198

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.196",
3
+ "version": "7.0.198",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -686,8 +686,8 @@ function getSubsequentJobs(workflowGraph, startNode) {
686
686
  const nodeToEdgeDestsMap = Object.fromEntries(nodes.map(node => [node.name, []]));
687
687
 
688
688
  let start = trimJobName(startNode);
689
- // In rare cases, WorkflowGraph and startNode may have different start tildes
690
689
 
690
+ // In rare cases, WorkflowGraph and startNode may have different start tildes
691
691
  if (!(start in nodeToEdgeDestsMap)) {
692
692
  if (start.startsWith('~')) {
693
693
  start = start.slice(1);
@@ -704,7 +704,14 @@ function getSubsequentJobs(workflowGraph, startNode) {
704
704
 
705
705
  const visited = new Set(visiting);
706
706
 
707
- edges.forEach(edge => nodeToEdgeDestsMap[edge.src].push(edge.dest));
707
+ edges.forEach(edge => {
708
+ // this is a temporary fix for the issue where the edge.src is not in the nodes array
709
+ // TODO: https://github.com/screwdriver-cd/screwdriver/issues/3206
710
+ if (!nodeToEdgeDestsMap[edge.src]) {
711
+ nodeToEdgeDestsMap[edge.src] = [];
712
+ }
713
+ nodeToEdgeDestsMap[edge.src].push(edge.dest);
714
+ });
708
715
  if (edges.length) {
709
716
  while (visiting.length) {
710
717
  const currentNode = visiting.pop();
@@ -248,7 +248,7 @@ module.exports = () => ({
248
248
  build.statusMessage = statusMessage || build.statusMessage;
249
249
  } else if (['SUCCESS', 'FAILURE', 'ABORTED'].includes(desiredStatus)) {
250
250
  build.meta = request.payload.meta || {};
251
- merge(event.meta, build.meta);
251
+ event.meta = merge({}, event.meta, build.meta);
252
252
  build.endTime = new Date().toISOString();
253
253
  } else if (desiredStatus === 'RUNNING') {
254
254
  build.startTime = new Date().toISOString();