Skip to content

Commit

Permalink
feat: onstatechange attribute (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
vLia authored Jun 20, 2024
1 parent f76a846 commit e96c168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/executor/v1/webhook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type WebhookSpec struct {
Headers map[string]string `json:"headers,omitempty"`
// Disabled will disable the webhook
Disabled bool `json:"disabled,omitempty"`
// OnStateChange will trigger the webhook only when the result of the current execution differs from the previous result of the same test/test suite/workflow
OnStateChange bool `json:"onStateChange,omitempty"`
}

// +kubebuilder:validation:Enum=start-test;end-test-success;end-test-failed;end-test-aborted;end-test-timeout;start-testsuite;end-testsuite-success;end-testsuite-failed;end-testsuite-aborted;end-testsuite-timeout;start-testworkflow;queue-testworkflow;end-testworkflow-success;end-testworkflow-failed;end-testworkflow-aborted
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/executor.testkube.io_webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ spec:
type: string
description: webhook headers (golang template supported)
type: object
onStateChange:
description: OnStateChange will trigger the webhook only when the
result of the current execution differs from the previous result
of the same test/test suite/workflow
type: boolean
payloadObjectField:
description: will load the generated payload for notification inside
the object
Expand Down

0 comments on commit e96c168

Please sign in to comment.