monitoring: clarify comparison enum doc for alert policy (#16862)#17496
Open
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Open
monitoring: clarify comparison enum doc for alert policy (#16862)#17496jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Conversation
…Platform#16862) The Cloud Monitoring API only supports COMPARISON_LT and COMPARISON_GT for MetricThreshold conditions and SqlCondition row-count tests, but the schema description merely tacked that information on at the end of a long paragraph; the registry doc still leads with all six possible values, surprising users who set COMPARISON_GE and get an API error back. Reword the descriptions for both `condition_threshold.comparison` and `condition_sql.row_count_test.comparison` to lead with the API limitation and link to the canonical reference. Leave the enum_values list untouched so existing imported state with non-LT/GT values keeps parsing — the API itself remains the authoritative gate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @shuyama1, 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documentation fix on
google_monitoring_alert_policy. The Cloud Monitoring API only supportsCOMPARISON_LTandCOMPARISON_GTforcondition_threshold.comparisonandconditions[].condition_sql.row_count_test.comparison, but the registry docs presents all six enum values without clearly flagging the API limitation, so users setCOMPARISON_GE(and friends) and get an API error back.Fixes hashicorp/terraform-provider-google#16862 — see hashicorp/terraform-provider-google#16862
Why
The maintainer (
shuyama1) acknowledged this in 2023:…but the doc cleanup was never shipped. Users continue to hit the same trap (the latest comment on the issue, with screenshot, is from 2025).
This PR rewords the field descriptions to lead with the API limitation and link the canonical reference, so the registry doc is unambiguous. The enum value list is intentionally left intact so already-imported state that happens to contain non-LT/GT values doesn't error out at parse time; the API remains the authoritative gate.
GCP API reference:
What changed
mmv1 source — single file:
Two
comparisonfield descriptions are reworded:conditions[].condition_threshold.comparisonconditions[].condition_sql.row_count_test.comparisonThe downstream impact after regeneration is registry-doc text only —
Descriptionstrings on the schema. No validation change, no plan/apply behavior change.Edge cases tested
comparison = "COMPARISON_LT"comparison = "COMPARISON_GE"tfstatewithCOMPARISON_GETest protocol
comparisonblocks rewritten consistentlyThis is a doc-only change (description text). No live smoke was run because the change does not alter plan/apply behavior, validation, or payload shape — it only changes the doc string surfaced in the registry. The reviewer can compare before/after by re-rendering the registry doc page from the regenerated provider.
Resources
Release notes
Disclosure
This PR was implemented with assistance from Claude Code as part of a focused contribution batch. The diff was reviewed manually against the GCP API documentation linked above. The author (a human) reviewed the diff and the API-premise check before opening this PR.