screwdriver-data-schema 23.3.3 → 23.5.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 +2 -0
- package/models/event.js +2 -1
- package/package.json +1 -1
- package/plugins/scm.js +6 -0
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
package/plugins/scm.js
CHANGED
|
@@ -26,6 +26,7 @@ const ADD_WEBHOOK = Joi.object()
|
|
|
26
26
|
.keys({
|
|
27
27
|
scmUri,
|
|
28
28
|
token,
|
|
29
|
+
scmRepo,
|
|
29
30
|
actions: Joi.array().items(Joi.string()),
|
|
30
31
|
webhookUrl: Joi.string().uri({
|
|
31
32
|
scheme: ['http', 'https']
|
|
@@ -108,6 +109,7 @@ const ADD_PR_COMMENT = Joi.object()
|
|
|
108
109
|
.keys({
|
|
109
110
|
scmUri,
|
|
110
111
|
token,
|
|
112
|
+
scmRepo,
|
|
111
113
|
prNum: core.scm.hook.extract('prNum').required(),
|
|
112
114
|
comments: Joi.array()
|
|
113
115
|
.items(
|
|
@@ -127,6 +129,7 @@ const UPDATE_COMMIT_STATUS = Joi.object()
|
|
|
127
129
|
.keys({
|
|
128
130
|
scmUri,
|
|
129
131
|
token,
|
|
132
|
+
scmRepo,
|
|
130
133
|
sha,
|
|
131
134
|
buildStatus: Joi.string()
|
|
132
135
|
.required()
|
|
@@ -156,6 +159,7 @@ const GET_CHANGED_FILES_INPUT = Joi.object()
|
|
|
156
159
|
type,
|
|
157
160
|
webhookConfig: Joi.object().allow(null).required(),
|
|
158
161
|
token,
|
|
162
|
+
scmRepo,
|
|
159
163
|
scmContext,
|
|
160
164
|
scmUri: scmUri.optional(),
|
|
161
165
|
prNum
|
|
@@ -180,6 +184,7 @@ const DECORATE_COMMIT = Joi.object()
|
|
|
180
184
|
scmUri,
|
|
181
185
|
sha,
|
|
182
186
|
token,
|
|
187
|
+
scmRepo,
|
|
183
188
|
scmContext
|
|
184
189
|
})
|
|
185
190
|
.required();
|
|
@@ -205,6 +210,7 @@ const GET_BRANCH_LIST = Joi.object()
|
|
|
205
210
|
.keys({
|
|
206
211
|
scmUri,
|
|
207
212
|
token,
|
|
213
|
+
scmRepo,
|
|
208
214
|
scmContext
|
|
209
215
|
})
|
|
210
216
|
.required();
|