Skip to content

Commit

Permalink
feat: remove test workflow notifications
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Jul 11, 2024
1 parent 7021e06 commit 75c79bd
Show file tree
Hide file tree
Showing 25 changed files with 136 additions and 135 deletions.
23 changes: 4 additions & 19 deletions api/v1/testkube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6595,7 +6595,7 @@ components:
description: running context for the test execution
disableWebhooks:
type: boolean
description: whether webhooks on the executions of this step are disabled
description: whether webhooks on the execution of this step are disabled
default: false
example:
- true
Expand Down Expand Up @@ -6703,7 +6703,7 @@ components:
description: test suite execution name started the test suite execution
disableWebhooks:
type: boolean
description: whether webhooks on the executions of this test suite are disabled
description: whether webhooks on the execution of this test suite are disabled
default: false
example:
- true
Expand Down Expand Up @@ -7872,7 +7872,7 @@ components:
description: test workflow execution name started the test workflow execution
disableWebhooks:
type: boolean
description: whether webhooks on the executions of this test workflow are disabled
description: whether webhooks on the execution of this test workflow are disabled
default: false

TestWorkflowWithExecution:
Expand Down Expand Up @@ -7960,7 +7960,7 @@ components:
description: test workflow execution name started the test workflow execution
disableWebhooks:
type: boolean
description: whether webhooks on the executions of this test workflow are disabled
description: whether webhooks on the execution of this test workflow are disabled
default: false
example:
- true
Expand Down Expand Up @@ -8500,9 +8500,6 @@ components:
type: array
items:
$ref: "#/components/schemas/TestWorkflowEvent"
notifications:
$ref: "#/components/schemas/TestWorkflowNotificationsConfig"


TestWorkflowTemplateSpec:
type: object
Expand Down Expand Up @@ -9175,14 +9172,6 @@ components:
items:
$ref: "#/components/schemas/VolumeMount"

TestWorkflowNotificationsConfig:
type: object
properties:
disableWebhooks:
type: boolean
description: disable webhooks for this test workflow
default: false

TestWorkflowStepRun:
type: object
properties:
Expand Down Expand Up @@ -9350,10 +9339,6 @@ components:
status:
$ref: "#/components/schemas/TestWorkflowExecutionStatusCR"
description: test workflow execution status
disableWebhooks:
type: boolean
description: disable webhooks for this execution
default: false

