screwdriver-data-schema 26.1.0 → 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.
@@ -9,8 +9,7 @@ module.exports = {
9
9
  // eslint-disable-next-line no-unused-vars
10
10
  up: async (queryInterface, Sequelize) => {
11
11
  await queryInterface.sequelize.transaction(async transaction => {
12
- await queryInterface.removeIndex(table, `${table}_templateId`, { transaction });
13
-
12
+ await queryInterface.removeIndex(table, `${table}_template_id`, { transaction });
14
13
  await queryInterface.addIndex(table, {
15
14
  name: `${table}_templateId_archived`,
16
15
  fields: ['templateId', 'archived'],
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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "26.1.0",
3
+ "version": "26.1.2",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {