Skip to content

Commit 53fb7ee

Browse files
Erik Stoeltvdven
authored andcommitted
Add support for "RECONCILE" workflow target across schemas, tasks, and helpers
1 parent bdb7eea commit 53fb7ee

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

orchestrator/devtools/populator.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,22 @@ def start_modify_workflow(self, workflow_name: str, subscription_id: UUIDstr | U
371371
self.log.info("Started modify workflow")
372372
return self._start_workflow(workflow_name, subscription_id=subscription_id, **kwargs)
373373

374+
def start_reconcile_workflow(self, workflow_name: str, subscription_id: UUIDstr | UUID, **kwargs: Any) -> UUIDstr:
375+
"""Start a modify workflow for the provided name and subscription_id.
376+
377+
Args:
378+
workflow_name: workflow name
379+
subscription_id: uuid of the subscription you want to modify
380+
kwargs: values to be used as form input
381+
382+
Returns: the process_id of the workflow process
383+
384+
"""
385+
subscription_id = str(subscription_id)
386+
self.log = self.log.bind(subscription_id=subscription_id)
387+
self.log.info("Started reconcile workflow")
388+
return self._start_workflow(workflow_name, subscription_id=subscription_id, **kwargs)
389+
374390
def start_verify_workflow(self, workflow_name: str, subscription_id: UUIDstr | UUID) -> UUIDstr:
375391
subscription_id = str(subscription_id)
376392
self.log = self.log.bind(subscription_id=subscription_id)

orchestrator/migrations/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def create_workflow(conn: sa.engine.Connection, workflow: dict) -> None:
155155
conn: DB connection as available in migration main file.
156156
workflow: Dict with data for a new workflow.
157157
name: Name of the workflow.
158-
target: Target of the workflow ("CREATE", "MODIFY", "TERMINATE", "SYSTEM")
158+
target: Target of the workflow ("CREATE", "MODIFY", "RECONCILE", "TERMINATE", "SYSTEM")
159159
description: Description of the workflow.
160160
product_type: Product type to add the workflow to.
161161

orchestrator/schemas/workflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class SubscriptionWorkflowListsSchema(OrchestratorBaseModel):
6060
modify: list[WorkflowListItemSchema]
6161
terminate: list[WorkflowListItemSchema]
6262
system: list[WorkflowListItemSchema]
63+
reconcile: list[WorkflowListItemSchema]
6364
validate_: list[WorkflowListItemSchema] = Field(default_factory=list, alias="validate")
6465

6566

orchestrator/workflows/tasks/validate_products.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def check_that_products_have_create_modify_and_terminate_workflows() -> State:
105105
product_data = get_products(filters=[ProductTable.status == "active"])
106106

107107
workflows_not_complete: list = []
108-
targets = ["CREATE", "TERMINATE", "MODIFY", "VALIDATE"]
108+
targets = ["CREATE", "TERMINATE", "MODIFY", "RECONCILE", "VALIDATE"]
109109
for product in product_data:
110110
workflows = {c.target for c in product.workflows if c.target in targets and c.name != "modify_note"}
111111
if len(workflows) < len(targets):

0 commit comments

Comments
 (0)