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

Add support for CV failure notification type #549

Merged
merged 3 commits into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,4 +1,10 @@
# (Unreleased)
# Unreleased

## Enhancements

* Add `NotificationTriggerAssessmentCheckFailed` notification trigger type by @rexredinger [#549](https://github.com/hashicorp/go-tfe/pull/549)

# v1.11.0
sebasslash marked this conversation as resolved.
Show resolved Hide resolved

## Enhancements

Expand Down
20 changes: 11 additions & 9 deletions notification_configuration.go
Expand Up @@ -45,14 +45,15 @@ type notificationConfigurations struct {
type NotificationTriggerType string

const (
NotificationTriggerCreated NotificationTriggerType = "run:created"
NotificationTriggerPlanning NotificationTriggerType = "run:planning"
NotificationTriggerNeedsAttention NotificationTriggerType = "run:needs_attention"
NotificationTriggerApplying NotificationTriggerType = "run:applying"
NotificationTriggerCompleted NotificationTriggerType = "run:completed"
NotificationTriggerErrored NotificationTriggerType = "run:errored"
NotificationTriggerAssessmentDrifted NotificationTriggerType = "assessment:drifted"
NotificationTriggerAssessmentFailed NotificationTriggerType = "assessment:failed"
NotificationTriggerCreated NotificationTriggerType = "run:created"
NotificationTriggerPlanning NotificationTriggerType = "run:planning"
NotificationTriggerNeedsAttention NotificationTriggerType = "run:needs_attention"
NotificationTriggerApplying NotificationTriggerType = "run:applying"
NotificationTriggerCompleted NotificationTriggerType = "run:completed"
NotificationTriggerErrored NotificationTriggerType = "run:errored"
NotificationTriggerAssessmentDrifted NotificationTriggerType = "assessment:drifted"
NotificationTriggerAssessmentFailed NotificationTriggerType = "assessment:failed"
NotificationTriggerAssessmentCheckFailed NotificationTriggerType = "assessment:check_failure"
)

// NotificationDestinationType represents the destination type of the
Expand Down Expand Up @@ -355,7 +356,8 @@ func validNotificationTriggerType(triggers []NotificationTriggerType) bool {
NotificationTriggerErrored,
NotificationTriggerPlanning,
NotificationTriggerAssessmentDrifted,
NotificationTriggerAssessmentFailed:
NotificationTriggerAssessmentFailed,
NotificationTriggerAssessmentCheckFailed:
continue
default:
return false
Expand Down