screwdriver-data-schema 23.3.1 → 23.3.3

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 +14 -7
  2. package/package.json +1 -1
package/config/base.js CHANGED
@@ -63,20 +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: SCHEMA_JOBS.optional(),
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
- requires: Job.requires
79
- }),
85
+ then: ALLOWED_JOB_FIELDS_WITH_PIPELINE_TEMPLATE,
80
86
  otherwise: SCHEMA_SHARED
81
87
  }),
82
88
  cache: SCHEMA_CACHE,
@@ -107,6 +113,7 @@ const SCHEMA_CONFIG_POST_TEMPLATE_MERGE = Joi.object()
107
113
  * @type {Object}
108
114
  */
109
115
  module.exports = {
116
+ allowedJobFieldsWithPipelineTemplate: ALLOWED_JOB_FIELDS_WITH_PIPELINE_TEMPLATE,
110
117
  jobs: SCHEMA_JOBS,
111
118
  shared: SCHEMA_SHARED,
112
119
  prChain: SCHEMA_PR_CHAIN, // This is still used by pipeline schema.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "23.3.1",
3
+ "version": "23.3.3",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {