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 team notification configurations #1016

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jfreda
Copy link
Member

@jfreda jfreda commented Dec 5, 2024

Description

This PR adds support for team notification configurations.

External links

Output from tests

$ ENABLE_BETA=1 go test ./... -run 'TestTeamNotificationConfiguration' -v
=== RUN   TestTeamNotificationConfigurationList
=== RUN   TestTeamNotificationConfigurationList/with_a_valid_team
    team_notification_configuration_integration_test.go:43: paging not supported yet in API
=== RUN   TestTeamNotificationConfigurationList/with_list_options
    team_notification_configuration_integration_test.go:49: paging not supported yet in API
=== RUN   TestTeamNotificationConfigurationList/without_a_valid_team
--- PASS: TestTeamNotificationConfigurationList (1.88s)
    --- SKIP: TestTeamNotificationConfigurationList/with_a_valid_team (0.15s)
    --- SKIP: TestTeamNotificationConfigurationList/with_list_options (0.00s)
    --- PASS: TestTeamNotificationConfigurationList/without_a_valid_team (0.00s)
=== RUN   TestTeamNotificationConfigurationCreate
=== RUN   TestTeamNotificationConfigurationCreate/with_all_required_values
=== RUN   TestTeamNotificationConfigurationCreate/without_a_required_value
=== RUN   TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_generic
=== RUN   TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_slack
=== RUN   TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_MS_Teams
=== RUN   TestTeamNotificationConfigurationCreate/without_a_valid_team
=== RUN   TestTeamNotificationConfigurationCreate/with_an_invalid_notification_trigger
=== RUN   TestTeamNotificationConfigurationCreate/with_email_users_when_destination_type_is_email
=== RUN   TestTeamNotificationConfigurationCreate/without_email_users_when_destination_type_is_email
--- PASS: TestTeamNotificationConfigurationCreate (3.11s)
    --- PASS: TestTeamNotificationConfigurationCreate/with_all_required_values (0.15s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_a_required_value (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_generic (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_slack (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_a_required_value_URL_when_destination_type_is_MS_Teams (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_a_valid_team (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/with_an_invalid_notification_trigger (0.00s)
    --- PASS: TestTeamNotificationConfigurationCreate/with_email_users_when_destination_type_is_email (0.21s)
    --- PASS: TestTeamNotificationConfigurationCreate/without_email_users_when_destination_type_is_email (0.19s)
=== RUN   TestTeamNotificationConfigurationsCreate_byType
=== PAUSE TestTeamNotificationConfigurationsCreate_byType
=== RUN   TestTeamNotificationConfigurationRead
=== RUN   TestTeamNotificationConfigurationRead/with_a_valid_ID
=== RUN   TestTeamNotificationConfigurationRead/when_the_notification_configuration_does_not_exist
=== RUN   TestTeamNotificationConfigurationRead/when_the_notification_configuration_ID_is_invalid
--- PASS: TestTeamNotificationConfigurationRead (1.94s)
    --- PASS: TestTeamNotificationConfigurationRead/with_a_valid_ID (0.16s)
    --- PASS: TestTeamNotificationConfigurationRead/when_the_notification_configuration_does_not_exist (0.11s)
    --- PASS: TestTeamNotificationConfigurationRead/when_the_notification_configuration_ID_is_invalid (0.00s)
=== RUN   TestTeamNotificationConfigurationUpdate
=== RUN   TestTeamNotificationConfigurationUpdate/with_options
=== RUN   TestTeamNotificationConfigurationUpdate/with_invalid_notification_trigger
=== RUN   TestTeamNotificationConfigurationUpdate/with_email_users_when_destination_type_is_email
=== RUN   TestTeamNotificationConfigurationUpdate/without_email_users_when_destination_type_is_email
=== RUN   TestTeamNotificationConfigurationUpdate/without_options
=== RUN   TestTeamNotificationConfigurationUpdate/when_the_notification_configuration_does_not_exist
=== RUN   TestTeamNotificationConfigurationUpdate/when_the_notification_configuration_ID_is_invalid
--- PASS: TestTeamNotificationConfigurationUpdate (6.76s)
    --- PASS: TestTeamNotificationConfigurationUpdate/with_options (0.73s)
    --- PASS: TestTeamNotificationConfigurationUpdate/with_invalid_notification_trigger (0.00s)
    --- PASS: TestTeamNotificationConfigurationUpdate/with_email_users_when_destination_type_is_email (0.21s)
    --- PASS: TestTeamNotificationConfigurationUpdate/without_email_users_when_destination_type_is_email (0.20s)
    --- PASS: TestTeamNotificationConfigurationUpdate/without_options (0.39s)
    --- PASS: TestTeamNotificationConfigurationUpdate/when_the_notification_configuration_does_not_exist (0.14s)
    --- PASS: TestTeamNotificationConfigurationUpdate/when_the_notification_configuration_ID_is_invalid (0.00s)
=== RUN   TestTeamNotificationConfigurationDelete
=== RUN   TestTeamNotificationConfigurationDelete/with_a_valid_ID
=== RUN   TestTeamNotificationConfigurationDelete/when_the_notification_configuration_does_not_exist
=== RUN   TestTeamNotificationConfigurationDelete/when_the_notification_configuration_ID_is_invalid
--- PASS: TestTeamNotificationConfigurationDelete (2.22s)
    --- PASS: TestTeamNotificationConfigurationDelete/with_a_valid_ID (0.30s)
    --- PASS: TestTeamNotificationConfigurationDelete/when_the_notification_configuration_does_not_exist (0.13s)
    --- PASS: TestTeamNotificationConfigurationDelete/when_the_notification_configuration_ID_is_invalid (0.00s)
=== RUN   TestTeamNotificationConfigurationVerify
=== RUN   TestTeamNotificationConfigurationVerify/with_a_valid_ID
=== RUN   TestTeamNotificationConfigurationVerify/when_the_notification_configuration_does_not_exists
=== RUN   TestTeamNotificationConfigurationVerify/when_the_notification_configuration_ID_is_invalid
--- PASS: TestTeamNotificationConfigurationVerify (2.33s)
    --- PASS: TestTeamNotificationConfigurationVerify/with_a_valid_ID (0.39s)
    --- PASS: TestTeamNotificationConfigurationVerify/when_the_notification_configuration_does_not_exists (0.12s)
    --- PASS: TestTeamNotificationConfigurationVerify/when_the_notification_configuration_ID_is_invalid (0.00s)
=== CONT  TestTeamNotificationConfigurationsCreate_byType
=== RUN   TestTeamNotificationConfigurationsCreate_byType/with_trigger_change_request:created_and_all_required_values
=== PAUSE TestTeamNotificationConfigurationsCreate_byType/with_trigger_change_request:created_and_all_required_values
=== CONT  TestTeamNotificationConfigurationsCreate_byType/with_trigger_change_request:created_and_all_required_values
--- PASS: TestTeamNotificationConfigurationsCreate_byType (1.74s)
    --- PASS: TestTeamNotificationConfigurationsCreate_byType/with_trigger_change_request:created_and_all_required_values (0.14s)
PASS
ok  	github.com/hashicorp/go-tfe	20.447s

@jfreda
Copy link
Member Author

jfreda commented Dec 11, 2024

A fix for the linting error might be kind of weird IMO, but I can do it if any reviewers feel strongly about it (I saw in CONTRIBUTING.md that linting is not strictly required for these to pass; not sure if this would require an ignore to not be noisy in CI).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant