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: Add conditions to monv2 action rules #178

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

obs-gh-catherman
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@obs-gh-abhinavpappu obs-gh-abhinavpappu left a comment

Choose a reason for hiding this comment

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

lgtm!

also the pr title should probably be feat: ... instead of fix: ...

@@ -306,6 +306,33 @@ func monitorV2FlattenWebhookHeader(gqlHeader gql.MonitorV2WebhookHeader) interfa
return header
}

func newMonitorV2ComparisonExpressionInput(path string, data *schema.ResourceData) (input *gql.MonitorV2ComparisonExpressionInput, diags diag.Diagnostics) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this probably belongs in resource_monitor_v2.go

@@ -302,6 +315,8 @@ func TestAccObserveMonitorV2MultipleActionsEmailViaOneShot(t *testing.T) {
resource.TestCheckResourceAttr("observe_monitor_v2.first", "actions.0.action.0.type", "email"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "actions.0.send_reminders_interval", "10m0s"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "actions.1.send_reminders_interval", "20m0s"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "actions.1.conditions.0.compare_terms.0.comparison.0.compare_fn", "equal"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "actions.1.conditions.0.compare_terms.0.column.0.column_path.0.name", "description"),
),
Copy link
Collaborator

Choose a reason for hiding this comment

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

would be good to check the value_string as well

// not support it, so we don't here either.
"compare_terms": { // [MonitorV2ComparisonTerm!]
Type: schema.TypeList,
Optional: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh wait this should probably be required with minitems 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, good point. until i add support for sub-expressions, it is a minitems=1 instead of a exactlyoneof kind of thing, huh?

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh i see, yeah can change it to exactlyoneof once sub-expressions are implemented

@obs-gh-catherman obs-gh-catherman changed the title fix: Add conditions to monv2 action rules feat: Add conditions to monv2 action rules Dec 10, 2024
@obs-gh-abhinavpappu obs-gh-abhinavpappu merged commit 37ca21f into master Dec 10, 2024
4 of 5 checks passed
@obs-gh-abhinavpappu obs-gh-abhinavpappu deleted the mon-v2-conditions branch December 10, 2024 17:22
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