TestWorkflowExecutionStatusCR:
type: object
Expand Down
7 changes: 0 additions & 7 deletions cmd/kubectl-testkube/commands/testworkflows/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ func NewCreateTestWorkflowCmd() *cobra.Command {
client, _, err := common.GetClient(cmd)
ui.ExitOnError("getting client", err)

if cmd.Flag("disable-webhooks").Changed {
obj.Spec.Notifications = &testworkflowsv1.NotificationsConfig{
DisableWebhooks: true,
}
}

workflow, err := client.GetTestWorkflow(obj.Name)
if err != nil {
if update {
Expand Down Expand Up @@ -94,7 +88,6 @@ func NewCreateTestWorkflowCmd() *cobra.Command {
cmd.Flags().StringVar(&name, "name", "", "test workflow name")
cmd.Flags().BoolVar(&update, "update", false, "update, if test workflow already exists")
cmd.Flags().StringVarP(&filePath, "file", "f", "", "file path to get the test workflow specification")
cmd.Flags().Bool("disable-webhooks", false, "disable webhooks for this test workflow")

return cmd
}
2 changes: 1 addition & 1 deletion docs/docs/cli/testkube.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ testkube [flags]
* [testkube create](testkube_create.md) - Create resource
* [testkube create-ticket](testkube_create-ticket.md) - Create bug ticket
* [testkube dashboard](testkube_dashboard.md) - Open Testkube dashboard
* [testkube debug](testkube_debug.md) - Print environment information for debugging
* [testkube debug](testkube_debug.md) - Print debugging info
* [testkube delete](testkube_delete.md) - Delete resources
* [testkube disable](testkube_disable.md) - Disable feature
* [testkube download](testkube_download.md) - Artifacts management commands
Expand Down
1 change: 0 additions & 1 deletion docs/docs/cli/testkube_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ testkube agent [flags]
### SEE ALSO

* [testkube](testkube.md) - Testkube entrypoint for kubectl plugin
* [testkube agent debug](testkube_agent_debug.md) - Debug Agent info

9 changes: 4 additions & 5 deletions docs/docs/cli/testkube_create_testworkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ testkube create testworkflow [flags]
### Options

```
--disable-webhooks disable webhooks for this test workflow
-f, --file string file path to get the test workflow specification
-h, --help help for testworkflow
--name string test workflow name
--update update, if test workflow already exists
-f, --file string file path to get the test workflow specification
-h, --help help for testworkflow
--name string test workflow name
--update update, if test workflow already exists
```

### Options inherited from parent commands
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cli/testkube_create_webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ testkube create webhook [flags]
-h, --help help for webhook
-l, --label stringToString label key value pair: --label key1=value1 (default [])
-n, --name string unique webhook name - mandatory
--on-state-change specify whether webhook should be triggered only on a state change
--payload-field string field to use for notification object payload
--payload-template string if webhook needs to send a custom notification, then a path to template file should be provided
--payload-template-reference string reference to payload template to use for the webhook
Expand Down
11 changes: 4 additions & 7 deletions docs/docs/cli/testkube_debug.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
## testkube debug

Print environment information for debugging

```
testkube debug [flags]
```
Print debugging info

### Options

Expand All @@ -27,6 +23,7 @@ testkube debug [flags]
### SEE ALSO

* [testkube](testkube.md) - Testkube entrypoint for kubectl plugin
* [testkube debug controlplane](testkube_debug_controlplane.md) - Show debug info
* [testkube debug info](testkube_debug_info.md) - Show debug info
* [testkube debug agent](testkube_debug_agent.md) - Show Agent debug information
* [testkube debug controlplane](testkube_debug_controlplane.md) - Show Control Plane debug information
* [testkube debug oss](testkube_debug_oss.md) - Show OSS installation debug info

35 changes: 35 additions & 0 deletions docs/docs/cli/testkube_debug_agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## testkube debug agent

Show Agent debug information

### Synopsis

Get all the necessary information to debug an issue in Testkube Agent you can fiter through comma separated list of items to show with additional flag `--show pods,services,ingresses,events,nats,connection,roundtrip`

```
testkube debug agent [flags]
```

### Options

```
-h, --help help for agent
-s, --show []string Comma-separated list of features to show, one of: pods,services,ingresses,events,nats,connection,roundtrip, defaults to all
```

### Options inherited from parent commands

```
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct|cluster (default "proxy")
--header stringToString headers for direct client key value pair: --header name=value (default [])
--insecure insecure connection for direct client
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--verbose show additional debug messages
```

### SEE ALSO

* [testkube debug](testkube_debug.md) - Print debugging info

11 changes: 5 additions & 6 deletions docs/docs/cli/testkube_debug_controlplane.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## testkube debug controlplane

Show debug info
Show Control Plane debug information

### Synopsis

Get all the necessary information to debug an issue in Testkube Control Plane
Get all the necessary information to debug an issue in Testkube Control Plane you can fiter through comma separated list of items to show with additional flag `--show pods,services,ingresses,storageclasses,events,nats,connection,api,nats,mongo,dex,ui,worker`

```
testkube debug controlplane [flags]
Expand All @@ -13,9 +13,8 @@ testkube debug controlplane [flags]
### Options

```
--attach-agent-log Attach agent log to the output keep in mind to configure valid agent first in the Testkube CLI
-h, --help help for controlplane
--labels stringToString Labels to filter logs by (default [])
-h, --help help for controlplane
-s, --show []string Comma-separated list of features to show, one of: pods,services,ingresses,storageclasses,events,nats,connection,api,nats,mongo,dex,ui,worker, defaults to all
```

### Options inherited from parent commands
Expand All @@ -32,5 +31,5 @@ testkube debug controlplane [flags]

### SEE ALSO

* [testkube debug](testkube_debug.md) - Print environment information for debugging
* [testkube debug](testkube_debug.md) - Print debugging info

30 changes: 30 additions & 0 deletions docs/docs/cli/testkube_debug_oss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## testkube debug oss

Show OSS installation debug info

```
testkube debug oss [flags]
```

### Options

```
-h, --help help for oss
```

### Options inherited from parent commands

```
-a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088")
-c, --client string client used for connecting to Testkube API one of proxy|direct|cluster (default "proxy")
--header stringToString headers for direct client key value pair: --header name=value (default [])
--insecure insecure connection for direct client
--namespace string Kubernetes namespace, default value read from config if set (default "testkube")
--oauth-enabled enable oauth
--verbose show additional debug messages
```

### SEE ALSO

* [testkube debug](testkube_debug.md) - Print debugging info

1 change: 1 addition & 0 deletions docs/docs/cli/testkube_update_webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ testkube update webhook [flags]
-h, --help help for webhook
-l, --label stringToString label key value pair: --label key1=value1 (default [])
-n, --name string unique webhook name - mandatory
--on-state-change specify whether webhook should be triggered only on a state change
--payload-field string field to use for notification object payload
--payload-template string if webhook needs to send a custom notification, then a path to template file should be provided
--payload-template-reference string reference to payload template to use for the webhook
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/kelseyhightower/envconfig v1.4.0
github.com/kubepug/kubepug v1.7.1
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240625102049-77e0cc1374e9
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240711115642-7c436d1ac0bc
github.com/minio/minio-go/v7 v7.0.47
github.com/montanaflynn/stats v0.6.6
github.com/moogar0880/problems v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw=
github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g=
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240625102049-77e0cc1374e9 h1:zqGRFwBshCRZ+FdHl2Ty5E6NrwfzNUpuDL+BwKe2L7M=
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240625102049-77e0cc1374e9/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk=
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240711115642-7c436d1ac0bc h1:cDdttvG3Z6x8512z4FtdEQjOFOqjZUQs7X3XfrAt+a4=
github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240711115642-7c436d1ac0bc/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4=
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1/testkube/model_test_suite_execution_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ type TestSuiteExecutionRequest struct {
ConcurrencyLevel int32 `json:"concurrencyLevel,omitempty"`
// test suite execution name started the test suite execution
TestSuiteExecutionName string `json:"testSuiteExecutionName,omitempty"`
// whether webhooks on the executions of this test suite are disabled
// whether webhooks on the execution of this test suite are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ type TestSuiteExecutionUpdateRequest struct {
ConcurrencyLevel *int32 `json:"concurrencyLevel,omitempty"`
// test suite execution name started the test suite execution
TestSuiteExecutionName *string `json:"testSuiteExecutionName,omitempty"`
// whether webhooks on the executions of this test suite are disabled
// whether webhooks on the execution of this test suite are disabled
DisableWebhooks *bool `json:"disableWebhooks,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ type TestSuiteStepExecutionRequest struct {
// name of the template resource
PvcTemplateReference string `json:"pvcTemplateReference,omitempty"`
RunningContext *RunningContext `json:"runningContext,omitempty"`
// whether webhooks on the executions of this step are disabled
// whether webhooks on the execution of this step are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
2 changes: 1 addition & 1 deletion pkg/api/v1/testkube/model_test_workflow_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ type TestWorkflowExecution struct {
ResolvedWorkflow *TestWorkflow `json:"resolvedWorkflow,omitempty"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks on the executions of this test workflow are disabled
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
2 changes: 0 additions & 2 deletions pkg/api/v1/testkube/model_test_workflow_execution_cr.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ type TestWorkflowExecutionCr struct {
TestWorkflow *ObjectRef `json:"testWorkflow"`
ExecutionRequest *TestWorkflowExecutionRequest `json:"executionRequest,omitempty"`
Status *TestWorkflowExecutionStatusCr `json:"status,omitempty"`
// disable webhooks for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ type TestWorkflowExecutionRequest struct {
Config map[string]string `json:"config,omitempty"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks on the executions of this test workflow are disabled
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
15 changes: 0 additions & 15 deletions pkg/api/v1/testkube/model_test_workflow_notifications_config.go

This file was deleted.

23 changes: 11 additions & 12 deletions pkg/api/v1/testkube/model_test_workflow_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
package testkube

type TestWorkflowSpec struct {
Use []TestWorkflowTemplateRef `json:"use,omitempty"`
Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"`
Content *TestWorkflowContent `json:"content,omitempty"`
Services map[string]TestWorkflowServiceSpec `json:"services,omitempty"`
Container *TestWorkflowContainerConfig `json:"container,omitempty"`
Job *TestWorkflowJobConfig `json:"job,omitempty"`
Pod *TestWorkflowPodConfig `json:"pod,omitempty"`
Setup []TestWorkflowStep `json:"setup,omitempty"`
Steps []TestWorkflowStep `json:"steps,omitempty"`
After []TestWorkflowStep `json:"after,omitempty"`
Events []TestWorkflowEvent `json:"events,omitempty"`
Notifications *TestWorkflowNotificationsConfig `json:"notifications,omitempty"`
Use []TestWorkflowTemplateRef `json:"use,omitempty"`
Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"`
Content *TestWorkflowContent `json:"content,omitempty"`
Services map[string]TestWorkflowServiceSpec `json:"services,omitempty"`
Container *TestWorkflowContainerConfig `json:"container,omitempty"`
Job *TestWorkflowJobConfig `json:"job,omitempty"`
Pod *TestWorkflowPodConfig `json:"pod,omitempty"`
Setup []TestWorkflowStep `json:"setup,omitempty"`
Steps []TestWorkflowStep `json:"steps,omitempty"`
After []TestWorkflowStep `json:"after,omitempty"`
Events []TestWorkflowEvent `json:"events,omitempty"`
}
Loading

0 comments on commit 75c79bd

Please sign in to comment.