feat: add app log capture#144
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds typed IaC log-capture support for DigitalOcean App Platform-backed infra.container_service resources, including fetching historic logs and optionally following live logs, and wires the new service into the IaC gRPC server with regression coverage.
Changes:
- Implement
DOProvider.CaptureLogsto fetch historic log content and optionally follow live WebSocket logs. - Add typed IaC
CaptureLogsgRPC server implementation and register it via the existing “auto-register implemented services” mechanism. - Add provider/server regression tests and update dependencies to the workflow version that contains the new log-capture proto.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/provider.go | Declares LogCaptureProvider conformance and exposes an Apps client accessor for log capture. |
| internal/logcapture.go | Implements provider-side log capture: app resolution, historic fetch, and live WebSocket streaming. |
| internal/logcapture_server.go | Adds the typed gRPC CaptureLogs handler and PB→interfaces request mapping. |
| internal/logcapture_test.go | Adds tests for historic log fetching and server-side chunk streaming. |
| internal/iacserver.go | Embeds/declares the new typed log-capture service on the IaC server. |
| internal/iacserver_test.go | Extends “required server” regression test to include the new CaptureLogs RPC surface. |
| go.mod | Bumps workflow dependency to include log-capture proto; adds websocket dependency; updates grpc/protobuf. |
| go.sum | Updates module sums for the dependency changes. |
Comments suppressed due to low confidence (1)
internal/logcapture.go:140
- websocket.DefaultDialer.DialContext and subsequent ReadMessage errors may include the full LiveURL in their error strings; DO LiveURL can be a presigned URL containing short-lived credentials. Returning these errors verbatim (via %w) risks leaking the presigned URL to callers/logs. Consider redacting URLs (similar to internal/drivers/app_platform.go:redactURLError) or returning generic error classes for websocket connect/read failures.
conn, _, err := websocket.DefaultDialer.DialContext(ctx, liveURL, nil)
if err != nil {
return fmt.Errorf("digitalocean CaptureLogs: connect live logs: %w", err)
}
defer conn.Close()
for {
_, data, err := conn.ReadMessage()
if err != nil {
if ctx.Err() != nil {
return nil
}
return fmt.Errorf("digitalocean CaptureLogs: read live logs: %w", err)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
acac9ac to
af5388c
Compare
af5388c to
234e782
Compare
234e782 to
7de57e1
Compare
7de57e1 to
4ba1820
Compare
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.
Summary
Depends on GoCodeAlone/workflow#738 for the typed IaC log capture proto and wfctl command.
Verification