screwdriver-data-schema 21.26.1 → 21.26.4
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 -1
- package/config/template.js +2 -7
- package/migrations/20220705-upd-stage-color-eventId-createTime.js +1 -10
- package/migrations/20220728171252-remove_column_parameters_from_templates.js +14 -0
- package/models/stage.js +2 -6
- package/models/template.js +3 -4
- package/package.json +1 -1
package/config/settings.js
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
|
|
5
|
+
const SCHEMA_TIMESTAMP_FORMAT = Joi.string()
|
|
6
|
+
.valid('UTC', 'LOCAL_TIMEZONE', 'HUMAN_READABLE')
|
|
7
|
+
.optional()
|
|
8
|
+
.default('HUMAN_READABLE')
|
|
9
|
+
.description('User preferred timestamp');
|
|
5
10
|
const SCHEMA_DISPLAY_JOB_NAME_LENGTH = Joi.number()
|
|
6
11
|
.integer()
|
|
7
12
|
.min(20)
|
|
@@ -46,7 +51,8 @@ const SCHEMA_USER_SETTINGS = Joi.object()
|
|
|
46
51
|
/\d/,
|
|
47
52
|
Joi.object().keys({
|
|
48
53
|
displayJobNameLength: SCHEMA_DISPLAY_JOB_NAME_LENGTH,
|
|
49
|
-
showPRJobs: Joi.boolean()
|
|
54
|
+
showPRJobs: Joi.boolean(),
|
|
55
|
+
timestampFormat: SCHEMA_TIMESTAMP_FORMAT
|
|
50
56
|
})
|
|
51
57
|
)
|
|
52
58
|
.unknown();
|
package/config/template.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
const Job = require('./job');
|
|
5
5
|
const Regex = require('./regex');
|
|
6
|
-
const Parameters = require('./parameters');
|
|
7
6
|
|
|
8
7
|
const TEMPLATE_NAMESPACE = Joi.string()
|
|
9
8
|
.regex(Regex.TEMPLATE_NAMESPACE)
|
|
@@ -62,8 +61,6 @@ const TEMPLATE_IMAGES = Joi.object()
|
|
|
62
61
|
})
|
|
63
62
|
.min(1);
|
|
64
63
|
|
|
65
|
-
const SCHEMA_JOB_PARAMETERS = Parameters.parameters.optional();
|
|
66
|
-
|
|
67
64
|
const SCHEMA_TEMPLATE = Joi.object().keys({
|
|
68
65
|
namespace: TEMPLATE_NAMESPACE,
|
|
69
66
|
name: TEMPLATE_NAME.required(),
|
|
@@ -74,8 +71,7 @@ const SCHEMA_TEMPLATE = Joi.object().keys({
|
|
|
74
71
|
.required()
|
|
75
72
|
.or('image', 'template')
|
|
76
73
|
.or('steps', 'template'),
|
|
77
|
-
images: TEMPLATE_IMAGES
|
|
78
|
-
parameters: SCHEMA_JOB_PARAMETERS
|
|
74
|
+
images: TEMPLATE_IMAGES
|
|
79
75
|
});
|
|
80
76
|
|
|
81
77
|
/**
|
|
@@ -93,6 +89,5 @@ module.exports = {
|
|
|
93
89
|
maintainer: TEMPLATE_MAINTAINER,
|
|
94
90
|
config: Job.templateJob,
|
|
95
91
|
configNoDupSteps: Job.jobNoDupSteps,
|
|
96
|
-
images: TEMPLATE_IMAGES
|
|
97
|
-
parameters: SCHEMA_JOB_PARAMETERS
|
|
92
|
+
images: TEMPLATE_IMAGES
|
|
98
93
|
};
|
|
@@ -23,15 +23,6 @@ module.exports = {
|
|
|
23
23
|
{ transaction }
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
await queryInterface.addColumn(
|
|
27
|
-
table,
|
|
28
|
-
'createTime',
|
|
29
|
-
{
|
|
30
|
-
type: Sequelize.STRING(32)
|
|
31
|
-
},
|
|
32
|
-
{ transaction }
|
|
33
|
-
);
|
|
34
|
-
|
|
35
26
|
await queryInterface.addConstraint(table, {
|
|
36
27
|
name: `${table}_pipeline_id_name_group_event_id_key`,
|
|
37
28
|
fields: ['pipelineId', 'name', 'groupEventId'],
|
|
@@ -41,7 +32,7 @@ module.exports = {
|
|
|
41
32
|
|
|
42
33
|
await queryInterface.addIndex(table, {
|
|
43
34
|
name: `${table}_group_event_id_create_time`,
|
|
44
|
-
fields: ['groupEventId'
|
|
35
|
+
fields: ['groupEventId'],
|
|
45
36
|
transaction
|
|
46
37
|
});
|
|
47
38
|
// eslint-disable-next-line no-empty
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
4
|
+
const table = `${prefix}templates`;
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
// eslint-disable-next-line no-unused-vars
|
|
8
|
+
up: async (queryInterface, Sequelize) => {
|
|
9
|
+
try {
|
|
10
|
+
await queryInterface.removeColumn(table, 'parameters');
|
|
11
|
+
// eslint-disable-next-line no-empty
|
|
12
|
+
} catch (e) {}
|
|
13
|
+
}
|
|
14
|
+
};
|
package/models/stage.js
CHANGED
|
@@ -42,11 +42,7 @@ const MODEL = {
|
|
|
42
42
|
.integer()
|
|
43
43
|
.positive()
|
|
44
44
|
.description('Identifier of the group event')
|
|
45
|
-
.example(123345)
|
|
46
|
-
|
|
47
|
-
createTime: Joi.string()
|
|
48
|
-
.isoDate()
|
|
49
|
-
.description('When this stage was created')
|
|
45
|
+
.example(123345)
|
|
50
46
|
};
|
|
51
47
|
|
|
52
48
|
module.exports = {
|
|
@@ -95,5 +91,5 @@ module.exports = {
|
|
|
95
91
|
* @property indexes
|
|
96
92
|
* @type {Array}
|
|
97
93
|
*/
|
|
98
|
-
indexes: [{ fields: ['pipelineId'] }, { fields: ['groupEventId'
|
|
94
|
+
indexes: [{ fields: ['pipelineId'] }, { fields: ['groupEventId'] }]
|
|
99
95
|
};
|
package/models/template.js
CHANGED
|
@@ -32,8 +32,7 @@ const MODEL = {
|
|
|
32
32
|
.description('When this template was created')
|
|
33
33
|
.example('2038-01-19T03:14:08.131Z'),
|
|
34
34
|
trusted: Joi.boolean().description('Mark whether template is trusted'),
|
|
35
|
-
latest: Joi.boolean().description('Whether this is latest version')
|
|
36
|
-
parameters: Template.parameters
|
|
35
|
+
latest: Joi.boolean().description('Whether this is latest version')
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
const CREATE_MODEL = { ...MODEL, config: Template.configNoDupSteps };
|
|
@@ -65,7 +64,7 @@ module.exports = {
|
|
|
65
64
|
mutate(
|
|
66
65
|
MODEL,
|
|
67
66
|
['id', 'labels', 'name', 'version', 'description', 'maintainer', 'pipelineId'],
|
|
68
|
-
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest'
|
|
67
|
+
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest']
|
|
69
68
|
)
|
|
70
69
|
).label('Get Template'),
|
|
71
70
|
|
|
@@ -79,7 +78,7 @@ module.exports = {
|
|
|
79
78
|
mutate(
|
|
80
79
|
CREATE_MODEL,
|
|
81
80
|
['config', 'name', 'version', 'description', 'maintainer'],
|
|
82
|
-
['labels', 'namespace', 'images'
|
|
81
|
+
['labels', 'namespace', 'images']
|
|
83
82
|
)
|
|
84
83
|
).label('Create Template'),
|
|
85
84
|
|