Skip to content

Commit

Permalink
Merge pull request #39 from cloudblue/feature/LITE-28073-Tasks-executor
Browse files Browse the repository at this point in the history
LITE-28073: Refactoring process code. Adding validation for deploymen…
  • Loading branch information
d3rky authored Jul 24, 2023
2 parents b6773e2 + 96727da commit 781b813
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 14,428 deletions.
2 changes: 1 addition & 1 deletion connect_ext_ppr/models/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Deployment(Model):
created_at = db.Column(db.DateTime(), default=datetime.utcnow)
updated_at = db.Column(db.DateTime(), onupdate=datetime.utcnow, default=datetime.utcnow)

product = relationship('Product', backref="deployments")
product = relationship('Product', foreign_keys="Deployment.product_id")


class DeploymentRequest(Model):
Expand Down
6 changes: 6 additions & 0 deletions connect_ext_ppr/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class TasksStatusChoices(str, enum.Enum):
ABORTED = 'aborted'


class TaskTypesChoices(str, enum.Enum):
PPR_VALIDATION = 'ppr_validation'
APPLY_AND_DELEGATE = 'apply_ppr_and_delegate_to_marketplace'
DELEGATE_TO_L2 = 'delegate_to_l2'


class MimeTypeChoices(str, enum.Enum):
application_json = 'application/json'
application_manifest_json = 'application/manifest+json'
Expand Down
3 changes: 2 additions & 1 deletion connect_ext_ppr/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sqlalchemy as db

from connect_ext_ppr.db import Model
from connect_ext_ppr.models.enums import TasksStatusChoices
from connect_ext_ppr.models.enums import TasksStatusChoices, TaskTypesChoices
from connect_ext_ppr.models.deployment import DeploymentRequest


Expand All @@ -20,6 +20,7 @@ class Task(Model):
deployment_request = db.Column(db.ForeignKey(DeploymentRequest.id))
title = db.Column(db.String(100))
error_message = db.Column(db.String((4000)))
type = db.Column(db.Enum(TaskTypesChoices, validate_strings=True))

created_at = db.Column(db.DateTime(), default=datetime.utcnow)
created_by = db.Column(db.String(20))
Expand Down
292 changes: 0 additions & 292 deletions connect_ext_ppr/static/deployment-details.272e874bc9496204df16.js

This file was deleted.

Loading

0 comments on commit 781b813

Please sign in to comment.