screwdriver-data-schema 24.0.2 → 24.1.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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-disable new-cap */
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
6
|
+
const table = `${prefix}builds`;
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
up: async (queryInterface, Sequelize) => {
|
|
10
|
+
await queryInterface.sequelize.transaction(async transaction => {
|
|
11
|
+
await queryInterface.addColumn(
|
|
12
|
+
table,
|
|
13
|
+
'statusMessageType',
|
|
14
|
+
{
|
|
15
|
+
type: Sequelize.STRING(10)
|
|
16
|
+
},
|
|
17
|
+
{ transaction }
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
package/models/build.js
CHANGED
|
@@ -22,6 +22,7 @@ const STATUSES = [
|
|
|
22
22
|
'COLLAPSED', // when the build is collapsed
|
|
23
23
|
'FROZEN' // when the build is frozen due to freeze window
|
|
24
24
|
];
|
|
25
|
+
const STATUS_MESSAGE_TYPES = ['ERROR', 'WARN', 'INFO'];
|
|
25
26
|
|
|
26
27
|
const MODEL = {
|
|
27
28
|
id: Joi.number().integer().positive().description('Identifier of this build').example(123345),
|
|
@@ -85,6 +86,12 @@ const MODEL = {
|
|
|
85
86
|
.description('Status message to describe status of the build')
|
|
86
87
|
.example('Build failed due to infrastructure error'),
|
|
87
88
|
|
|
89
|
+
statusMessageType: Joi.string()
|
|
90
|
+
.valid(...STATUS_MESSAGE_TYPES)
|
|
91
|
+
.max(10)
|
|
92
|
+
.description('Severity of the status message')
|
|
93
|
+
.example('WARN'),
|
|
94
|
+
|
|
88
95
|
stats: Joi.object()
|
|
89
96
|
.keys({
|
|
90
97
|
queueEnterTime: Joi.string().isoDate().description('When this build enters queue'),
|
|
@@ -158,6 +165,7 @@ module.exports = {
|
|
|
158
165
|
'eventId',
|
|
159
166
|
'environment',
|
|
160
167
|
'statusMessage',
|
|
168
|
+
'statusMessageType',
|
|
161
169
|
'stats',
|
|
162
170
|
'buildClusterName',
|
|
163
171
|
'templateId',
|
|
@@ -172,7 +180,9 @@ module.exports = {
|
|
|
172
180
|
* @property update
|
|
173
181
|
* @type {Joi}
|
|
174
182
|
*/
|
|
175
|
-
update: Joi.object(mutate(MODEL, [], ['status', 'meta', 'statusMessage', 'stats'])).label(
|
|
183
|
+
update: Joi.object(mutate(MODEL, [], ['status', 'meta', 'statusMessage', 'statusMessageType', 'stats'])).label(
|
|
184
|
+
'Update Build'
|
|
185
|
+
),
|
|
176
186
|
|
|
177
187
|
/**
|
|
178
188
|
* Properties for Build that will be passed during a CREATE request
|
|
@@ -223,6 +233,14 @@ module.exports = {
|
|
|
223
233
|
*/
|
|
224
234
|
allKeys: Object.keys(MODEL),
|
|
225
235
|
|
|
236
|
+
/**
|
|
237
|
+
* All the available status message type
|
|
238
|
+
*
|
|
239
|
+
* @property allStatusMessageTypes
|
|
240
|
+
* @type {Array}
|
|
241
|
+
*/
|
|
242
|
+
allStatusMessageTypes: STATUS_MESSAGE_TYPES,
|
|
243
|
+
|
|
226
244
|
/**
|
|
227
245
|
* Tablename to be used in the datastore
|
|
228
246
|
*
|