Skip to content

Commit

Permalink
feat: refactor disabling webhook (#284)
Browse files Browse the repository at this point in the history
* feat: deperecate disabling webhook

Signed-off-by: Vladislav Sukhin <[email protected]>

* fix: add disable webhooks for twe

Signed-off-by: Vladislav Sukhin <[email protected]>

* fix: add disable webhooks to executions

Signed-off-by: Vladislav Sukhin <[email protected]>

---------

Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin authored Jul 16, 2024
1 parent 77e0cc1 commit a1fa1f1
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 16 deletions.
4 changes: 3 additions & 1 deletion api/testexecution/v1/testexecution_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ type ExecutionRequest struct {
// namespace for test execution (Pro edition only)
ExecutionNamespace string `json:"executionNamespace,omitempty"`
// whether webhooks should be called on execution
DisableWebhooks *bool `json:"disableWebhooks,omitempty"`
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

// ArgsModeType defines args mode type
Expand Down Expand Up @@ -276,6 +276,8 @@ type Execution struct {
SlavePodRequest *PodRequest `json:"slavePodRequest,omitempty"`
// namespace for test execution (Pro edition only)
ExecutionNamespace string `json:"executionNamespace,omitempty"`
// whether webhooks should be called on execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

// TestContent defines test content
Expand Down
5 changes: 0 additions & 5 deletions api/testexecution/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions api/tests/v3/test_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ type ExecutionRequest struct {
// namespace for test execution (Pro edition only)
ExecutionNamespace string `json:"executionNamespace,omitempty"`
// whether webhooks should be called on execution
// Deprecated: field is not used
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

Expand Down
2 changes: 2 additions & 0 deletions api/testsuite/v3/testsuite_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ type TestSuiteExecutionRequest struct {
// name of the template resource
PvcTemplateReference string `json:"pvcTemplateReference,omitempty"`
// whether webhooks should be called on execution
// Deprecated: field is not used
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

Expand Down Expand Up @@ -235,5 +236,6 @@ type TestSuiteStepExecutionRequest struct {
PvcTemplateReference string `json:"pvcTemplateReference,omitempty"`
RunningContext *commonv1.RunningContext `json:"runningContext,omitempty"`
// whether webhooks should be called on execution
// Deprecated: field is not used
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}
4 changes: 4 additions & 0 deletions api/testsuiteexecution/v1/testsuiteexecution_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ type TestSuiteExecutionRequest struct {
ConcurrencyLevel int32 `json:"concurrencyLevel,omitempty"`
// test suite execution name started the test suite execution
TestSuiteExecutionName string `json:"testSuiteExecutionName,omitempty"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

type ObjectRef struct {
Expand Down Expand Up @@ -156,6 +158,8 @@ type SuiteExecution struct {
RunningContext *RunningContext `json:"runningContext,omitempty"`
// test suite execution name started the test suite execution
TestSuiteExecutionName string `json:"testSuiteExecutionName,omitempty"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

// execution result returned from executor
Expand Down
1 change: 1 addition & 0 deletions api/testworkflows/v1/base_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ type TestWorkflowSpecBase struct {
Pod *PodConfig `json:"pod,omitempty" expr:"include"`

// configuration for notifications
// Deprecated: field is not used
Notifications *NotificationsConfig `json:"notifications,omitempty" expr:"include"`
}
4 changes: 4 additions & 0 deletions api/testworkflows/v1/testworkflowexecution_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type TestWorkflowExecutionRequest struct {
Config map[string]intstr.IntOrString `json:"config,omitempty" expr:"template"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty" expr:"template"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

// TestWorkflowExecutionStatus defines the observed state of TestWorkflowExecution
Expand Down Expand Up @@ -75,6 +77,8 @@ type TestWorkflowExecutionDetails struct {
ResolvedWorkflow *TestWorkflow `json:"resolvedWorkflow,omitempty"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks should be disabled for this execution
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
}

// TestWorkflowSignature has signature of TestWorkflow
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/tests.testkube.io_testexecutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ spec:
description: uri of test content
type: string
type: object
disableWebhooks:
description: whether webhooks should be called on execution
type: boolean
duration:
description: test duration
type: string
Expand Down
4 changes: 3 additions & 1 deletion config/crd/bases/tests.testkube.io_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ spec:
description: name of the template resource
type: string
disableWebhooks:
description: whether webhooks should be called on execution
description: |-
whether webhooks should be called on execution
Deprecated: field is not used
type: boolean
envConfigMaps:
description: config map references
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/tests.testkube.io_testsuiteexecutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ spec:
cronJobTemplate:
description: cron job template extensions
type: string
disableWebhooks:
description: whether webhooks should be disabled for this execution
type: boolean
executionLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -262,6 +265,9 @@ spec:
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
Important: Run "make" to regenerate code after modifying this file
properties:
disableWebhooks:
description: whether webhooks should be disabled for this execution
type: boolean
duration:
description: test duration
type: string
Expand Down
19 changes: 12 additions & 7 deletions config/crd/bases/tests.testkube.io_testsuites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,9 @@ spec:
description: cron job template extensions reference
type: string
disableWebhooks:
description: whether webhooks should be called on
execution
description: |-
whether webhooks should be called on execution
Deprecated: field is not used
type: boolean
executionLabels:
additionalProperties:
Expand Down Expand Up @@ -879,8 +880,9 @@ spec:
description: cron job template extensions reference
type: string
disableWebhooks:
description: whether webhooks should be called on
execution
description: |-
whether webhooks should be called on execution
Deprecated: field is not used
type: boolean
executionLabels:
additionalProperties:
Expand Down Expand Up @@ -1062,7 +1064,9 @@ spec:
description: name of the template resource
type: string
disableWebhooks:
description: whether webhooks should be called on execution
description: |-
whether webhooks should be called on execution
Deprecated: field is not used
type: boolean
executionLabels:
additionalProperties:
Expand Down Expand Up @@ -1285,8 +1289,9 @@ spec:
description: cron job template extensions reference
type: string
disableWebhooks:
description: whether webhooks should be called on
execution
description: |-
whether webhooks should be called on execution
Deprecated: field is not used
type: boolean
executionLabels:
additionalProperties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
disableWebhooks:
description: whether webhooks should be disabled for this execution
type: boolean
name:
description: custom execution name
type: string
Expand Down Expand Up @@ -84,6 +87,9 @@ spec:
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
Important: Run "make" to regenerate code after modifying this file
properties:
disableWebhooks:
description: whether webhooks should be disabled for this execution
type: boolean
id:
description: unique execution identifier
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3610,7 +3610,9 @@ spec:
type: string
type: object
notifications:
description: configuration for notifications
description: |-
configuration for notifications
Deprecated: field is not used
properties:
disableWebhooks:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3536,7 +3536,9 @@ spec:
type: string
type: object
notifications:
description: configuration for notifications
description: |-
configuration for notifications
Deprecated: field is not used
properties:
disableWebhooks:
type: boolean
Expand Down

0 comments on commit a1fa1f1

Please sign in to comment.