Repository navigation
TPT-3596: Project CloudPulse Metrics Integration for Core Compute - #750
Open
yec-akamai wants to merge 3 commits into
Open
yec-akamai wants to merge 3 commits into
yec-akamai wants to merge 3 commits into
Conversation
* init * address comments
* Create tests for Linode integration with alerts * Code review fixes * Remove test test_try_to_update_linode_alerts_legacy_and_aclp_at_the_same_time and add test test_update_linode_aclp_alerts * Apply code review suggestions * Submit code review suggestions
# Conflicts: # linode_api4/groups/linode.py # linode_api4/objects/linode.py # test/integration/conftest.py # test/unit/objects/linode_test.py
yec-akamai
requested review from
ezilber-akamai and
psnoch-akamai
and removed request for
a team
October 13, 2026 18:26
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Positional API compatibility is broken, and integration tests need corrections to alert selection, persistence verification, and resource cleanup.
7 open issues
Append alerts parameter to preserve positional arguments · New Use a valid compute alert definition for Linode updates · New Scope alert lookup to Linode and handle pagination · New Select the fixture instance before asserting alert thresholds · New Reload the instance before verifying saved thresholds · New Ensure clone cleanup runs when assertions fail · New Reload the instance before verifying persisted alert IDs · New
What changed in this PR
Adds CloudPulse alert support to core compute instances in the Python SDK.
Changes:
- Adds typed legacy and CloudPulse alert models.
- Accepts CloudPulse alert options during instance creation and cloning.
- Extends fixtures, unit tests, and integration workflows for alerts.
| File | Description |
|---|---|
test/unit/objects/linode_test.py |
Tests alert decoding and clone payloads. |
test/integration/models/linode/test_linode.py |
Adds alert lifecycle integration tests. |
test/integration/conftest.py |
Adds alert definition fixtures and lookup helpers. |
test/fixtures/linode_instances.json |
Adds CloudPulse alert IDs. |
test/fixtures/linode_instances_123_clone.json |
Adds a clone response fixture. |
linode_api4/objects/linode.py |
Models alerts and extends cloning options. |
linode_api4/groups/linode.py |
Adds creation-time alert options. |
Review effort: Balanced
Comment on lines
+166
to
+168
| alerts: Optional[ | ||
| Union[Dict[str, Any], InstanceACLPAlertsOptions] | ||
| ] = None, |
| "trigger_occurrences": 3, | ||
| } | ||
| alert = test_linode_client.monitor.create_alert_definition( | ||
| service_type="dbaas", |
Comment on lines
+877
to
+879
| alerts = client.monitor.alert_definitions() | ||
| system_alerts = [] | ||
| for alert in alerts.lists[0]: |
|
|
||
|
|
||
| def test_get_linodes_verify_alerts(test_linode_client, create_linode): | ||
| linodes_list = test_linode_client.linode.instances().lists[0] |
Comment on lines
+461
to
+465
| assert linode.alerts["cpu"] == 50 | ||
| assert linode.alerts["io"] == 6000 | ||
| assert linode.alerts["network_in"] == 20 | ||
| assert linode.alerts["network_out"] == 20 | ||
| assert linode.alerts["transfer_quota"] == 40 |
Comment on lines
+475
to
+483
| assert new_linode.alerts.cpu == 90 | ||
| assert new_linode.alerts.io == 10000 | ||
| assert new_linode.alerts.network_in == 10 | ||
| assert new_linode.alerts.network_out == 10 | ||
| assert new_linode.alerts.transfer_quota == 80 | ||
| assert isinstance(new_linode.alerts.system_alerts, list) | ||
| assert isinstance(new_linode.alerts.user_alerts, list) | ||
|
|
||
| wait_for_clone_complete_and_delete_linode(10, 100, new_linode) |
Comment on lines
+497
to
+498
| assert linode.alerts["user_alerts"] == [create_alert_service_definition.id] | ||
| assert linode.alerts["system_alerts"] == [sample_system_alert] |
This branch has not been deployed
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
Merge the cloud pulse metrics project into dev.
✔️ How to Test