Skip to content

Conversation

@EspenAlbert
Copy link
Collaborator

Description

Remove validation that prevented updating alert notifications from types
supporting interval_min to PAGER_DUTY/OPS_GENIE/VICTOR_OPS. Since
interval_min is optional and not preserved via UseStateForUnknown, it will
only be sent to the API if explicitly set in config, allowing updates to
succeed.

Link to any related issue(s): #3869 CLOUDP-358194

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

Remove validation that prevented updating alert notifications from types
supporting interval_min to PAGER_DUTY/OPS_GENIE/VICTOR_OPS. Since
interval_min is optional and not preserved via UseStateForUnknown, it will
only be sent to the API if explicitly set in config, allowing updates to
succeed.

Fixes #3869
@github-actions github-actions bot added the bug label Nov 13, 2025
…ions

Implement a new validator to ensure that the `interval_min` attribute is not set for notification types that do not support it (PAGER_DUTY, OPS_GENIE, VICTOR_OPS). This change prevents configuration errors during the plan phase and enhances user feedback.
@EspenAlbert EspenAlbert marked this pull request as ready for review November 13, 2025 10:58
@EspenAlbert EspenAlbert requested review from a team as code owners November 13, 2025 10:58
Copilot AI review requested due to automatic review settings November 13, 2025 10:58
@github-actions
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

@EspenAlbert
Copy link
Collaborator Author

Failing test is data federation with s3 access error (investigation going on with upstream team)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug preventing updates from notification types supporting interval_min (e.g., MICROSOFT_TEAMS) to types that don't support it (PAGER_DUTY, OPS_GENIE, VICTOR_OPS). The validation is moved from runtime to schema-level to provide earlier feedback while allowing updates to succeed when interval_min is not explicitly set.

Key changes:

  • Replaced runtime validation in NewNotificationList with a schema-level validator
  • Added IntervalMinValidator to validate interval_min during Terraform plan phase
  • Added comprehensive test coverage for notification type transitions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/service/alertconfiguration/validator_interval_min.go Implements new schema-level validator for interval_min attribute
internal/service/alertconfiguration/resource.go Integrates the validator into the schema definition
internal/service/alertconfiguration/model.go Removes old runtime validation logic
internal/service/alertconfiguration/resource_test.go Adds test cases for notification type transitions and validation
.changelog/3882.txt Documents the bug fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants