ACLP: Cleanup entity related response fields from alert definition#943
Open
shkaruna wants to merge 5 commits intolinode:mainfrom
Open
ACLP: Cleanup entity related response fields from alert definition#943shkaruna wants to merge 5 commits intolinode:mainfrom
shkaruna wants to merge 5 commits intolinode:mainfrom
Conversation
Add entity envelope in AlertDefinition GET, POST and PUT API responses. Add new method to list entities. Update tests.
…clp-list-entities
Remove entity_ids and has_more_resources response fields
…p/entity-related-fields
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Monitor (ACLP) alert definition model and test fixtures to reflect API responses that no longer include the top-level entity_ids and has_more_resources fields, relying instead on the nested entities object for entity metadata.
Changes:
- Removed
entity_idsand top-levelhas_more_resourcesfromAlertDefinitionresponse struct. - Updated unit/integration tests to stop asserting on removed response fields.
- Re-recorded/updated integration fixtures to match the new response shape.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
monitor_alert_definitions.go |
Removes deprecated entity-related response fields from AlertDefinition. |
test/unit/monitor_alert_definitions_test.go |
Updates mock JSON fixtures and assertions to stop referencing removed fields; removes a label-only update test. |
test/integration/monitor_alert_definitions_test.go |
Removes assertions against EntityIDs in the created alert response. |
test/integration/fixtures/TestMonitorAlertDefinitions_List.yaml |
Updates recorded responses to omit entity_ids and top-level has_more_resources. |
test/integration/fixtures/TestMonitorAlertDefinitionEntities_List.yaml |
Updates recorded responses to omit removed top-level fields. |
test/integration/fixtures/TestMonitorAlertDefinition.yaml |
Updates recorded create/get/update flows to omit removed top-level fields and adjusts recorded IDs/timestamps. |
test/integration/fixtures/TestMonitorAlertDefinition_CreateWithIdempotency.yaml |
Updates recorded create/delete interactions to omit removed top-level fields and refreshes recorded values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Cleanup entity related response fields from alert definition.
Removed entity_ids and has_more_resources response fields of ACLP alerting APIs.
Updated test cases.
✔️ 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 Monitor alert definition unit tests:
go test -v ./test/unit/... -run MonitorAlertDefinition
Output:
=== RUN TestCreateMonitorAlertDefinition
--- PASS: TestCreateMonitorAlertDefinition (0.00s)
=== RUN TestCreateMonitorAlertDefinitionWithIdempotency
--- PASS: TestCreateMonitorAlertDefinitionWithIdempotency (0.00s)
=== RUN TestGetMonitorAlertDefinition
--- PASS: TestGetMonitorAlertDefinition (0.00s)
=== RUN TestListMonitorAlertDefinitions
--- PASS: TestListMonitorAlertDefinitions (0.00s)
=== RUN TestUpdateMonitorAlertDefinition
--- PASS: TestUpdateMonitorAlertDefinition (0.00s)
=== RUN TestDeleteMonitorAlertDefinition
--- PASS: TestDeleteMonitorAlertDefinition (0.00s)
=== RUN TestListMonitorAlertDefinitionEntities
--- PASS: TestListMonitorAlertDefinitionEntities (0.00s)
PASS
ok github.com/linode/linodego/test/unit 0.007s
Integration tests:
Play:
make test-int
make test-int TEST_ARGS='-run "Alert"'
cd test && make test-int TEST_TIMEOUT=5h
make[1]: Entering directory '/home/shkaruna/sdk/linodego/test'
2026/04/27 18:57:06 [INFO] LINODE_FIXTURE_MODE play will be used for tests
2026/04/27 18:57:06 [INFO] Fixture mode play - Test Linode Cloud Firewall not created
=== RUN TestMonitorAlertDefinition_smoke
--- PASS: TestMonitorAlertDefinition_smoke (0.00s)
=== RUN TestMonitorAlertDefinitions_List
--- PASS: TestMonitorAlertDefinitions_List (0.00s)
=== RUN TestMonitorAlertChannels_List
--- PASS: TestMonitorAlertChannels_List (0.00s)
=== RUN TestMonitorAlertDefinition_CreateWithIdempotency
--- PASS: TestMonitorAlertDefinition_CreateWithIdempotency (0.00s)
=== RUN TestMonitorAlertDefinitionEntities_List
--- PASS: TestMonitorAlertDefinitionEntities_List (0.00s)
PASS
ok github.com/linode/linodego/test/integration (cached)
make[1]: Leaving directory '/home/shkaruna/sdk/linodego/test'
Record
export LINODE_TOKEN="Linode API token"
ENABLE_CLOUD_FW=false make TEST_ARGS='-run "Alert"' fixtures