Skip to content

Commit

Permalink
refactor: Remove deprecated action key (#687)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Lo <[email protected]>
  • Loading branch information
daryllimyt and topher-lo authored Jan 4, 2025
1 parent b1d79da commit 3dffa62
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 24 deletions.
12 changes: 2 additions & 10 deletions frontend/src/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,12 @@ export const $ActionRead = {
type: 'object',
title: 'Inputs'
},
key: {
type: 'string',
title: 'Key'
},
control_flow: {
'$ref': '#/components/schemas/ActionControlFlow'
}
},
type: 'object',
required: ['id', 'type', 'title', 'description', 'status', 'inputs', 'key'],
required: ['id', 'type', 'title', 'description', 'status', 'inputs'],
title: 'ActionRead'
} as const;

Expand Down Expand Up @@ -143,14 +139,10 @@ export const $ActionReadMinimal = {
status: {
type: 'string',
title: 'Status'
},
key: {
type: 'string',
title: 'Key'
}
},
type: 'object',
required: ['id', 'workflow_id', 'type', 'title', 'description', 'status', 'key'],
required: ['id', 'workflow_id', 'type', 'title', 'description', 'status'],
title: 'ActionReadMinimal'
} as const;

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export type ActionRead = {
inputs: {
[key: string]: unknown;
};
key: string;
control_flow?: ActionControlFlow;
};

Expand All @@ -42,7 +41,6 @@ export type ActionReadMinimal = {
title: string;
description: string;
status: string;
key: string;
};

export type ActionRetryPolicy = {
Expand Down
6 changes: 0 additions & 6 deletions tracecat/db/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,6 @@ class Action(Resource, table=True):
back_populates="actions", sa_relationship_kwargs=DEFAULT_SA_RELATIONSHIP_KWARGS
)

@computed_field
@property
def key(self) -> str:
"""Workflow-relative key for an Action."""
return action.key(self.workflow_id, self.id)

@property
def ref(self) -> str:
"""Slugified title of the action. Used for references."""
Expand Down
2 changes: 0 additions & 2 deletions tracecat/workflow/actions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class ActionRead(BaseModel):
description: str
status: str
inputs: dict[str, Any]
key: str # Computed field
control_flow: ActionControlFlow = Field(default_factory=ActionControlFlow)


Expand All @@ -34,7 +33,6 @@ class ActionReadMinimal(BaseModel):
title: str
description: str
status: str
key: str


class ActionCreate(BaseModel):
Expand Down
4 changes: 0 additions & 4 deletions tracecat/workflow/actions/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ async def list_actions(
title=action.title,
description=action.description,
status=action.status,
key=action.key,
)
for action in actions
]
Expand Down Expand Up @@ -82,7 +81,6 @@ async def create_action(
title=action.title,
description=action.description,
status=action.status,
key=action.key,
)
return action_metadata

Expand Down Expand Up @@ -115,7 +113,6 @@ async def get_action(
description=action.description,
status=action.status,
inputs=action.inputs,
key=action.key,
control_flow=ActionControlFlow(**action.control_flow),
)

Expand Down Expand Up @@ -163,7 +160,6 @@ async def update_action(
description=action.description,
status=action.status,
inputs=action.inputs,
key=action.key,
)


Expand Down

0 comments on commit 3dffa62

Please sign in to comment.