ACLP: Remove content field from list alert channels response#925
Open
shkaruna wants to merge 1 commit intolinode:mainfrom
Open
ACLP: Remove content field from list alert channels response#925shkaruna wants to merge 1 commit intolinode:mainfrom
shkaruna wants to merge 1 commit intolinode:mainfrom
Conversation
Author
|
@satkumar-akamai : Please review |
5703d95 to
740ea0a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Monitor alert channels model/tests to align with the API change where the content field is no longer part of the list alert channels response and details is the supported replacement.
Changes:
- Removed
AlertChannel.Contentand related content types from the SDK model. - Added/updated unit and integration assertions to validate
details.emaildecoding. - Updated the integration fixture data for
TestMonitorAlertChannels_List.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
monitor_alert_channels.go |
Removes the content field/types from AlertChannel, leaving details as the structured data source. |
test/unit/monitor_alert_channels_test.go |
Adds a unit test ensuring details.email unmarshals correctly. |
test/integration/monitor_alert_definitions_test.go |
Strengthens integration assertions to verify Details.Email and RecipientType are present. |
test/integration/fixtures/TestMonitorAlertChannels_List.yaml |
Updates recorded list response fixture (now includes multiple channels), but still contains content fields. |
Comments suppressed due to low confidence (1)
monitor_alert_channels.go:35
- Removing the exported
Contentfield fromAlertChannelis a compile-time breaking change for any SDK consumers that referencedAlertChannel.Content. If the API is deprecatingcontentbut you want to preserve backwards compatibility, consider keepingContentas a deprecated field (and/or aliasing it toDetails) so existing clients continue to build while migrating toDetails.
// AlertChannel represents a Monitor Channel object.
type AlertChannel struct {
Alerts AlertsInfo `json:"alerts"`
ChannelType AlertNotificationType `json:"channel_type"`
Details ChannelDetails `json:"details"`
Created *time.Time `json:"-"`
CreatedBy string `json:"created_by"`
Updated *time.Time `json:"-"`
UpdatedBy string `json:"updated_by"`
ID int `json:"id"`
Label string `json:"label"`
Type AlertChannelType `json:"type"`
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
740ea0a to
4178224
Compare
mgwoj
requested changes
Apr 3, 2026
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
Remove content field from list alert channels response.
contentfield is replaced withdetails.Ticket: DPS-41868
✔️ 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:
make test-unit
go test -v ./test/unit/... -run Alert
=== RUN TestListAlertChannels
--- PASS: TestListAlertChannels (0.00s)
=== 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 TestUpdateMonitorAlertDefinition_LabelOnly
--- PASS: TestUpdateMonitorAlertDefinition_LabelOnly (0.00s)
=== RUN TestDeleteMonitorAlertDefinition
--- PASS: TestDeleteMonitorAlertDefinition (0.00s)
PASS
ok github.com/linode/linodego/test/unit 0.009s
Integration tests:
LINODE_TOKEN="Linode API token"
ENABLE_CLOUD_FW=false make TEST_ARGS='-run "TestMonitorAlertChannels_List"' fixtures
cd ./test/integration &&
LINODE_FIXTURE_MODE="record"
LINODE_TOKEN=
LINODE_API_VERSION="v4beta"
LINODE_URL="https://api.linode.com/"
GO111MODULE="on"
go test -timeout=5h -v -run "TestMonitorAlertChannels_List"
2026/03/31 15:27:20 [INFO] LINODE_FIXTURE_MODE record will be used for tests
2026/03/31 15:27:20 [INFO] ENABLE_CLOUD_FW is false - skipping Cloud Firewall setup
=== RUN TestMonitorAlertChannels_List
--- PASS: TestMonitorAlertChannels_List (2.98s)
PASS
ok github.com/linode/linodego/test/integration 2.995s
make test-int
make test-int TEST_ARGS='-run "AlertChannels"'
cd test && make test-int TEST_TIMEOUT=5h
make[1]: Entering directory '/home/shkaruna/sdk/linodego/test'
2026/03/31 16:04:21 [INFO] LINODE_FIXTURE_MODE play will be used for tests
2026/03/31 16:04:21 [INFO] Fixture mode play - Test Linode Cloud Firewall not created
=== RUN TestMonitorAlertChannels_List
--- PASS: TestMonitorAlertChannels_List (0.00s)
PASS
ok github.com/linode/linodego/test/integration 0.010s
make[1]: Leaving directory '/home/shkaruna/sdk/linodego/test'