Skip to content

Commit ef8ab62

Browse files
authored
♻️ Removes deprecated snapshots (ITISFoundation#2581)
* removed deprecated vc snapshots * Removes old snapshots API from OAS
1 parent 59d913e commit ef8ab62

File tree

15 files changed

+58
-1827
lines changed

15 files changed

+58
-1827
lines changed

api/specs/webserver/openapi-projects.yaml

Lines changed: 0 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -436,202 +436,6 @@ paths:
436436
default:
437437
$ref: "#/components/responses/DefaultErrorResponse"
438438

439-
projects_snapshots:
440-
get:
441-
tags:
442-
- project
443-
- snapshot
444-
summary: List Snapshots
445-
description: Lists all snapshots taken from a given project
446-
operationId: simcore_service_webserver.version_control_handlers_snapshots.list_project_snapshots_handler
447-
parameters:
448-
- required: true
449-
schema:
450-
title: Project Id
451-
type: string
452-
format: uuid
453-
name: project_id
454-
in: path
455-
- description: index to the first item to return (pagination)
456-
required: false
457-
schema:
458-
title: Offset
459-
exclusiveMinimum: false
460-
type: integer
461-
description: index to the first item to return (pagination)
462-
default: 0
463-
name: offset
464-
in: query
465-
- description: maximum number of items to return (pagination)
466-
required: false
467-
schema:
468-
title: Limit
469-
maximum: 50
470-
minimum: 1
471-
type: integer
472-
description: maximum number of items to return (pagination)
473-
default: 20
474-
name: limit
475-
in: query
476-
responses:
477-
"200":
478-
description: Successful Response
479-
content:
480-
application/json:
481-
schema:
482-
title: Response List Snapshots Projects Project Id Snapshots Get
483-
type: array
484-
items:
485-
$ref: "#/components/schemas/SnapshotItem"
486-
"422":
487-
description: Validation Error
488-
content:
489-
application/json:
490-
schema:
491-
$ref: "#/components/schemas/HTTPValidationError"
492-
post:
493-
tags:
494-
- project
495-
- snapshot
496-
summary: Create Snapshot
497-
description: Takes a snapshot of the project at this time
498-
operationId: simcore_service_webserver.version_control_handlers_snapshots.create_project_snapshot_handler
499-
parameters:
500-
- required: true
501-
schema:
502-
title: Project Id
503-
type: string
504-
format: uuid
505-
name: project_id
506-
in: path
507-
- required: false
508-
schema:
509-
title: Snapshot Label
510-
type: string
511-
name: snapshot_label
512-
in: query
513-
responses:
514-
"201":
515-
description: Successful Response
516-
content:
517-
application/json:
518-
schema:
519-
$ref: "#/components/schemas/SnapshotItem"
520-
"422":
521-
description: Validation Error
522-
content:
523-
application/json:
524-
schema:
525-
$ref: "#/components/schemas/HTTPValidationError"
526-
527-
projects_id_snapshots_id:
528-
get:
529-
tags:
530-
- project
531-
- snapshot
532-
summary: Get Snapshot
533-
description: Gets commit info for a given snapshot
534-
operationId: simcore_service_webserver.version_control_handlers_snapshots.get_project_snapshot_handler
535-
parameters:
536-
- required: true
537-
schema:
538-
title: Snapshot Id
539-
exclusiveMinimum: false
540-
type: integer
541-
name: snapshot_id
542-
in: path
543-
- required: true
544-
schema:
545-
title: Project Id
546-
type: string
547-
format: uuid
548-
name: project_id
549-
in: path
550-
responses:
551-
"200":
552-
description: Successful Response
553-
content:
554-
application/json:
555-
schema:
556-
$ref: "#/components/schemas/SnapshotItem"
557-
"422":
558-
description: Validation Error
559-
content:
560-
application/json:
561-
schema:
562-
$ref: "#/components/schemas/HTTPValidationError"
563-
delete:
564-
tags:
565-
- project
566-
- snapshot
567-
summary: Delete Snapshot
568-
description: Deletes both the commit and the project itself
569-
operationId: simcore_service_webserver.version_control_handlers_snapshots.delete_project_snapshot_handler
570-
parameters:
571-
- required: true
572-
schema:
573-
title: Snapshot Id
574-
exclusiveMinimum: false
575-
type: integer
576-
name: snapshot_id
577-
in: path
578-
- required: true
579-
schema:
580-
title: Project Id
581-
type: string
582-
format: uuid
583-
name: project_id
584-
in: path
585-
responses:
586-
"204":
587-
description: Successful Response
588-
"422":
589-
description: Validation Error
590-
content:
591-
application/json:
592-
schema:
593-
$ref: "#/components/schemas/HTTPValidationError"
594-
patch:
595-
tags:
596-
- project
597-
- snapshot
598-
summary: Update Snapshot
599-
description: Updates label/name of a snapshot
600-
operationId: simcore_service_webserver.version_control_handlers_snapshots.patch_project_snapshot_handler
601-
parameters:
602-
- required: true
603-
schema:
604-
title: Snapshot Id
605-
exclusiveMinimum: false
606-
type: integer
607-
name: snapshot_id
608-
in: path
609-
- required: true
610-
schema:
611-
title: Project Id
612-
type: string
613-
format: uuid
614-
name: project_id
615-
in: path
616-
requestBody:
617-
content:
618-
application/json:
619-
schema:
620-
$ref: "#/components/schemas/SnapshotPatchBody"
621-
required: true
622-
responses:
623-
"200":
624-
description: Successful Response
625-
content:
626-
application/json:
627-
schema: {}
628-
"422":
629-
description: Validation Error
630-
content:
631-
application/json:
632-
schema:
633-
$ref: "#/components/schemas/HTTPValidationError"
634-
635439
components:
636440
schemas:
637441
ClientSessionId:
@@ -684,70 +488,6 @@ components:
684488
items:
685489
$ref: "#/components/schemas/ValidationError"
686490

687-
SnapshotPatchBody:
688-
title: SnapshotPatchBody
689-
type: object
690-
properties:
691-
name:
692-
title: Name
693-
type: string
694-
description: Unique human readable display name
695-
description: Model to patch a snapshot resource
696-
697-
SnapshotItem:
698-
title: SnapshotItem
699-
required:
700-
- parent_uuid
701-
- project_uuid
702-
- url
703-
- url_parent
704-
- url_project
705-
type: object
706-
properties:
707-
id:
708-
title: Id
709-
710-
type: integer
711-
description: Unique snapshot identifier
712-
name:
713-
title: Name
714-
type: string
715-
description: Unique human readable display name
716-
created_at:
717-
title: Created At
718-
type: string
719-
description: Timestamp of the time snapshot was taken from parent.Notice that
720-
parent might change with time
721-
format: date-time
722-
parent_uuid:
723-
title: Parent Uuid
724-
type: string
725-
description: Parent's project uuid
726-
format: uuid
727-
project_uuid:
728-
title: Project Uuid
729-
type: string
730-
description: Current project's uuid
731-
format: uuid
732-
url:
733-
title: Url
734-
maxLength: 65536
735-
minLength: 1
736-
type: string
737-
format: uri
738-
url_parent:
739-
title: Url Parent
740-
maxLength: 65536
741-
minLength: 1
742-
type: string
743-
format: uri
744-
url_project:
745-
title: Url Project
746-
maxLength: 65536
747-
minLength: 1
748-
type: string
749-
format: uri
750-
description: Model for a snapshot API resource
751491
ValidationError:
752492
title: ValidationError
753493
required:

api/specs/webserver/openapi.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,6 @@ paths:
212212
/projects/{study_uuid}/tags/{tag_id}:
213213
$ref: "./openapi-projects.yaml#/paths/~1projects~1{study_uuid}~1tags~1{tag_id}"
214214

215-
/projects/{project_id}/snapshots:
216-
$ref: "./openapi-projects.yaml#/paths/projects_snapshots"
217-
218-
/projects/{project_id}/snapshots/{snapshot_id}:
219-
$ref: "./openapi-projects.yaml#/paths/projects_id_snapshots_id"
220215

221216
# REPOSITORY -------------------------------------------------------------------------
222217
/repos/projects:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""removed project-snapshots table
2+
3+
Revision ID: a1b757834a8a
4+
Revises: e1227c539ff4
5+
Create Date: 2021-10-01 13:18:57.108487+00:00
6+
7+
"""
8+
import sqlalchemy as sa
9+
from alembic import op
10+
from sqlalchemy.dialects import postgresql
11+
12+
# revision identifiers, used by Alembic.
13+
revision = "a1b757834a8a"
14+
down_revision = "e1227c539ff4"
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# NOTE: no need to maintain backwards compatibility
21+
# This table was never released
22+
op.drop_table("projects_snapshots")
23+
24+
25+
def downgrade():
26+
# ### commands auto generated by Alembic - please adjust! ###
27+
op.create_table(
28+
"projects_snapshots",
29+
sa.Column("id", sa.BIGINT(), autoincrement=True, nullable=False),
30+
sa.Column("name", sa.VARCHAR(), autoincrement=False, nullable=False),
31+
sa.Column(
32+
"created_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=False
33+
),
34+
sa.Column("parent_uuid", sa.VARCHAR(), autoincrement=False, nullable=False),
35+
sa.Column("project_uuid", sa.VARCHAR(), autoincrement=False, nullable=False),
36+
sa.Column("deleted", sa.BOOLEAN(), autoincrement=False, nullable=True),
37+
sa.ForeignKeyConstraint(
38+
["parent_uuid"],
39+
["projects.uuid"],
40+
name="fk_snapshots_parent_uuid_projects",
41+
ondelete="CASCADE",
42+
),
43+
sa.ForeignKeyConstraint(
44+
["project_uuid"],
45+
["projects.uuid"],
46+
name="fk_snapshots_project_uuid_projects",
47+
ondelete="CASCADE",
48+
),
49+
sa.PrimaryKeyConstraint("id", name="projects_snapshots_pkey"),
50+
sa.UniqueConstraint(
51+
"parent_uuid", "created_at", name="snapshot_from_project_uniqueness"
52+
),
53+
sa.UniqueConstraint("project_uuid", name="projects_snapshots_project_uuid_key"),
54+
)
55+
# ### end Alembic commands ###

packages/postgres-database/src/simcore_postgres_database/models/projects_snapshots.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)