screwdriver-data-schema 21.25.1 → 21.26.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.
- package/config/base.js +1 -2
- package/config/regex.js +0 -2
- package/config/settings.js +6 -1
- package/migrations/{20220628180148-remove_pr_jobs_invalid_name.js → 20220628-remove_pr_jobs_invalid_name.js} +0 -0
- package/migrations/20220705-upd-stage-color-eventId-createTime.js +42 -0
- package/models/stage.js +7 -14
- package/package.json +3 -3
package/config/base.js
CHANGED
package/config/regex.js
CHANGED
|
@@ -49,8 +49,6 @@ module.exports = {
|
|
|
49
49
|
INTERNAL_TRIGGER: /^~([\w-]+)$/,
|
|
50
50
|
// Stages can only be named with A-Z,a-z,0-9,-,_
|
|
51
51
|
STAGE_NAME: /^[\w-]+$/,
|
|
52
|
-
// Stages can only be named with valid hex CSS color
|
|
53
|
-
STAGE_COLOR: /^#(?:[0-9a-fA-F]{3}){1,2}$/,
|
|
54
52
|
|
|
55
53
|
// Don't combine EXTERNAL_TRIGGER and EXTERNAL_TRIGGER_AND for backward compatibility
|
|
56
54
|
// BlockBy does not support EXTERNAL_TRIGGER_AND
|
package/config/settings.js
CHANGED
|
@@ -31,7 +31,12 @@ const SCHEMA_PIPELINE_SETTINGS = Joi.object()
|
|
|
31
31
|
public: Joi.boolean(),
|
|
32
32
|
groupedEvents: Joi.boolean().optional(),
|
|
33
33
|
showEventTriggers: Joi.boolean().optional(),
|
|
34
|
-
filterEventsForNoBuilds: Joi.boolean().optional()
|
|
34
|
+
filterEventsForNoBuilds: Joi.boolean().optional(),
|
|
35
|
+
aliasName: Joi.string()
|
|
36
|
+
.max(32)
|
|
37
|
+
.description('A customizable alias for pipeline name')
|
|
38
|
+
.example('scwdvr-cd')
|
|
39
|
+
.optional()
|
|
35
40
|
})
|
|
36
41
|
.default({});
|
|
37
42
|
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable new-cap */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
6
|
+
const table = `${prefix}stages`;
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
// eslint-disable-next-line no-unused-vars
|
|
10
|
+
up: async (queryInterface, Sequelize) => {
|
|
11
|
+
await queryInterface.sequelize.transaction(async transaction => {
|
|
12
|
+
try {
|
|
13
|
+
await queryInterface.removeColumn(table, 'color');
|
|
14
|
+
|
|
15
|
+
await queryInterface.removeColumn(table, 'state');
|
|
16
|
+
|
|
17
|
+
await queryInterface.addColumn(
|
|
18
|
+
table,
|
|
19
|
+
'groupEventId',
|
|
20
|
+
{
|
|
21
|
+
type: Sequelize.DOUBLE
|
|
22
|
+
},
|
|
23
|
+
{ transaction }
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
await queryInterface.addConstraint(table, {
|
|
27
|
+
name: `${table}_pipeline_id_name_group_event_id_key`,
|
|
28
|
+
fields: ['pipelineId', 'name', 'groupEventId'],
|
|
29
|
+
type: 'unique',
|
|
30
|
+
transaction
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
await queryInterface.addIndex(table, {
|
|
34
|
+
name: `${table}_group_event_id_create_time`,
|
|
35
|
+
fields: ['groupEventId'],
|
|
36
|
+
transaction
|
|
37
|
+
});
|
|
38
|
+
// eslint-disable-next-line no-empty
|
|
39
|
+
} catch (e) {}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
package/models/stage.js
CHANGED
|
@@ -33,23 +33,16 @@ const MODEL = {
|
|
|
33
33
|
)
|
|
34
34
|
.description('Job IDs in this Stage'),
|
|
35
35
|
|
|
36
|
-
state: Joi.string()
|
|
37
|
-
.valid('ARCHIVED', 'ACTIVE')
|
|
38
|
-
.max(10)
|
|
39
|
-
.description('Current state of the Stage')
|
|
40
|
-
.example('ARCHIVED')
|
|
41
|
-
.default('ACTIVE'),
|
|
42
|
-
|
|
43
36
|
description: Joi.string()
|
|
44
37
|
.max(256)
|
|
45
38
|
.description('Description of the Stage')
|
|
46
39
|
.example('Deploys canary jobs'),
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
.
|
|
50
|
-
.
|
|
51
|
-
.description('
|
|
52
|
-
.example(
|
|
41
|
+
groupEventId: Joi.number()
|
|
42
|
+
.integer()
|
|
43
|
+
.positive()
|
|
44
|
+
.description('Identifier of the group event')
|
|
45
|
+
.example(123345)
|
|
53
46
|
};
|
|
54
47
|
|
|
55
48
|
module.exports = {
|
|
@@ -75,7 +68,7 @@ module.exports = {
|
|
|
75
68
|
* @property keys
|
|
76
69
|
* @type {Array}
|
|
77
70
|
*/
|
|
78
|
-
keys: ['pipelineId', 'name'],
|
|
71
|
+
keys: ['pipelineId', 'name', 'groupEventId'],
|
|
79
72
|
|
|
80
73
|
/**
|
|
81
74
|
* List of all fields in the model
|
|
@@ -98,5 +91,5 @@ module.exports = {
|
|
|
98
91
|
* @property indexes
|
|
99
92
|
* @type {Array}
|
|
100
93
|
*/
|
|
101
|
-
indexes: [{ fields: ['pipelineId'] }]
|
|
94
|
+
indexes: [{ fields: ['pipelineId'] }, { fields: ['groupEventId'] }]
|
|
102
95
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "screwdriver-data-schema",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.26.2",
|
|
4
4
|
"description": "Internal Data Schema of Screwdriver",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"npx": "^10.2.2",
|
|
51
51
|
"nyc": "^15.0.0",
|
|
52
52
|
"pg": "^7.18.2",
|
|
53
|
-
"sequelize": "^6.21.
|
|
53
|
+
"sequelize": "^6.21.3",
|
|
54
54
|
"sequelize-cli": "^6.4.1",
|
|
55
55
|
"sqlite3": "^4.2.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"cron-parser": "^4.
|
|
58
|
+
"cron-parser": "^4.5.0",
|
|
59
59
|
"joi": "^17.6.0"
|
|
60
60
|
}
|
|
61
61
|
}
|