Skip to content

ACLP clone alert definition and addition of group by field in alerting APIs#985

Open
shkaruna wants to merge 2 commits into
linode:mainfrom
shkaruna:feat/clone_and_group_by
Open

ACLP clone alert definition and addition of group by field in alerting APIs#985
shkaruna wants to merge 2 commits into
linode:mainfrom
shkaruna:feat/clone_and_group_by

Conversation

@shkaruna

@shkaruna shkaruna commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

📝 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"'

@satkumar-akamai satkumar-akamai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@shkaruna shkaruna marked this pull request as ready for review June 9, 2026 07:29
Copilot AI review requested due to automatic review settings June 9, 2026 07:29
@shkaruna shkaruna requested review from a team as code owners June 9, 2026 07:29
@shkaruna shkaruna requested review from mawilk90 and mgwoj and removed request for a team June 9, 2026 07:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 CloneMonitorAlertDefinition API + AlertDefinitionCloneOptions.
  • Expand unit/integration tests and fixtures to cover group_by and 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 thread test/unit/monitor_alert_definitions_test.go Outdated
Comment on lines +401 to +403
if err != nil {
t.Logf("failed to wait for source alert definition to be enabled: %s", err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread test/unit/monitor_alert_definitions_test.go
Comment thread monitor_alert_definitions.go
@shkaruna shkaruna force-pushed the feat/clone_and_group_by branch from a0a54f4 to 19f2838 Compare June 9, 2026 07:56
@shkaruna shkaruna changed the title feat: add aclp clone api and group_by field ACLP clone alert definition and addition of group by field in alerting APIs Jun 9, 2026
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.

3 participants