Skip to content

Commit e92177f

Browse files
GitHKAndrei Neagu
and
Andrei Neagu
authored
General fixes to import/export (#2120)
* quality was missing from serialization * archving upgraded for better extract performance * updated openapi specs * added study duplication API * fixed module arhciving tests * fixed archiving tests * archiving was refactored: - destination_folder is required for archiving and unarchiving - no more race conditions during parallel unrachive * minor refactor * using new archiving interface * added tests to check duplication of project * removed comment * test no longer hangs * adding loop to all the tests * explicitly adding loop * fixing pylint * removing comment * replaced with TempraryDirectory * moved comment to a better spot * renaming function * removing uncecessary loop * removing loop where not needed * removing loop * minor refactor * added storage file checksum checking * removing adminer * renmed properly Co-authored-by: Andrei Neagu <[email protected]>
1 parent e684b94 commit e92177f

File tree

11 files changed

+699
-597
lines changed

11 files changed

+699
-597
lines changed

api/specs/webserver/openapi-projects.yaml

+30-8
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ paths:
201201
required: true
202202
schema:
203203
type: string
204-
- name: compressed
205-
in: query
206-
required: false
207-
schema:
208-
type: boolean
209204
post:
210205
tags:
211206
- exporter
@@ -222,6 +217,31 @@ paths:
222217
default:
223218
$ref: "#/components/responses/DefaultErrorResponse"
224219

220+
/projects/{project_id}/duplicate:
221+
parameters:
222+
- name: project_id
223+
in: path
224+
required: true
225+
schema:
226+
type: string
227+
post:
228+
tags:
229+
- exporter
230+
summary: duplicates an existing project
231+
operationId: duplicate_project
232+
responses:
233+
"200":
234+
description: project was duplicated correctly
235+
content:
236+
application/json:
237+
schema:
238+
type: object
239+
properties:
240+
uuid:
241+
type: string
242+
default:
243+
$ref: "#/components/responses/DefaultErrorResponse"
244+
225245
/projects/import:
226246
post:
227247
tags:
@@ -238,13 +258,15 @@ paths:
238258
type: string
239259
format: binary
240260
responses:
241-
"201":
261+
"200":
242262
description: creates a new project from an archive
243263
content:
244264
application/json:
245265
schema:
246-
#TODO: change this with an OK response
247-
$ref: "#/components/schemas/ProjectEnveloped"
266+
type: object
267+
properties:
268+
uuid:
269+
type: string
248270
default:
249271
$ref: "#/components/responses/DefaultErrorResponse"
250272

api/specs/webserver/openapi.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ paths:
171171
/projects/{project_id}:xport:
172172
$ref: "./openapi-projects.yaml#/paths/~1projects~1{project_id}~1xport"
173173

174+
/projects/{project_id}:duplicate:
175+
$ref: "./openapi-projects.yaml#/paths/~1projects~1{project_id}~1duplicate"
176+
174177
/projects:import:
175178
$ref: "./openapi-projects.yaml#/paths/~1projects~1import"
176179

packages/models-library/src/models_library/projects.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ class Project(BaseModel):
8787
ui: Optional[StudyUI] = None
8888

8989
# Quality
90-
quality: Dict[str, Any] = {}
90+
quality: Dict[str, Any] = Field(
91+
{}, description="stores the study quality assessment"
92+
)
9193

9294
# Dev only
9395
dev: Optional[Dict] = Field(description="object used for development purposes only")

0 commit comments

Comments
 (0)