screwdriver-data-schema 25.1.4 → 25.2.1

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
+ 'use strict';
2
+
3
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
4
+ const table = `${prefix}pipelines`;
5
+
6
+ module.exports = {
7
+ up: async (queryInterface, Sequelize) => {
8
+ await queryInterface.sequelize.transaction(async transaction => {
9
+ await queryInterface.addColumn(
10
+ table,
11
+ 'adminUserIds',
12
+ {
13
+ type: Sequelize.TEXT,
14
+ defaultValue: '[]',
15
+ allowNull: false
16
+ },
17
+ { transaction }
18
+ );
19
+ });
20
+ }
21
+ };
@@ -63,8 +63,17 @@ const MODEL = {
63
63
 
64
64
  createTime: Joi.string().isoDate().description('When this pipeline was created'),
65
65
 
66
+ // This holds the SCM usernames belonging to the pipeline SCM context who have admin privileges.
67
+ // This should eventually be completely replaced by adminUserIds. Keeping this for now for backward compatibility.
66
68
  admins: Joi.object().description('Admins of this Pipeline').example({ myself: true }),
67
69
 
70
+ // Besides users from the pipeline SCM context, this can hold users outside pipeline SCM context who have admin privileges for this pipeline.
71
+ adminUserIds: Joi.array()
72
+ .items(Joi.number().integer().positive().description('Identifier of the user').example(12345))
73
+ .description('IDs of the users who have admin privileges for this pipeline')
74
+ .example('[12345, 6789]')
75
+ .default([]),
76
+
68
77
  workflowGraph: WorkflowGraph.workflowGraph.description('Graph representation of the workflow'),
69
78
 
70
79
  annotations: Annotations.annotations.description('Pipeline-level annotations'),
@@ -165,7 +174,8 @@ module.exports = {
165
174
  'subscribedScmUrlsWithActions',
166
175
  'settings',
167
176
  'badges',
168
- 'templateVersionId'
177
+ 'templateVersionId',
178
+ 'adminUserIds'
169
179
  ]
170
180
  )
171
181
  ).label('Get Pipeline'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "25.1.4",
3
+ "version": "25.2.1",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -50,8 +50,8 @@
50
50
  "mysql2": "^1.7.0",
51
51
  "npx": "^3.0.0",
52
52
  "nyc": "^15.1.0",
53
- "pg": "^7.18.2",
54
- "sequelize": "^6.37.5",
53
+ "pg": "^8.14.1",
54
+ "sequelize": "^6.37.6",
55
55
  "sequelize-cli": "^6.6.2",
56
56
  "sqlite3": "^5.1.7"
57
57
  },