Aclp logs support#963
Conversation
…sue with always serialized storage key and secret - now test logs destination tests will always pass also in recording mode
…pi.linode fixtures
# Conflicts: # test/integration/fixtures/TestLogsDestination_Create_InvalidSecret.yaml # test/integration/fixtures/TestLogsDestination_Create_InvalidType.yaml # test/integration/fixtures/TestLogsDestination_Delete.yaml # test/integration/fixtures/TestLogsDestination_Get.yaml # test/integration/fixtures/TestLogsDestination_List.yaml # test/integration/fixtures/TestLogsDestination_UpdateAndHistory.yaml
Dps 42279 aclp logs stream api
…event input run_aclp_logs_stream_tests
There was a problem hiding this comment.
Pull request overview
This PR adds first-class linodego SDK support for the ACLP Monitor Logs API, covering both Logs Destinations (monitor/streams/destinations) and Logs Streams (monitor/streams), along with unit + integration test coverage and CI wiring for optionally running long-running stream tests.
Changes:
- Introduces new SDK types and client methods for Logs Destinations and Logs Streams, including history endpoints and time parsing.
- Adds comprehensive unit tests and JSON fixtures for destinations and streams (including LKE audit log stream details).
- Adds integration tests + go-vcr cassettes for destinations/streams and updates CI to allow opting into stream tests via
RUN_ACLP_LOGS_STREAM_TESTS.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
monitor_log_destinations.go |
Implements Logs Destination models and CRUD/history client methods. |
monitor_log_streams.go |
Implements Logs Stream models and CRUD/history client methods. |
test/unit/monitor_logs_test.go |
Adds unit tests for destinations, streams, and stream type constants. |
test/unit/fixtures/monitor_log_destinations_get.json |
Unit fixture for fetching a destination. |
test/unit/fixtures/monitor_log_destinations_list.json |
Unit fixture for listing destinations (including custom_https). |
test/unit/fixtures/monitor_log_destinations_history_list.json |
Unit fixture for destination history listing. |
test/unit/fixtures/monitor_log_destinations_custom_https_get.json |
Unit fixture for custom_https destination fetch. |
test/unit/fixtures/monitor_log_stream.json |
Unit fixture for fetching a stream (audit_logs). |
test/unit/fixtures/monitor_log_streams_list.json |
Unit fixture for listing streams. |
test/unit/fixtures/monitor_log_streams_history.json |
Unit fixture for stream history listing. |
test/unit/fixtures/monitor_log_stream_lke.json |
Unit fixture for fetching an LKE audit log stream (details block). |
test/integration/monitor_logs_test.go |
Adds integration coverage for destination + stream lifecycle, with long provisioning safeguards. |
test/integration/integration_suite_test.go |
Adjusts go-vcr sanitization behavior to keep credentials usable during recording. |
.github/workflows/ci.yml |
Adds workflow_dispatch input and exports RUN_ACLP_LOGS_STREAM_TESTS to test runs. |
test/integration/fixtures/TestLogsDestination_List.yaml |
VCR cassette for listing destinations. |
test/integration/fixtures/TestLogsDestination_Get.yaml |
VCR cassette for getting a destination. |
test/integration/fixtures/TestLogsDestination_Delete.yaml |
VCR cassette for deleting a destination and cleaning up Object Storage. |
test/integration/fixtures/TestLogsDestination_UpdateAndHistory.yaml |
VCR cassette for updating a destination and validating history. |
test/integration/fixtures/TestLogsDestination_Create_InvalidSecret.yaml |
VCR cassette for invalid destination secret error case. |
test/integration/fixtures/TestLogsDestination_Create_InvalidType.yaml |
VCR cassette for invalid destination type error case. |
test/integration/fixtures/TestLogStream_Create_InvalidDestination.yaml |
VCR cassette for invalid destination stream create error case. |
test/integration/fixtures/TestLogStream_Create_EmptyDestinations.yaml |
VCR cassette for empty destinations stream create error case. |
test/integration/fixtures/TestLogStream_Create_TwoDestinations.yaml |
VCR cassette for multi-destination stream create error case. |
test/integration/fixtures/TestLogStream_Delete.yaml |
VCR cassette for stream delete flow. |
test/integration/fixtures/TestLogStream_List.yaml |
VCR cassette for stream list flow. |
test/integration/fixtures/TestLogStream_Get.yaml |
VCR cassette for stream get flow. |
test/integration/fixtures/TestLogStream_Update_LabelAndStatus.yaml |
VCR cassette for stream label/status update and history validation. |
test/integration/fixtures/TestLogStream_Update_Destinations.yaml |
VCR cassette for stream destination update and history validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…event input run_aclp_logs_stream_tests to integration tests pr yaml
…from PR comments, regenerated sanitized fixtures
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
yec-akamai
left a comment
There was a problem hiding this comment.
Can you replace all omitempty with omitzero in this PR? It resolves some edge case issues that omitempty used to have.
| const ( | ||
| // StreamDestinationTypeAkamaiObjectStorage sends logs to Akamai Object Storage. | ||
| StreamDestinationTypeAkamaiObjectStorage StreamDestinationType = "akamai_object_storage" | ||
| ) |
There was a problem hiding this comment.
According to the api spec, is custom_https also part of the enum for stream destination?
| type StreamUpdateOptions struct { | ||
| Destinations []int `json:"destinations,omitempty"` | ||
| Label *string `json:"label,omitempty"` | ||
| Type *StreamType `json:"type,omitempty"` |
There was a problem hiding this comment.
Looks Type is not updatable in the spec. Can you verify it?
📝 Description
What does this PR do and why is this change necessary?
github workflow files were updated to include the run_aclp_logs_stream_tests environment variable.
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
How do I run the relevant unit/integration tests?