screwdriver-data-schema 23.7.0 → 23.9.0

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.
@@ -6,7 +6,6 @@ const Annotations = require('./annotations');
6
6
  const Parameters = require('./parameters');
7
7
  const Template = require('./template');
8
8
  const Regex = require('./regex');
9
- const WorkflowGraph = require('./workflowGraph');
10
9
 
11
10
  const SCHEMA_CONFIG = Joi.object()
12
11
  .keys({
@@ -16,8 +15,7 @@ const SCHEMA_CONFIG = Joi.object()
16
15
  annotations: Annotations.annotations,
17
16
  cache: BaseSchema.cache,
18
17
  subscribe: BaseSchema.subscribe,
19
- stages: BaseSchema.stages,
20
- workflowGraph: WorkflowGraph.workflowGraph
18
+ stages: BaseSchema.stages
21
19
  })
22
20
  .unknown(false);
23
21
 
package/config/regex.js CHANGED
@@ -45,6 +45,8 @@ module.exports = {
45
45
  JOB_NAME: /^(([\w-]+)|(?:stage@([\w-]+):(setup|teardown)))$/,
46
46
  // PR JOB Name can only be PR-1 or PR-1:main, group1: PR-prNum, group2: jobName
47
47
  PR_JOB_NAME: /^(PR-\d+)(?::([\w-]+))?$/,
48
+ // Stage setup or teardown job name. Can be stage@stage-name:setup or stage@stage-name:teardown
49
+ STAGE_SETUP_TEARDOWN_JOB_NAME: /^stage@([\w-]+):(setup|teardown)$/,
48
50
  // Match all possible job name
49
51
  ALL_JOB_NAME: /^(PR-[0-9]+:)?[\w-@:]+$/,
50
52
  // Internal trigger like ~component or ~main
@@ -12,8 +12,8 @@ module.exports = {
12
12
  table,
13
13
  'state',
14
14
  {
15
- type: Sequelize.STRING(10),
16
- defaultValue: 'ACTIVE',
15
+ type: Sequelize.TEXT,
16
+ defaultValue: '{}',
17
17
  allowNull: false
18
18
  },
19
19
  { transaction }
@@ -4,6 +4,7 @@ const Joi = require('joi');
4
4
  const mutate = require('../lib/mutate');
5
5
  const pipelineTemplateVersions = require('../config/pipelineTemplate');
6
6
  const JobTemplateConfig = require('../config/template');
7
+ const WorkflowGraph = require('../config/workflowGraph');
7
8
  const templateId = require('./templateMeta').base.extract('id');
8
9
 
9
10
  const MODEL = {
@@ -17,6 +18,10 @@ const MODEL = {
17
18
  .max(32)
18
19
  .description('When this template was created')
19
20
  .example('2038-01-19T03:14:08.131Z')
21
+ .required(),
22
+ workflowGraph: WorkflowGraph.workflowGraph
23
+ .description('Graph representation of the workflow')
24
+ .default('{"nodes": [],"edges":[]}')
20
25
  .required()
21
26
  };
22
27
 
@@ -43,9 +48,9 @@ module.exports = {
43
48
  * @property get
44
49
  * @type {Joi}
45
50
  */
46
- get: Joi.object(mutate(MODEL, ['id', 'templateId', 'version'], ['description', 'config', 'createTime'])).label(
47
- 'Get Template'
48
- ),
51
+ get: Joi.object(
52
+ mutate(MODEL, ['id', 'templateId', 'version'], ['description', 'config', 'createTime', 'workflowGraph'])
53
+ ).label('Get Template'),
49
54
 
50
55
  /**
51
56
  * List of fields that determine a unique row
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "23.7.0",
3
+ "version": "23.9.0",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {