reverted and changes Alert Channel changes as per latest API v4 changes#890
reverted and changes Alert Channel changes as per latest API v4 changes#890srbhaakamai wants to merge 6 commits intolinode:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Re-enables Monitor alert channel functionality and related integration tests, updating the Alert Channel model to match the latest API v4 shape.
Changes:
- Re-enabled integration tests that depend on listing alert channels and selecting a channel ID dynamically.
- Implemented
AlertChanneltypes (includingcontent/detailsblocks) and restoredListAlertChannels. - Added JSON unmarshalling for
created/updatedtimestamps usingparseabletime.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| test/integration/monitor_alert_definitions_test.go | Re-enables alert channel listing tests and uses live channel discovery for alert definition creation. |
| monitor_alert_channels.go | Restores alert channel API surface (types + ListAlertChannels) updated for API v4 response schema. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
satkumar-akamai
left a comment
There was a problem hiding this comment.
Changes looks good as per API Spec.
yec-akamai
left a comment
There was a problem hiding this comment.
Overall looks good. Can you fix the comments please?
yec-akamai
left a comment
There was a problem hiding this comment.
Can you also run the integration test and re-generate the fixtures please?
|
@yec-akamai i fixed all comments from you and copilot. Please check. i marked most of them which were simple as resolved from my side. please have a look and request further review/approval. Srinidhi |
| return alertDef, err | ||
| } | ||
|
|
||
| if alertDef.Status != AlertDefinitionStatusInProgress { |
There was a problem hiding this comment.
Considering there are more statuses added, just checking if it's enabling status is probably not so useful.
I think we can change this function to intake and wait for a specific a target status. We can change the function head to be
func (client Client) WaitForAlertDefinitionStatus(
ctx context.Context,
status AlertDefinitionStatus,
serviceType string,
alertID int,
timeoutSeconds int,
) {...}
and wait for the target status.
📝 Description
What does this PR do and why is this change necessary?
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?
srbha@blr-mpo40 linodego % export LINODE_TOKEN="" && export LINODE_API_VERSION="v4beta" && go test -count=1 ./test/integration -run "TestMonitorAlertDefinition" -v
=== RUN TestMonitorAlertDefinition_smoke
--- PASS: TestMonitorAlertDefinition_smoke (66.19s)
=== RUN TestMonitorAlertDefinitions_List
--- PASS: TestMonitorAlertDefinitions_List (1.37s)
=== RUN TestMonitorAlertDefinition_CreateWithIdempotency
--- PASS: TestMonitorAlertDefinition_CreateWithIdempotency (3.88s)
PASS
ok github.com/linode/linodego/test/integration 72.096s
📷 Preview
If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.