screwdriver-api 4.1.166 → 4.1.170

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.
@@ -11,16 +11,22 @@ queue "Resque(Redis)" as resque
11
11
  participant "unzip worker" as worker
12
12
 
13
13
 
14
- build -> store: store-cli
15
- store -> s3: upload zip file
14
+ build -> store: store-cli\nPUT /builds/{id}/ARTIFACTS/SD_ARTIFACT.zip
15
+ store -> s3: upload zip artifact
16
16
  build -> api: POST /builds/{id}/artifacts/unzip
17
- api -> qservice: POST /queue/message
17
+ api -> qservice: POST /queue/message?type=unzip
18
18
  qservice -> resque: enqueue
19
- qservice --> api: response\n(POST /queue/message)
19
+ qservice --> api: response\n(POST /queue/message?type=unzip)
20
20
  api --> build: response\n(POST /builds/{id}/artifacts/unzip)
21
21
  worker -> resque : dequeue
22
- worker -> store: GET zip artifact
23
- store --> worker: response\nGET zip artifact
24
- worker -> store: upload unzip artifacts
22
+ worker -> store: GET /builds/{id}/ARTIFACTS/SD_ARTIFACT.zip
23
+ store -> s3: download zip artifact
24
+ store --> worker: response\n(GET /builds/{id}/ARTIFACTS/SD_ARTIFACT.zip)
25
+ worker -> store: PUT /builds/{id}/ARTIFACTS/*
26
+ store -> s3: upload unzip artifacts
27
+ store --> worker: response\n(PUT /builds/{id}/ARTIFACTS/*)
28
+ worker -> store: DELETE /builds/{id}/ARTIFACTS/SD_ARTIFACT.zip
29
+ store -> s3: delete zip artifact
30
+ store --> worker: response\n(DELETE /builds/{id}/ARTIFACTS/SD_ARTIFACT.zip)
25
31
 
26
32
  @enduml
@@ -18,7 +18,7 @@ Outline:
18
18
  1. upload zip file to Object Storage(S3) (sd build -> store -> S3)
19
19
  1. notify to queue-service after upload zip file (sd build -> api -> queue-service)
20
20
  1. send a message to unzip file (queue-service -> Resque)
21
- 1. a consumer(unzip worker) receives the message, then the consumer downloads the zip file and unzips it, re-uploads unzipped files
21
+ 1. a consumer(unzip worker) receives the message, then the consumer downloads the zip file and unzips it, re-uploads unzipped files, deletes the zip file
22
22
 
23
23
  ## Flow(Details)
24
24
 
@@ -41,7 +41,7 @@ Outline:
41
41
 
42
42
  Use sd-token to allow only requests when the build ID in the token and the id in the path are the same.
43
43
 
44
- ##### POST DATA
44
+ ##### Parameters
45
45
 
46
46
  |Name|Type|In|Description|Example|
47
47
  |:--|:--|:--|:--|:--|
@@ -97,7 +97,7 @@ Status(Error):
97
97
 
98
98
  Use sd-token to only allow requests from SD API
99
99
 
100
- ##### POST DATA
100
+ ##### Parameters
101
101
 
102
102
  |Name|Type|In|Description|Example|
103
103
  |:--|:--|:--|:--|:--|
@@ -134,12 +134,28 @@ This is a new component.
134
134
  1. If retry fails
135
135
  1. Add a statusMessage to the build to notify the user that the unzip has failed
136
136
  1. Log the failure.
137
+ 1. Delete SD_ARTIFACT.zip
137
138
 
138
139
  ### SD Store (store)
140
+ Enable the following operations from unzip worker
141
+ 1. Download SD_ARTIFACT.zip
142
+ 1. Upload unzipped artifact files
143
+ 1. Delete SD_ARTIFACT.zip
139
144
 
140
- 1. Upload and Download artifact files
145
+ #### API
141
146
 
142
- SD Store do not need to add new function, but need to add new Authentication.
147
+ |Method|URL|Description|
148
+ |:--|:--|:--|
149
+ |DELETE|/builds/{id}/{artifact*}|delete zipped artifact files|
150
+
151
+ ##### Authentication & Authorization
143
152
 
144
- - Able to Upload and Download artifact files by unzip worker scope token
153
+ - Able to Upload, Download, and Delete artifact files by unzip worker scope token
145
154
  - Return an error if the build id of the build artifacts to be operated is different from the build id contained in the token
155
+
156
+ ##### Parameters
157
+
158
+ |Name|Type|In|Description|Example|
159
+ |:--|:--|:--|:--|:--|
160
+ |id|integer|path|build ID|12|
161
+ |artifact*|string|path|path to artifact|ARTIFACTS/SD_ARTIFACT.zip|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "4.1.166",
3
+ "version": "4.1.170",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -73,12 +73,12 @@
73
73
  "@hapi/good": "^9.0.1",
74
74
  "@hapi/good-console": "^9.0.1",
75
75
  "@hapi/good-squeeze": "^6.0.0",
76
- "@hapi/hapi": "^20.1.5",
76
+ "@hapi/hapi": "^20.2.1",
77
77
  "@hapi/hoek": "^9.1.1",
78
78
  "@hapi/inert": "^6.0.4",
79
79
  "@hapi/vision": "^6.1.0",
80
80
  "@promster/hapi": "^4.2.1",
81
- "async": "^3.2.1",
81
+ "async": "^3.2.2",
82
82
  "badge-maker": "^3.3.1",
83
83
  "config": "^1.31.0",
84
84
  "date-fns": "^1.30.1",
@@ -87,7 +87,7 @@
87
87
  "hapi-auth-jwt2": "^10.2.0",
88
88
  "hapi-rate-limit": "^5.0.1",
89
89
  "hapi-swagger": "^14.2.4",
90
- "ioredis": "^4.27.9",
90
+ "ioredis": "^4.28.0",
91
91
  "joi": "^17.4.2",
92
92
  "js-yaml": "^3.14.1",
93
93
  "jsonwebtoken": "^8.5.1",
@@ -101,26 +101,26 @@
101
101
  "screwdriver-build-bookend": "^2.4.0",
102
102
  "screwdriver-cache-bookend": "^2.0.2",
103
103
  "screwdriver-command-validator": "^2.1.0",
104
- "screwdriver-config-parser": "^7.2.0",
104
+ "screwdriver-config-parser": "^7.4.0",
105
105
  "screwdriver-coverage-bookend": "^1.0.3",
106
- "screwdriver-coverage-sonar": "^3.3.1",
107
- "screwdriver-data-schema": "^21.8.2",
106
+ "screwdriver-coverage-sonar": "^3.3.3",
107
+ "screwdriver-data-schema": "^21.12.0",
108
108
  "screwdriver-datastore-sequelize": "^7.2.7",
109
109
  "screwdriver-executor-base": "^8.4.0",
110
110
  "screwdriver-executor-docker": "^5.0.1",
111
- "screwdriver-executor-k8s": "^14.14.4",
111
+ "screwdriver-executor-k8s": "^14.16.0",
112
112
  "screwdriver-executor-k8s-vm": "^4.3.2",
113
113
  "screwdriver-executor-queue": "^3.1.2",
114
114
  "screwdriver-executor-router": "^2.3.0",
115
115
  "screwdriver-logger": "^1.1.0",
116
- "screwdriver-models": "^28.8.7",
116
+ "screwdriver-models": "^28.11.0",
117
117
  "screwdriver-notifications-email": "^2.2.0",
118
118
  "screwdriver-notifications-slack": "^3.2.1",
119
119
  "screwdriver-request": "^1.0.3",
120
120
  "screwdriver-scm-base": "^7.3.0",
121
121
  "screwdriver-scm-bitbucket": "^4.5.1",
122
- "screwdriver-scm-github": "^11.6.1",
123
- "screwdriver-scm-gitlab": "^2.7.0",
122
+ "screwdriver-scm-github": "^11.6.3",
123
+ "screwdriver-scm-gitlab": "^2.7.2",
124
124
  "screwdriver-scm-router": "^6.3.0",
125
125
  "screwdriver-template-validator": "^5.2.0",
126
126
  "screwdriver-workflow-parser": "^3.2.0",
@@ -128,7 +128,7 @@
128
128
  "stream": "0.0.2",
129
129
  "tinytim": "^0.1.1",
130
130
  "uuid": "^8.3.2",
131
- "verror": "^1.6.1"
131
+ "verror": "^1.10.1"
132
132
  },
133
133
  "release": {
134
134
  "debug": false,
@@ -137,7 +137,7 @@
137
137
  }
138
138
  },
139
139
  "devDependencies": {
140
- "@octokit/rest": "^18.10.0",
140
+ "@octokit/rest": "^18.12.0",
141
141
  "chai": "~3.5.0",
142
142
  "chai-as-promised": "^6.0.0",
143
143
  "chai-jwt": "^2.0.0",
@@ -152,7 +152,7 @@
152
152
  "mocha-sonarqube-reporter": "^1.0.2",
153
153
  "mockery": "^2.0.0",
154
154
  "mz": "^2.6.0",
155
- "nock": "^13.0.0",
155
+ "nock": "^13.2.1",
156
156
  "node-plantuml": "^0.5.0",
157
157
  "npm-auto-version": "^1.0.0",
158
158
  "nyc": "^15.0.0",
@@ -37,16 +37,7 @@ const formatCheckoutUrl = checkoutUrl => {
37
37
  * @return {String} Root dir with no leading/trailing slashes
38
38
  */
39
39
  const sanitizeRootDir = (rootDir = '') => {
40
- // eslint-disable-next-line max-len
41
- const DIR_PATH_REGEX = /^([a-zA-Z0-9\s_@\-^!#$%&+={}[\]]+)(\/[a-zA-Z0-9\s_@\-^!#$%&+={}[\]]+)*$/;
42
- const sanitizedRootDir = rootDir.replace(/^(\/+|.\/)|\/+$/g, '');
43
-
44
- // Set rootDir as empty string if invalid
45
- if (!DIR_PATH_REGEX.test(sanitizedRootDir)) {
46
- return '';
47
- }
48
-
49
- return sanitizedRootDir;
40
+ return rootDir.replace(/^(\/+|.\/|..\/)|\/+$/g, '');
50
41
  };
51
42
 
52
43
  /**