screwdriver-data-schema 23.3.3 → 23.4.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.
package/config/regex.js CHANGED
@@ -51,6 +51,8 @@ module.exports = {
51
51
  INTERNAL_TRIGGER: /^~([\w-]+)$/,
52
52
  // Stages can only be named with A-Z,a-z,0-9,-,_
53
53
  STAGE_NAME: /^[\w-]+$/,
54
+ // Stage name prefixed with @stage. Ex: stage@prod
55
+ QUALIFIED_STAGE_NAME: /^stage@([\w-]+)$/,
54
56
  // Stage trigger like ~stage@deploy or ~stage@stageName:jobName or stage@deploy or stage@stageName:jobName
55
57
  STAGE_TRIGGER: /^~?stage@([\w-]+)(?::([\w-]+))?$/,
56
58
  // Don't combine EXTERNAL_TRIGGER and EXTERNAL_TRIGGER_AND for backward compatibility
package/models/event.js CHANGED
@@ -10,6 +10,7 @@ const parentBuildId = require('./build').get.extract('parentBuildId');
10
10
  const parentBuilds = require('./build').get.extract('parentBuilds');
11
11
  const buildId = require('./build').get.extract('id');
12
12
  const prNum = Scm.hook.extract('prNum');
13
+ const { QUALIFIED_STAGE_NAME } = require('../config/regex');
13
14
 
14
15
  const MODEL = {
15
16
  id: Joi.number().integer().positive().description('Identifier of this event').example(123345),
@@ -48,7 +49,7 @@ const MODEL = {
48
49
  .description('SHA of the configuration pipeline this project depends on')
49
50
  .example('ccc49349d3cffbd12ea9e3d41521480b4aa5de5f'),
50
51
  startFrom: Joi.alternatives()
51
- .try(trigger, jobName)
52
+ .try(trigger, jobName, QUALIFIED_STAGE_NAME)
52
53
  .description('Event start point - a job name or trigger name (~commit/~pr)')
53
54
  .example('~commit'),
54
55
  type: Joi.string().valid('pr', 'pipeline').max(10).description('Type of the event').example('pr'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "23.3.3",
3
+ "version": "23.4.0",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {