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 severity options in AlertPolicy #9544

Merged
merged 4 commits into from
Dec 11, 2023

Conversation

jedouard1994
Copy link
Contributor

@jedouard1994 jedouard1994 commented Nov 29, 2023

Resolves hashicorp/terraform-provider-google#16627

Adds support for severity options in AlertPolicy.

I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

monitoring: added `severity` field to `google_monitoring_alert_policy` resource

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 50 insertions(+))
Terraform Beta: Diff ( 3 files changed, 50 insertions(+))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 50 insertions(+))
Terraform Beta: Diff ( 3 files changed, 50 insertions(+))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3243
Passed tests 2911
Skipped tests: 331
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccMonitoringAlertPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccMonitoringAlertPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

LGTM, but the field appears to be updatable based on the config, so we should probably test that if possible.

@jedouard1994
Copy link
Contributor Author

@roaks3 Sorry for the delay. Update tests were failing in prod until a recent deployment.

They've been added and should be passing now.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 59 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 59 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3275
Passed tests 2940
Skipped tests: 334
Affected tests: 1

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccMonitoringAlertPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccMonitoringAlertPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@roaks3
Copy link
Contributor

roaks3 commented Dec 11, 2023

It looks like the linter is unhappy with the formatting of one of the files. Could you double check?

Run make lint
==> Checking that code complies with gofmt requirements...
gofmt needs running on the following files:
./google-beta/services/monitoring/resource_monitoring_alert_policy_test.go
You can use the command: `make fmt` to reformat code.

Also, I missed this before, but can we make sure what the behavior is if the severity is not specified? If there is a default set by the service, we may need to add default_from_api: true.

@jedouard1994
Copy link
Contributor Author

Reformatted the go files, hopefully this fixes linter.

If severity is not specified, the API omits the field. There is no default.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 59 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 3 files changed, 59 insertions(+), 5 deletions(-))
TF Conversion: Diff ( 1 file changed, 10 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3290
Passed tests 2953
Skipped tests: 337
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

LGTM

@roaks3
Copy link
Contributor

roaks3 commented Dec 11, 2023

Note: I tweaked the issue description to include the full issue URL that this PR fixes. That will trigger the auto-close behavior.

@roaks3 roaks3 merged commit 42bac03 into GoogleCloudPlatform:main Dec 11, 2023
7 checks passed
kapreus pushed a commit to kapreus/magic-modules that referenced this pull request Jan 2, 2024
…9544)

* Add support for severity options in AlertPolicy

* Update description for severity options

* Add update test for severity options

* Format go changes

---------

Co-authored-by: James Edouard <[email protected]>
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…9544)

* Add support for severity options in AlertPolicy

* Update description for severity options

* Add update test for severity options

* Format go changes

---------

Co-authored-by: James Edouard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_monitoring_alert_policy doesn't support severity
3 participants