screwdriver-data-schema 21.27.1 → 21.28.1
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/config/settings.js +7 -4
- package/models/pipeline.js +2 -1
- package/package.json +1 -1
- package/plugins/notifications.js +19 -3
package/config/settings.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
|
|
5
5
|
const SCHEMA_TIMESTAMP_FORMAT = Joi.string()
|
|
6
|
-
.valid('UTC', 'LOCAL_TIMEZONE'
|
|
6
|
+
.valid('UTC', 'LOCAL_TIMEZONE')
|
|
7
7
|
.optional()
|
|
8
|
-
.default('
|
|
8
|
+
.default('LOCAL_TIMEZONE')
|
|
9
9
|
.description('User preferred timestamp');
|
|
10
10
|
const SCHEMA_DISPLAY_JOB_NAME_LENGTH = Joi.number()
|
|
11
11
|
.integer()
|
|
@@ -52,12 +52,15 @@ const SCHEMA_USER_SETTINGS = Joi.object()
|
|
|
52
52
|
/\d/,
|
|
53
53
|
Joi.object().keys({
|
|
54
54
|
displayJobNameLength: SCHEMA_DISPLAY_JOB_NAME_LENGTH,
|
|
55
|
-
showPRJobs: Joi.boolean()
|
|
56
|
-
timestampFormat: SCHEMA_TIMESTAMP_FORMAT
|
|
55
|
+
showPRJobs: Joi.boolean()
|
|
57
56
|
})
|
|
58
57
|
)
|
|
59
58
|
.unknown();
|
|
60
59
|
|
|
60
|
+
SCHEMA_USER_SETTINGS.append({
|
|
61
|
+
timestampFormat: SCHEMA_TIMESTAMP_FORMAT
|
|
62
|
+
});
|
|
63
|
+
|
|
61
64
|
module.exports = {
|
|
62
65
|
pipelineSettings: SCHEMA_PIPELINE_SETTINGS,
|
|
63
66
|
userSettings: SCHEMA_USER_SETTINGS,
|
package/models/pipeline.js
CHANGED
package/package.json
CHANGED
package/plugins/notifications.js
CHANGED
|
@@ -11,7 +11,7 @@ const SCHEMA_SCM_REPO = Joi.object()
|
|
|
11
11
|
name: Joi.string().required()
|
|
12
12
|
})
|
|
13
13
|
.unknown(true);
|
|
14
|
-
const
|
|
14
|
+
const SCHEMA_PIPELINE = Joi.object()
|
|
15
15
|
.keys({
|
|
16
16
|
scmRepo: SCHEMA_SCM_REPO.required()
|
|
17
17
|
})
|
|
@@ -19,7 +19,7 @@ const SCHEMA_PIPELINE_DATA = Joi.object()
|
|
|
19
19
|
const SCHEMA_BUILD_DATA = {
|
|
20
20
|
settings: SCHEMA_BUILD_SETTINGS.required(),
|
|
21
21
|
status: SCHEMA_STATUS.required(),
|
|
22
|
-
pipeline:
|
|
22
|
+
pipeline: SCHEMA_PIPELINE.required(),
|
|
23
23
|
jobName: Joi.string(),
|
|
24
24
|
build: Joi.object()
|
|
25
25
|
.keys({
|
|
@@ -32,6 +32,14 @@ const SCHEMA_BUILD_DATA = {
|
|
|
32
32
|
buildLink: Joi.string(),
|
|
33
33
|
isFixed: Joi.boolean()
|
|
34
34
|
};
|
|
35
|
+
const SCHEMA_JOB_DATA = {
|
|
36
|
+
settings: SCHEMA_BUILD_SETTINGS.required(),
|
|
37
|
+
status: SCHEMA_STATUS.required(),
|
|
38
|
+
pipeline: SCHEMA_PIPELINE.required(),
|
|
39
|
+
message: Joi.string().required(),
|
|
40
|
+
jobName: Joi.string().required(),
|
|
41
|
+
pipelineLink: Joi.string().required()
|
|
42
|
+
};
|
|
35
43
|
|
|
36
44
|
module.exports = {
|
|
37
45
|
/**
|
|
@@ -48,5 +56,13 @@ module.exports = {
|
|
|
48
56
|
* @property schemaBuildData
|
|
49
57
|
* @type {Array}
|
|
50
58
|
*/
|
|
51
|
-
schemaBuildData: SCHEMA_BUILD_DATA
|
|
59
|
+
schemaBuildData: SCHEMA_BUILD_DATA,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Validates the jobData for notifications plugins
|
|
63
|
+
*
|
|
64
|
+
* @property schemaJobData
|
|
65
|
+
* @type {Array}
|
|
66
|
+
*/
|
|
67
|
+
schemaJobData: SCHEMA_JOB_DATA
|
|
52
68
|
};
|