Skip to content

Commit

Permalink
feat: add tags to test workflow executions (#292)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin authored and exu committed Aug 30, 2024
1 parent 1ad791b commit 7ef9db6
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/testworkflows/v1/base_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ type TestWorkflowSpecBase struct {
// configuration for notifications
// Deprecated: field is not used
Notifications *NotificationsConfig `json:"notifications,omitempty" expr:"include"`

// values to be used for test workflow execution
Execution *TestWorkflowTagSchema `json:"execution,omitempty" expr:"include"`
}

type TestWorkflowSystem struct {
Expand Down
2 changes: 2 additions & 0 deletions api/testworkflows/v1/status_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type TestWorkflowExecutionSummary struct {
StatusAt metav1.Time `json:"statusAt,omitempty"`
Result *TestWorkflowResultSummary `json:"result,omitempty"`
Workflow *TestWorkflowSummary `json:"workflow"`
// test workflow execution tags
Tags map[string]string `json:"tags,omitempty"`
}

// TestWorkflowResultSummary defines TestWorkflow result summary
Expand Down
4 changes: 4 additions & 0 deletions api/testworkflows/v1/testworkflowexecution_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type TestWorkflowExecutionRequest struct {
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty" expr:"template"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
// test workflow execution tags
Tags map[string]string `json:"tags,omitempty" expr:"template"`
}

// TestWorkflowExecutionStatus defines the observed state of TestWorkflowExecution
Expand Down Expand Up @@ -79,6 +81,8 @@ type TestWorkflowExecutionDetails struct {
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
// test workflow execution tags
Tags map[string]string `json:"tags,omitempty"`
}

// TestWorkflowSignature has signature of TestWorkflow
Expand Down
5 changes: 5 additions & 0 deletions api/testworkflows/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,8 @@ type CronJobConfig struct {
// annotations to attach to the cron job
Annotations map[string]string `json:"annotations,omitempty" expr:"template,template"`
}

type TestWorkflowTagSchema struct {
// test workflow execution tags
Tags map[string]string `json:"tags,omitempty" expr:"template"`
}
48 changes: 48 additions & 0 deletions api/testworkflows/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ spec:
name:
description: custom execution name
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
testWorkflowExecutionName:
description: test workflow execution name started the test workflow execution
type: string
Expand Down Expand Up @@ -325,6 +330,11 @@ spec:
description: when the execution result's status has changed last time (queued, passed, failed)
format: date-time
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
testWorkflowExecutionName:
description: test workflow execution name started the test workflow execution
type: string
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/testworkflows.testkube.io_testworkflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3591,6 +3591,15 @@ spec:
type: object
type: object
type: array
execution:
description: values to be used for test workflow execution
properties:
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
type: object
job:
description: configuration for the scheduled job
properties:
Expand Down Expand Up @@ -10736,6 +10745,11 @@ spec:
description: when the execution result's status has changed last time (queued, passed, failed)
format: date-time
type: string
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
workflow:
description: TestWorkflowSummary fas TestWorkflow summary
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3517,6 +3517,15 @@ spec:
type: object
type: object
type: array
execution:
description: values to be used for test workflow execution
properties:
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
type: object
job:
description: configuration for the scheduled job
properties:
Expand Down

0 comments on commit 7ef9db6

Please sign in to comment.