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 'msteams' recipients #386

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Conversation

jharley
Copy link
Collaborator

@jharley jharley commented Nov 7, 2023

Adds supports for msteams recipients.

Also fixes a "sneaky bug" where a previous refactor would allow marker type recipients on Burn Alerts during the validation stage (the API still would reject them).


@jharley jharley added the feature This issue wants to add new functionality. label Nov 7, 2023
}
if v, ok := d.GetOk("detail_filter"); ok {
rcptFilter = expandRecipientFilter(v.([]interface{}))
if rcptFilter.Type != matchType {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a fine tradeoff to not have to introduce more complex logic for webhooks and teams being more or less equivalent. We don't fail as fast, but 🤷🏻

@@ -18,9 +18,9 @@ import (
"github.com/honeycombio/terraform-provider-honeycombio/internal/models"
)

func notificationRecipientSchema() schema.SetNestedBlock {
func notificationRecipientSchema(allowedTypes []client.RecipientType) schema.SetNestedBlock {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the bug introduced by the refactor

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!!

@jharley jharley marked this pull request as ready for review November 7, 2023 19:39
@jharley jharley requested a review from a team as a code owner November 7, 2023 19:39
Copy link
Contributor

@cewkrupa cewkrupa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you!!

@@ -18,9 +18,9 @@ import (
"github.com/honeycombio/terraform-provider-honeycombio/internal/models"
)

func notificationRecipientSchema() schema.SetNestedBlock {
func notificationRecipientSchema(allowedTypes []client.RecipientType) schema.SetNestedBlock {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!!

@jharley jharley merged commit 04ffa24 into main Nov 7, 2023
3 checks passed
@jharley jharley deleted the jharley.msteams-rcpt-support branch November 7, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue wants to add new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants