screwdriver-data-schema 22.7.0 → 22.7.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/api/validator.js
CHANGED
|
@@ -36,7 +36,11 @@ const SCHEMA_JOB_PERMUTATION = Joi.object()
|
|
|
36
36
|
secrets: Job.secrets,
|
|
37
37
|
settings: Job.settings,
|
|
38
38
|
sourcePaths: Job.sourcePaths,
|
|
39
|
-
|
|
39
|
+
stage: Joi.object()
|
|
40
|
+
.keys({
|
|
41
|
+
name: Joi.string().regex(Regex.STAGE_NAME).required()
|
|
42
|
+
})
|
|
43
|
+
.unknown(false),
|
|
40
44
|
subscribe: Base.subscribe,
|
|
41
45
|
templateId: Job.templateId
|
|
42
46
|
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
4
|
+
const stagesTable = `${prefix}stages`;
|
|
5
|
+
const stageBuildsTable = `${prefix}stageBuilds`;
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
// eslint-disable-next-line no-unused-vars
|
|
9
|
+
async up(queryInterface, Sequelize) {
|
|
10
|
+
await queryInterface.sequelize.transaction(async transaction => {
|
|
11
|
+
await queryInterface.removeColumn(stagesTable, 'workflowGraph', { transaction });
|
|
12
|
+
await queryInterface.removeColumn(stageBuildsTable, 'workflowGraph', { transaction });
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
package/models/stage.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
const Regex = require('../config/regex');
|
|
5
|
-
const WorkflowGraph = require('../config/workflowGraph');
|
|
6
5
|
const mutate = require('../lib/mutate');
|
|
7
6
|
|
|
8
7
|
const MODEL = {
|
|
@@ -26,15 +25,7 @@ const MODEL = {
|
|
|
26
25
|
|
|
27
26
|
description: Joi.string().max(256).description('Description of the Stage').example('Deploys canary jobs'),
|
|
28
27
|
|
|
29
|
-
archived: Joi.boolean().description('Flag if the stage is archived').example(true).default(false)
|
|
30
|
-
|
|
31
|
-
workflowGraph: WorkflowGraph.workflowGraph.description('Graph representation of the workflow').example({
|
|
32
|
-
nodes: [{ name: '~commit' }, { name: 'main' }, { name: 'publish' }],
|
|
33
|
-
edges: [
|
|
34
|
-
{ src: '~commit', dest: 'main' },
|
|
35
|
-
{ src: 'main', dest: 'publish' }
|
|
36
|
-
]
|
|
37
|
-
})
|
|
28
|
+
archived: Joi.boolean().description('Flag if the stage is archived').example(true).default(false)
|
|
38
29
|
};
|
|
39
30
|
|
|
40
31
|
module.exports = {
|
|
@@ -61,11 +52,7 @@ module.exports = {
|
|
|
61
52
|
* @type {Joi}
|
|
62
53
|
*/
|
|
63
54
|
get: Joi.object(
|
|
64
|
-
mutate(
|
|
65
|
-
MODEL,
|
|
66
|
-
['id', 'pipelineId', 'name', 'jobIds'],
|
|
67
|
-
['description', 'setup', 'teardown', 'archived', 'workflowGraph']
|
|
68
|
-
)
|
|
55
|
+
mutate(MODEL, ['id', 'pipelineId', 'name', 'jobIds'], ['description', 'setup', 'teardown', 'archived'])
|
|
69
56
|
).label('Get Stage metadata'),
|
|
70
57
|
|
|
71
58
|
/**
|
|
@@ -74,9 +61,9 @@ module.exports = {
|
|
|
74
61
|
* @property update
|
|
75
62
|
* @type {Joi}
|
|
76
63
|
*/
|
|
77
|
-
update: Joi.object(
|
|
78
|
-
|
|
79
|
-
)
|
|
64
|
+
update: Joi.object(mutate(MODEL, [], ['jobIds', 'description', 'setup', 'teardown', 'archived'])).label(
|
|
65
|
+
'Update Stage'
|
|
66
|
+
),
|
|
80
67
|
|
|
81
68
|
/**
|
|
82
69
|
* List of fields that determine a unique row
|
package/models/stageBuild.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const Joi = require('joi');
|
|
4
4
|
const mutate = require('../lib/mutate');
|
|
5
|
-
const WorkflowGraph = require('../config/workflowGraph');
|
|
6
5
|
const status = require('./build').base.extract('status');
|
|
7
6
|
|
|
8
7
|
const MODEL = {
|
|
@@ -12,14 +11,6 @@ const MODEL = {
|
|
|
12
11
|
|
|
13
12
|
eventId: Joi.number().integer().positive().description('Identifier of the event').example(123345),
|
|
14
13
|
|
|
15
|
-
workflowGraph: WorkflowGraph.workflowGraph.description('Graph representation of the workflow').example({
|
|
16
|
-
nodes: [{ name: '~commit' }, { name: 'main' }, { name: 'publish' }],
|
|
17
|
-
edges: [
|
|
18
|
-
{ src: '~commit', dest: 'main' },
|
|
19
|
-
{ src: 'main', dest: 'publish' }
|
|
20
|
-
]
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
14
|
status
|
|
24
15
|
};
|
|
25
16
|
|
|
@@ -46,9 +37,7 @@ module.exports = {
|
|
|
46
37
|
* @property get
|
|
47
38
|
* @type {Joi}
|
|
48
39
|
*/
|
|
49
|
-
get: Joi.object(mutate(MODEL, ['id', 'stageId', 'eventId'], ['
|
|
50
|
-
'Get Stage Build metadata'
|
|
51
|
-
),
|
|
40
|
+
get: Joi.object(mutate(MODEL, ['id', 'stageId', 'eventId'], ['status'])).label('Get Stage Build metadata'),
|
|
52
41
|
|
|
53
42
|
/**
|
|
54
43
|
* List of fields that determine a unique row
|