screwdriver-data-schema 26.1.1 → 26.1.2
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/models/event.js +17 -1
- package/package.json +1 -1
package/models/event.js
CHANGED
|
@@ -20,6 +20,21 @@ const STATUSES = [
|
|
|
20
20
|
'SUCCESS'
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
+
const START_ACTIONS = [
|
|
24
|
+
'START_FROM_LATEST_COMMIT', // Start a new event from latest commit (e.g., Start from "~commit", Start by buildPeriodically annotation)
|
|
25
|
+
// Case of using parentEventId (e.g., v2 UI workflow graph tooltip)
|
|
26
|
+
'START_FROM_EVENT', // Start a new event from specific parent event
|
|
27
|
+
'RESTART_FROM_EVENT', // Restart a new event from specific parent event
|
|
28
|
+
// Case of using buildId (e.g., Job list view, v1 UI workflow graph tooltip, and build log page)
|
|
29
|
+
'RESTART_FROM_BUILD' // Restart a new event from specific parent build
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const startAction = Joi.string()
|
|
33
|
+
.valid(...START_ACTIONS)
|
|
34
|
+
.max(24)
|
|
35
|
+
.description('Start method of the event')
|
|
36
|
+
.example('START_FROM_PARENT_EVENT');
|
|
37
|
+
|
|
23
38
|
const MODEL = {
|
|
24
39
|
id: Joi.number().integer().positive().description('Identifier of this event').example(123345),
|
|
25
40
|
parentEventId: Joi.number()
|
|
@@ -80,7 +95,7 @@ const MODEL = {
|
|
|
80
95
|
.required()
|
|
81
96
|
};
|
|
82
97
|
|
|
83
|
-
const CREATE_MODEL = { ...MODEL, buildId, parentBuildId, parentBuilds, prNum };
|
|
98
|
+
const CREATE_MODEL = { ...MODEL, startAction, buildId, parentBuildId, parentBuilds, prNum };
|
|
84
99
|
|
|
85
100
|
module.exports = {
|
|
86
101
|
/**
|
|
@@ -152,6 +167,7 @@ module.exports = {
|
|
|
152
167
|
[
|
|
153
168
|
'pipelineId',
|
|
154
169
|
'startFrom',
|
|
170
|
+
'startAction',
|
|
155
171
|
'buildId',
|
|
156
172
|
'causeMessage',
|
|
157
173
|
'parentBuildId',
|