screwdriver-data-schema 23.3.0 → 23.3.2

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.
Files changed (2) hide show
  1. package/config/base.js +13 -6
  2. package/package.json +1 -1
package/config/base.js CHANGED
@@ -63,19 +63,26 @@ const SCHEMA_SUBSCRIBE = Joi.object().keys({
63
63
  )
64
64
  });
65
65
 
66
+ const ALLOWED_JOB_FIELDS_WITH_PIPELINE_TEMPLATE = Joi.object().keys({
67
+ image: Job.image,
68
+ environment: Job.environment,
69
+ settings: Job.settings,
70
+ requires: Job.requires
71
+ });
72
+
66
73
  const SCHEMA_CONFIG_PRE_TEMPLATE_MERGE = Joi.object()
67
74
  .keys({
68
75
  template: Joi.string().regex(Regex.FULL_TEMPLATE_NAME_WITH_NAMESPACE),
69
76
  version: Joi.number().integer().min(1).max(50),
70
77
  annotations: Annotations.annotations,
71
- jobs: SCHEMA_JOBS.when('template', { is: Joi.exist(), then: Joi.forbidden(), otherwise: Joi.required() }),
78
+ jobs: Joi.when('template', {
79
+ is: Joi.exist(),
80
+ then: Joi.object().pattern(Job.jobName, ALLOWED_JOB_FIELDS_WITH_PIPELINE_TEMPLATE).unknown(false),
81
+ otherwise: SCHEMA_JOBS.required()
82
+ }),
72
83
  shared: Joi.when('template', {
73
84
  is: Joi.exist(),
74
- then: Joi.object().keys({
75
- image: Job.image,
76
- environment: Job.environment,
77
- settings: Job.settings
78
- }),
85
+ then: ALLOWED_JOB_FIELDS_WITH_PIPELINE_TEMPLATE,
79
86
  otherwise: SCHEMA_SHARED
80
87
  }),
81
88
  cache: SCHEMA_CACHE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "23.3.0",
3
+ "version": "23.3.2",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {