screwdriver-data-schema 22.9.6 → 22.9.8
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 -1
- package/models/job.js +1 -1
- package/models/pipeline.js +11 -3
- package/package.json +1 -1
package/config/regex.js
CHANGED
|
@@ -41,7 +41,8 @@ module.exports = {
|
|
|
41
41
|
// Steps can only be named with A-Z,a-z,0-9,-,_
|
|
42
42
|
STEP_NAME: /^[\w-]+$/,
|
|
43
43
|
// Jobs can only be named with A-Z,a-z,0-9,-,_
|
|
44
|
-
|
|
44
|
+
// Also allow stage setup/teardown like stage@stage-name:setup
|
|
45
|
+
JOB_NAME: /^(([\w-]+)|(?:stage@([\w-]+):(setup|teardown)))$/,
|
|
45
46
|
// PR JOB Name can only be PR-1 or PR-1:main, group1: PR-prNum, group2: jobName
|
|
46
47
|
PR_JOB_NAME: /^(PR-\d+)(?::([\w-]+))?$/,
|
|
47
48
|
// Match all possible job name
|
package/models/job.js
CHANGED
|
@@ -9,7 +9,7 @@ const MODEL = {
|
|
|
9
9
|
id: Joi.number().integer().positive().description('Identifier of this Job').example(123345),
|
|
10
10
|
|
|
11
11
|
name: Joi.string()
|
|
12
|
-
.regex(/^(PR-[0-9]+:)?[\w-]
|
|
12
|
+
.regex(/^(PR-[0-9]+:)?(([\w-]+)|(?:stage@([\w-]+):(setup|teardown)))$/)
|
|
13
13
|
.max(110)
|
|
14
14
|
.description('Name of the Job')
|
|
15
15
|
.example('main'),
|
package/models/pipeline.js
CHANGED
|
@@ -12,11 +12,19 @@ const mutate = require('../lib/mutate');
|
|
|
12
12
|
|
|
13
13
|
const STATES = ['ACTIVE', 'INACTIVE'];
|
|
14
14
|
const BADGE = Joi.object({
|
|
15
|
-
|
|
15
|
+
defaultName: Joi.string()
|
|
16
|
+
.max(128)
|
|
17
|
+
.description('Auto populated dashboard name for a badge')
|
|
18
|
+
.example('screwdriver/ui'),
|
|
19
|
+
defaultUri: Joi.string()
|
|
20
|
+
.max(500)
|
|
21
|
+
.description('Auto populated url for the badge application dashboard')
|
|
22
|
+
.example('https://sonar.screwdriver.cd/dashboard?id=112233'),
|
|
23
|
+
name: Joi.string().max(128).description('The dashboard name for a badge').example('my-screwdriver/ui'),
|
|
16
24
|
uri: Joi.string()
|
|
17
25
|
.max(500)
|
|
18
|
-
.description('
|
|
19
|
-
.example('https://sonar.screwdriver.cd/dashboard?id=112233')
|
|
26
|
+
.description('The url the badge application dashboard')
|
|
27
|
+
.example('https://my-sonar.screwdriver.cd/dashboard?id=112233')
|
|
20
28
|
});
|
|
21
29
|
|
|
22
30
|
const CREATE_MODEL = {
|