feat: workflow run cancel (#489)

* feat: workflow run cancel endpoint

* feat: cancel all running button

* feat: select and cancel runs

* chore: error handling

* fix: remove ani

* fix: error toast

* chore: gen

* fix: feedback

* fix: redundant method

* Update frontend/app/src/pages/main/workflow-runs/$run/index.tsx

Co-authored-by: abelanger5 <belanger@sas.upenn.edu>

* fix: response obj

* fix: cancel by job run

* fix: lint

* chore: generate

---------

Co-authored-by: abelanger5 <belanger@sas.upenn.edu>
Co-authored-by: Alexander Belanger <alexander@hatchet.run>
This commit is contained in:
Gabe Ruttner
2024-05-14 14:47:30 -07:00
committed by GitHub
parent d1835458d8
commit a37ee57cc1
15 changed files with 772 additions and 160 deletions
@@ -124,6 +124,8 @@ WorkflowRunStatus:
$ref: "./workflow_run.yaml#/WorkflowRunStatus"
WorkflowRunStatusList:
$ref: "./workflow_run.yaml#/WorkflowRunStatusList"
WorkflowRunsCancelRequest:
$ref: "./workflow_run.yaml#/WorkflowRunsCancelRequest"
JobRunStatus:
$ref: "./workflow_run.yaml#/JobRunStatus"
StepRunStatus:
@@ -118,6 +118,19 @@ WorkflowRunStatusList:
items:
$ref: "#/WorkflowRunStatus"
WorkflowRunsCancelRequest:
type: object
properties:
workflowRunIds:
type: array
items:
type: string
format: uuid
minLength: 36
maxLength: 36
required:
- workflowRunIds
WorkflowRunTriggeredBy:
type: object
properties:
+2
View File
@@ -106,6 +106,8 @@ paths:
$ref: "./paths/event/event.yaml#/keys"
/api/v1/tenants/{tenant}/workflows:
$ref: "./paths/workflow/workflow.yaml#/withTenant"
/api/v1/tenants/{tenant}/workflows/cancel:
$ref: "./paths/workflow/workflow.yaml#/cancelWorkflowRuns"
/api/v1/workflows/{workflow}:
$ref: "./paths/workflow/workflow.yaml#/withWorkflow"
/api/v1/workflows/{workflow}/versions:
@@ -273,6 +273,60 @@ triggerWorkflow:
summary: Trigger workflow run
tags:
- Workflow Run
cancelWorkflowRuns:
post:
x-resources: ["tenant"]
description: Cancel a batch of workflow runs
operationId: workflow-run:cancel
parameters:
- description: The tenant id
in: path
name: tenant
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
requestBody:
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/WorkflowRunsCancelRequest"
description: The input to cancel the workflow runs
required: true
responses:
"200":
content:
application/json:
schema:
type: object
properties:
workflowRunIds:
type: array
items:
type: string
format: uuid
minLength: 36
maxLength: 36
description: Successfully cancelled the workflow runs
"400":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: A malformed or bad request
"403":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Forbidden
summary: Cancel workflow runs
tags:
- Workflow Run
workflowRuns:
get:
x-resources: ["tenant"]