ACLP clone alert definition and addition of group by field in alerting APIs#985
Open
shkaruna wants to merge 2 commits into
Open
ACLP clone alert definition and addition of group by field in alerting APIs#985shkaruna wants to merge 2 commits into
shkaruna wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for the group_by field on Monitor Alert Definitions and introduces a clone API operation, along with unit/integration tests and updated VCR fixtures.
Changes:
- Add
GroupBy(group_by) to alert definition models and create/update options. - Add
CloneMonitorAlertDefinitionAPI +AlertDefinitionCloneOptions. - Expand unit/integration tests and fixtures to cover
group_byand cloning.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
monitor_alert_definitions.go |
Adds group_by support to structs/options and introduces clone options + client method. |
test/unit/monitor_alert_definitions_test.go |
Updates unit payloads/asserts for group_by and adds unit tests for clone. |
test/integration/monitor_alert_definitions_test.go |
Adds group_by assertions and a new clone integration test. |
test/integration/fixtures/TestMonitorAlertDefinitions_List.yaml |
Updates list fixture payload to include group_by and new dataset. |
test/integration/fixtures/TestMonitorAlertDefinition_CreateWithIdempotency.yaml |
Updates create-with-idempotency fixture to include group_by and new IDs/timestamps. |
test/integration/fixtures/TestMonitorAlertDefinition_Clone.yaml |
New fixture covering clone flow. |
test/integration/fixtures/TestMonitorAlertDefinition.yaml |
Updates main monitor alert definition fixture to include group_by and new IDs/timestamps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+401
to
+403
| if err != nil { | ||
| t.Logf("failed to wait for source alert definition to be enabled: %s", err) | ||
| } |
a0a54f4 to
19f2838
Compare
…lone_and_group_by
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.
📝 Description
This PR adds support for the group_by field on ACLP Monitor Alert Definitions and introduces a clone API operation, along with unit/integration tests and updated VCR fixtures.
Changes:
Add GroupBy (group_by) to alert definition models and create/update options.
Add CloneMonitorAlertDefinition API + AlertDefinitionCloneOptions.
Expand unit/integration tests and fixtures to cover group_by and cloning.
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
Not applicable
How do I run the relevant unit/integration tests?
Prerequisites
Go 1.19+ installed
Valid Linode API token with monitor permissions
Export LINODE_TOKEN environment variable for integration tests
Unit tests:
Run all the unit tests:
make test-unit
Run Monitor alert unit tests:
go test -v ./test/unit/... -run Alert
Integration tests:
Record:
LINODE_TOKEN="Linode API token"
ENABLE_CLOUD_FW=false make TEST_ARGS='-run "AlertDefinition"' fixtures
Play:
make test-int
make test-int TEST_ARGS='-run "AlertDefinition"'