Skip to content

feat(tvc): add deploy debug-logs command#169

Open
daniilrrr wants to merge 14 commits into
daniil/TVC-23-sync-protos-firstfrom
daniil/TVC-23-unary-debug-logs
Open

feat(tvc): add deploy debug-logs command#169
daniilrrr wants to merge 14 commits into
daniil/TVC-23-sync-protos-firstfrom
daniil/TVC-23-unary-debug-logs

Conversation

@daniilrrr

@daniilrrr daniilrrr commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Depends on #171 to merge first

Summary

Adds tvc deploy debug-logs, backed by the unary GetTvcDeploymentDebugLogs endpoint at /public/v1/query/get_tvc_deployment_debug_logs.


Sample command:

tvc deploy debug-logs --deploy-id $MY_DEPLOY_ID --since-seconds 3600 --follow


The command fetches debug-mode TVC deployment logs and supports bounded history.

The recommended history control is --since-seconds, which returns logs newer than a relative time window and is the most predictable way to inspect recent output.

--tail-lines is also available for advanced scoping, but it corresponds to raw pod log history per replica, so filtered output will contain fewer visible app lines than requested.

Note that debug mode deployments now only have 1 replica by default, so most users will see replica 1/1 when they use this command.

Notes

Follow mode is implemented client-side by polling the unary endpoint.

Requires the corresponding mono debug-logs unary endpoint PR to land/deploy. Done.

Testing

  • Added CLI tests for help text, required flags, flag validation, and debug-log command parsing.

  • cargo test -p turnkey_client

  • cargo test -p tvc debug_logs

  • Tested in dev by deploying a test image with extra logs, connecting to that deployment, then refreshing the /time page for additional logs

tvc deploy debug-logs --deploy-id e4b4d6b9-97e3-4b23-b6fa-a425f049f310 --since-seconds 3600 --follow
Connected; polling for debug logs...
replica 2/3 2026-06-18T22:10:38.731409Z  INFO helloworld: Server listening on 0.0.0.0:3000
replica 2/3 2026-06-18T22:10:38.731431Z  WARN helloworld: (Dummy warn): Server listening on 0.0.0.0:3000
replica 2/3 2026-06-18T22:10:38.731435Z ERROR helloworld: (Dummy error): Server listening on 0.0.0.0:3000

@daniilrrr daniilrrr changed the title Daniil/tvc 23 unary debug logs feat(tvc): add deploy debug-logs command Jun 18, 2026
@daniilrrr daniilrrr requested a review from Copilot June 18, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new tvc deploy debug-logs subcommand that fetches TVC debug deployment logs using the new unary GetEnclaveDebugLogs API, including support for follow/polling and log window flags.

Changes:

  • Adds deploy debug-logs CLI command with --deploy-id, --follow, --tail-lines, --since-seconds, and --include-platform-timestamp.
  • Vendors/updates proto definitions and regenerates the Rust client for the new unary debug-logs API (plus related proto updates).
  • Adds CLI tests covering help text, required flags, and pre-auth flag validation.

Reviewed changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tvc/tests/deploy_debug_logs.rs Adds CLI tests for the new deploy debug-logs command and flag behavior.
tvc/src/commands/display.rs Minor refactor of a shared display helper.
tvc/src/commands/deploy/mod.rs Registers the new debug_logs deploy submodule.
tvc/src/commands/deploy/debug_logs.rs Implements tvc deploy debug-logs, polling follow-mode, formatting, and dedupe.
tvc/src/client.rs Import ordering adjustments for generated types.
tvc/src/cli.rs Wires the new DeployCommands::DebugLogs into CLI dispatch and help text formatting.
proto/vendor/google/api/httpbody.proto Adds vendored google.api.HttpBody proto dependency.
proto/services/coordinator/public/v1/public_api.proto Adds unary GetEnclaveDebugLogs RPC + request/response messages; updates some network lists.
proto/immutable/activity/v1/activity.proto Updates supported network lists for intents.
proto/external/errors/v1/errors.proto Adds new external error codes.
proto/external/data/v1/tvc.proto Adds LogLine message used by debug logs.
client/src/generated/services.coordinator.public.v1.rs Generated Rust types for GetEnclaveDebugLogs*.
client/src/generated/external.data.v1.rs Generated Rust type for LogLine.
client/src/generated/client.rs Adds TurnkeyClient::get_enclave_debug_logs method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tvc/src/cli.rs
Comment thread tvc/src/commands/deploy/debug_logs.rs Outdated
Comment thread tvc/src/commands/deploy/debug_logs.rs Outdated
Comment thread tvc/src/commands/deploy/debug_logs.rs Outdated
Comment thread tvc/src/commands/deploy/debug_logs.rs Outdated
@daniilrrr daniilrrr force-pushed the daniil/TVC-23-unary-debug-logs branch from 2cbfa97 to aef00ee Compare June 18, 2026 23:25
@daniilrrr daniilrrr marked this pull request as ready for review June 22, 2026 18:23
@daniilrrr

Copy link
Copy Markdown
Contributor Author

Self-reminder to re-sync protos once backend PR in mono lands

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 25 out of 33 changed files in this pull request and generated 3 comments.

Comment thread tvc/src/cli.rs
Comment thread proto/external/data/v1/organization_data.proto
Comment on lines +2024 to +2034
rpc CreateMfaPolicy(external.activity.v1.CreateMfaPolicyRequest) returns (ActivityResponse) {
option (google.api.http) = {
post: "/public/v1/submit/create_mfa_policy"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
description: "Create a new MFA policy for a user."
summary: "Create MFA policy"
tags: "MFA Policies"
};
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

u right. I will sync protos in a separate PR.

@daniilrrr

daniilrrr commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

will sync protos in a diff PR to reduce $GREEN_LINE_COUNT

#171

@daniilrrr daniilrrr changed the base branch from main to daniil/TVC-23-sync-protos-first June 26, 2026 00:21
daniilrrr added 13 commits June 25, 2026 17:44
- try reconnecting but fail if too frequent
- better help text
- remove double timestamps by default
- Sync unary debug logs protos from mono
- Regenerate client types and unary query method
- Remove stream-specific codegen and client helpers
- Update tvc debug-logs to poll unary log windows
- Add since-seconds and previous flags with focused tests
- sync'd latest protos from main
- updated debug logs command to use correct API
- more sane DebugLogPrinter
@daniilrrr daniilrrr force-pushed the daniil/TVC-23-unary-debug-logs branch from 52d0cba to a6761b6 Compare June 26, 2026 00:45
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.

3 participants