Skip to content

feat: add app log capture#144

Merged
intel352 merged 1 commit into
mainfrom
feat/log-capture-20260520
May 20, 2026
Merged

feat: add app log capture#144
intel352 merged 1 commit into
mainfrom
feat/log-capture-20260520

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • implement DigitalOcean App Platform log capture for infra.container_service resources
  • stream historic logs and optional live WebSocket logs through the new typed IaC log capture service
  • add provider/server regression coverage and wire log capture into the DO IaC server

Depends on GoCodeAlone/workflow#738 for the typed IaC log capture proto and wfctl command.

Verification

  • GOWORK=off go test ./internal -run 'TestDOProviderCaptureLogsFetchesHistoricLogs|TestDOIaCServerCaptureLogsStreamsChunks|TestDOIaCProviderRequiredServer_AllRPCs' -count=1
  • GOWORK=off go test ./internal ./internal/steps -count=1
  • GOWORK=off go test ./... -count=1
  • git diff --check

Copilot AI review requested due to automatic review settings May 20, 2026 11:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.CaptureLogs to fetch historic log content and optionally follow live WebSocket logs.
  • Add typed IaC CaptureLogs gRPC 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.

Comment thread internal/logcapture.go
Comment thread internal/logcapture.go
Comment thread internal/logcapture.go
@intel352 intel352 force-pushed the feat/log-capture-20260520 branch from acac9ac to af5388c Compare May 20, 2026 12:09
Copilot AI review requested due to automatic review settings May 20, 2026 12:55
@intel352 intel352 force-pushed the feat/log-capture-20260520 branch from af5388c to 234e782 Compare May 20, 2026 12:55
@intel352 intel352 force-pushed the feat/log-capture-20260520 branch from 234e782 to 7de57e1 Compare May 20, 2026 12:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Comment thread internal/logcapture.go
Comment thread internal/logcapture.go
Comment thread internal/logcapture.go
Comment thread internal/logcapture.go
@intel352 intel352 force-pushed the feat/log-capture-20260520 branch from 7de57e1 to 4ba1820 Compare May 20, 2026 13:05
@intel352 intel352 merged commit 98f02ed into main May 20, 2026
7 checks passed
@intel352 intel352 deleted the feat/log-capture-20260520 branch May 20, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants