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

feat(notification): add auto destroy configuration triggers #918

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

notchairmk
Copy link
Member

@notchairmk notchairmk commented Jun 14, 2024

Description

This change adds auto destroy configuration triggers for workspace notification configurations. Also adds a test to test creation of all notification configuration triggers.

Testing plan

  1. tests pass
  2. (optionally) disable all cleanup steps in TestNotificationConfigurationsCreate_byType run tests and confirm that all notification trigger types look correct in the workspace notification settings

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ envchain go-tfe go test -run "TestNotificationConfigurationsCreate_byType"  -v ./...
?   	github.com/hashicorp/go-tfe/examples/backing_data	[no test files]
?   	github.com/hashicorp/go-tfe/examples/configuration_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/organizations	[no test files]
?   	github.com/hashicorp/go-tfe/examples/registry_modules	[no test files]
?   	github.com/hashicorp/go-tfe/examples/run_errors	[no test files]
?   	github.com/hashicorp/go-tfe/examples/state_versions	[no test files]
?   	github.com/hashicorp/go-tfe/examples/users	[no test files]
?   	github.com/hashicorp/go-tfe/examples/workspaces	[no test files]
?   	github.com/hashicorp/go-tfe/mocks	[no test files]
=== RUN   TestNotificationConfigurationsCreate_byType
=== PAUSE TestNotificationConfigurationsCreate_byType
=== CONT  TestNotificationConfigurationsCreate_byType
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:created_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:created_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:planning_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:planning_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:needs_attention_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:needs_attention_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:applying_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:applying_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:completed_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:completed_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_run:errored_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_run:errored_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_assessment:drifted_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_assessment:drifted_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_assessment:failed_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_assessment:failed_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_assessment:check_failure_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_assessment:check_failure_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_reminder_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_reminder_and_all_required_values
=== RUN   TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_run_results_and_all_required_values
=== PAUSE TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_run_results_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:created_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_run_results_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_reminder_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_assessment:check_failure_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_assessment:failed_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:completed_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:applying_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_assessment:drifted_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:needs_attention_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:errored_and_all_required_values
=== CONT  TestNotificationConfigurationsCreate_byType/with_trigger_run:planning_and_all_required_values
--- PASS: TestNotificationConfigurationsCreate_byType (3.73s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_assessment:failed_and_all_required_values (0.87s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:created_and_all_required_values (1.05s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_run_results_and_all_required_values (1.06s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_workspace:auto_destroy_reminder_and_all_required_values (1.57s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:applying_and_all_required_values (1.57s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_assessment:check_failure_and_all_required_values (1.69s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_assessment:drifted_and_all_required_values (1.79s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:errored_and_all_required_values (1.91s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:needs_attention_and_all_required_values (2.12s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:completed_and_all_required_values (2.16s)
    --- PASS: TestNotificationConfigurationsCreate_byType/with_trigger_run:planning_and_all_required_values (1.34s)
PASS
ok  	github.com/hashicorp/go-tfe	6.457s

@notchairmk notchairmk force-pushed the notchairmk/auto-destroy-notifications branch from 225490c to 2632142 Compare June 14, 2024 15:30
@notchairmk notchairmk requested a review from a team June 14, 2024 15:33
@notchairmk notchairmk marked this pull request as ready for review June 14, 2024 15:33
@notchairmk notchairmk requested a review from a team as a code owner June 14, 2024 15:33
Copy link
Member

@jfreda jfreda left a comment

Choose a reason for hiding this comment

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

Nice, looks good!

@notchairmk notchairmk merged commit d981486 into main Jun 18, 2024
8 checks passed
@notchairmk notchairmk deleted the notchairmk/auto-destroy-notifications branch June 18, 2024 16:33
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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.

2 participants