Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dynamic crons #1000

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
524874b
wip: stub schedule page
grutt Oct 15, 2024
ee6fc35
wip: stub list
grutt Oct 15, 2024
1538f2d
merge
grutt Oct 15, 2024
b78bc42
Merge branch 'main' into feat--scheduled-improvements
grutt Oct 24, 2024
01e537c
fix: 2025 bug...
grutt Oct 24, 2024
2757bd9
feat: wip cron list
grutt Oct 24, 2024
ab0721d
feat: addl meta
grutt Oct 24, 2024
dbd9ed5
feat: expose metadata column
grutt Oct 24, 2024
ae8304f
feat: sort and created at
grutt Oct 24, 2024
1e0c80c
cron to recurring
grutt Oct 24, 2024
5ee9c1f
scheduled: with statuses
grutt Oct 24, 2024
de2e44c
fix: links
grutt Oct 24, 2024
e21aeeb
feat: expose schedule ids
grutt Oct 24, 2024
1756214
feat: delete run
grutt Oct 25, 2024
3cae252
fix: remove search
grutt Oct 25, 2024
48dc2f9
feat: filterable scheduled
grutt Oct 25, 2024
2eae6a0
fix: remove broken features
grutt Oct 25, 2024
37b71f9
chore: lint
grutt Oct 25, 2024
be51b3b
Merge branch 'main' into feat--scheduled-improvements
grutt Oct 28, 2024
4631397
rm metadata for now
grutt Oct 28, 2024
7dc03cc
chore: lint
grutt Oct 28, 2024
152452f
chore: recurring to cron job
grutt Oct 28, 2024
f79758f
fix: review comments
grutt Oct 29, 2024
f1b95da
Merge branch 'main' into feat--scheduled-improvements
grutt Oct 29, 2024
227b1c6
fix: populator
grutt Oct 29, 2024
e6c5091
wip cron changes
grutt Oct 30, 2024
a1f6d07
fix: ids are helpful
grutt Oct 30, 2024
258a448
Merge branch 'main' into feat--dynamic-crons
grutt Nov 1, 2024
d489d39
fix: populator
grutt Nov 1, 2024
459398b
wip
grutt Nov 4, 2024
ff01f64
wip: create crons, stub scheduled
grutt Nov 4, 2024
12aa0d4
wip: create schedule
grutt Nov 4, 2024
dd20790
wip add trigger buttons to all the pages
grutt Nov 4, 2024
3bd1b23
wip: reusable trigger form
grutt Nov 4, 2024
977369e
Merge branch 'main' into feat--dynamic-crons
grutt Nov 8, 2024
90fb1d0
Merge branch 'main' into feat--dynamic-crons
grutt Nov 8, 2024
7fc4e1e
fix: hash
grutt Nov 8, 2024
4929e0a
Merge branch 'main' into feat--dynamic-crons
grutt Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api-contracts/openapi/components/schemas/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ RerunStepRunRequest:
$ref: "./workflow_run.yaml#/RerunStepRunRequest"
TriggerWorkflowRunRequest:
$ref: "./workflow_run.yaml#/TriggerWorkflowRunRequest"
ScheduleWorkflowRunRequest:
$ref: "./workflow_run.yaml#/ScheduleWorkflowRunRequest"
CreateCronWorkflowTriggerRequest:
$ref: "./workflow_run.yaml#/CreateCronWorkflowTriggerRequest"
CreatePullRequestFromStepRun:
$ref: "./workflow_run.yaml#/CreatePullRequestFromStepRun"
GetStepRunDiffResponse:
Expand Down
32 changes: 32 additions & 0 deletions api-contracts/openapi/components/schemas/workflow_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ CronWorkflows:
type: string
cron:
type: string
name:
type: string
input:
type: object
additionalProperties: true
Expand Down Expand Up @@ -636,6 +638,36 @@ TriggerWorkflowRunRequest:
required:
- input

CreateCronWorkflowTriggerRequest:
properties:
input:
type: object
additionalMetadata:
type: object
cronName:
type: string
cronExpression:
type: string
required:
- input
- additionalMetadata
- cronName
- cronExpression

ScheduleWorkflowRunRequest:
properties:
input:
type: object
additionalMetadata:
type: object
triggerAt:
type: string
format: date-time
required:
- input
- additionalMetadata
- triggerAt

CreatePullRequestFromStepRun:
properties:
branchName:
Expand Down
8 changes: 7 additions & 1 deletion api-contracts/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@ paths:
$ref: "./paths/event/event.yaml#/keys"
/api/v1/tenants/{tenant}/workflows:
$ref: "./paths/workflow/workflow.yaml#/withTenant"
/api/v1/tenants/{tenant}/workflows/{workflow}/scheduled:
$ref: "./paths/workflow/workflow.yaml#/scheduledCreate"
/api/v1/tenants/{tenant}/workflows/scheduled:
$ref: "./paths/workflow/workflow.yaml#/scheduledList"
/api/v1/tenants/{tenant}/workflows/scheduled/{scheduledId}:
/api/v1/tenants/{tenant}/workflows/scheduled/{scheduled-workflow-run}:
$ref: "./paths/workflow/workflow.yaml#/scheduled"
/api/v1/tenants/{tenant}/workflows/{workflow}/crons:
$ref: "./paths/workflow/workflow.yaml#/cronsCreate"
/api/v1/tenants/{tenant}/workflows/crons:
$ref: "./paths/workflow/workflow.yaml#/cronsList"
/api/v1/tenants/{tenant}/workflows/crons/{cron-workflow}:
$ref: "./paths/workflow/workflow.yaml#/crons"
/api/v1/tenants/{tenant}/workflows/cancel:
$ref: "./paths/workflow/workflow.yaml#/cancelWorkflowRuns"
/api/v1/workflows/{workflow}:
Expand Down
252 changes: 248 additions & 4 deletions api-contracts/openapi/paths/workflow/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,81 @@ workflowWorkersCount:
- Workflow


scheduledCreate:
post:
x-resources: ["tenant", "workflow"]
description: Schedule a new workflow run for a tenant
operationId: scheduled-workflow-run:create
parameters:
- description: The tenant id
in: path
name: tenant
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The workflow id
in: path
name: workflow
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The workflow version. If not supplied, the latest version is fetched.
in: query
name: version
required: false
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
requestBody:
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/ScheduleWorkflowRunRequest"
description: The input to the scheduled workflow run
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/ScheduledWorkflows"
description: Successfully created the scheduled workflow run
"400":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: A malformed or bad request
"429":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Resource limit exceeded
"403":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Not found
summary: Trigger workflow run
tags:
- Workflow Run

scheduledList:
get:
x-resources: ["tenant"]
Expand Down Expand Up @@ -938,7 +1013,7 @@ scheduledList:

scheduled:
get:
x-resources: ["tenant"]
x-resources: ["tenant", "scheduled-workflow-run"]
description: Get a scheduled workflow run for a tenant
operationId: workflow-scheduled:get
parameters:
Expand All @@ -953,7 +1028,7 @@ scheduled:
maxLength: 36
- description: The scheduled workflow id
in: path
name: scheduledId
name: scheduled-workflow-run
required: true
schema:
type: string
Expand Down Expand Up @@ -1004,7 +1079,7 @@ scheduled:
maxLength: 36
- description: The scheduled workflow id
in: path
name: scheduledId
name: scheduled-workflow-run
required: true
schema:
type: string
Expand All @@ -1030,10 +1105,179 @@ scheduled:
tags:
- Workflow

crons:
get:
x-resources: ["tenant", "cron-workflow"]
description: Get a cron job workflow run for a tenant
operationId: workflow-cron:get
parameters:
- description: The tenant id
in: path
name: tenant
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The cron job id
in: path
name: cron-workflow
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
responses:
"200":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/CronWorkflows"
description: Successfully retrieved 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
"404":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Forbidden
summary: Get cron job workflow run
tags:
- Workflow
delete:
x-resources: ["tenant", "cron-workflow"]
description: Delete a cron job workflow run for a tenant
operationId: workflow-cron:delete
parameters:
- description: The tenant id
in: path
name: tenant
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The cron job id
in: path
name: cron-workflow
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
responses:
"204":
description: Successfully deleted the cron job workflow run
"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#/APIError"
description: Forbidden
summary: Delete cron job workflow run
tags:
- Workflow

cronsCreate:
post:
x-resources: ["tenant", "workflow"]
description: Create a new cron job workflow trigger for a tenant
operationId: cron-workflow-trigger:create
parameters:
- description: The tenant id
in: path
name: tenant
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The workflow id
in: path
name: workflow
required: true
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
- description: The workflow version. If not supplied, the latest version is fetched.
in: query
name: version
required: false
schema:
type: string
format: uuid
minLength: 36
maxLength: 36
requestBody:
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/CreateCronWorkflowTriggerRequest"
description: The input to the cron job workflow trigger
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/CronWorkflows"
description: Successfully created the cron job workflow trigger
"400":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: A malformed or bad request
"429":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Resource limit exceeded
"403":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Forbidden
"404":
content:
application/json:
schema:
$ref: "../../components/schemas/_index.yaml#/APIErrors"
description: Not found
summary: Create cron job workflow trigger
tags:
- Workflow Run

cronsList:
get:
x-resources: ["tenant"]
description: Get all cron job workflow runs for a tenant
description: Get all cron job workflow triggers for a tenant
operationId: cron-workflow:list
parameters:
- description: The tenant id
Expand Down
Loading
Loading