screwdriver-api 8.0.90 → 8.0.91

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": "8.0.90",
3
+ "version": "8.0.91",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -101,6 +101,7 @@
101
101
  "js-yaml": "^3.14.1",
102
102
  "jsonwebtoken": "^9.0.0",
103
103
  "license-checker": "^25.0.1",
104
+ "lodash.isempty": "^4.4.0",
104
105
  "lodash.mergewith": "^4.6.2",
105
106
  "ndjson": "^2.0.0",
106
107
  "node-env-file": "^0.1.8",
@@ -3,6 +3,7 @@
3
3
  const boom = require('@hapi/boom');
4
4
  const hoek = require('@hapi/hoek');
5
5
  const merge = require('lodash.mergewith');
6
+ const isEmpty = require('lodash.isempty');
6
7
  const { PR_JOB_NAME, PR_STAGE_NAME, STAGE_TEARDOWN_PATTERN } = require('screwdriver-data-schema').config.regex;
7
8
  const { getFullStageJobName } = require('../../helper');
8
9
  const { updateVirtualBuildSuccess, emitBuildStatusEvent } = require('../triggers/helpers');
@@ -370,7 +371,7 @@ async function updateBuildAndTriggerDownstreamJobs(config, build, server, userna
370
371
  build.statusMessage = statusMessage || build.statusMessage;
371
372
  build.statusMessageType = statusMessageType || build.statusMessageType;
372
373
  } else if (['SUCCESS', 'FAILURE', 'ABORTED'].includes(desiredStatus)) {
373
- build.meta = meta || {};
374
+ build.meta = isEmpty(meta) ? build.meta || {} : meta;
374
375
  event.meta = merge({}, event.meta, build.meta);
375
376
  build.endTime = new Date().toISOString();
376
377
  } else if (desiredStatus === 'RUNNING') {