Aclp logs support#686
Conversation
…ard if stream already exists
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…coped fixture for deterministic execution
There was a problem hiding this comment.
Pull request overview
Adds first-class SDK support for the Monitor Logs API (Destinations + Streams), including object models, Monitor group helpers, and accompanying unit/integration test coverage with CI workflow knobs for long-running stream provisioning.
Changes:
- Introduces
LogsDestination*andLogsStream*objects (including history + destination update support) inlinode_api4/objects/monitor.py. - Adds
MonitorGroup.destinations(),destination_create(),streams(), andstream_create()inlinode_api4/groups/monitor.py. - Adds unit tests, integration tests (with capability + env-var gating), fixtures, and updates e2e workflows to pass
RUN_ACLP_LOGS_STREAM_TESTS.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
linode_api4/objects/monitor.py |
Adds logs destination/stream models, enums, and history/update helpers. |
linode_api4/groups/monitor.py |
Adds Monitor group methods to list/create destinations and streams. |
test/unit/objects/monitor_test.py |
Adds unit tests validating serialization/deserialization and endpoints for logs APIs. |
test/integration/models/monitor/test_monitor_logs.py |
Adds integration coverage for destinations and streams with skip safeguards. |
test/fixtures/monitor_streams_destinations.json |
Adds fixture for listing destinations. |
test/fixtures/monitor_streams_destinations_1_history.json |
Adds fixture for destination history. |
test/fixtures/monitor_streams.json |
Adds fixture for listing streams. |
test/fixtures/monitor_streams_1_history.json |
Adds fixture for stream history. |
.github/workflows/e2e-test.yml |
Adds workflow_dispatch input and passes env var to integration test runner. |
.github/workflows/e2e-test-pr.yml |
Adds workflow_dispatch input and passes env var to integration test runner for PR runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
b2de6cd to
cdf2c04
Compare
|
Added missing signature to the commit, CI fails on lint because of PR title. Should I change it to something specific? |
Just added label to your PR to pass the CI |
| def require_aclp_logs(test_linode_client: LinodeClient): | ||
| """Skip all tests in this module if the aclp_logs feature is not enabled for the account.""" | ||
| account = test_linode_client.account() | ||
| if Capability.aclp_logs not in account.capabilities: |
There was a problem hiding this comment.
Capability are defined for regions capabilities in the python sdk. It's probably a different value from the account capabilities. The test looks always skipped even the customer tag is added. Do you think it's still a necessary check?
📝 Description
Adds support for monitor logs functionality
What does this PR do and why is this change necessary?
run_aclp_logs_stream_tests) needs to be set astrueoryesto enable testing the Stream portion of the API.run_aclp_logs_stream_testsenvironment variable.Notes:
✔️ How to Test
How do I run the relevant unit/integration tests?
Unit tests:
pytest test/unitto run all unit tests, or:pytest test/unit/objects/monitor_test.pyto run only monitor related testsIntegration tests:
export LINODE_TOKEN="YOUR_REAL_TOKEN"export RUN_ACLP_LOGS_STREAM_TESTS=truemake TEST_CASE=test_monitor_logs test-intNotes:
Akamai Cloud Pulse Logsaccount capability