Repository navigation
ENG-1112: signadot logs --sandbox (workload / resource[+step]) - #351
Merged
Merged
Conversation
Extend 'signadot logs' with a sandbox log source over the sandbox-scoped endpoint (ENG-1110): --sandbox with --workload (fork) or --resource[+--step], plus -c/--container, --since (duration) / --since-time (RFC3339), and -o json|yaml. --job and --sandbox are mutually exclusive; --stream is job-only. Default output prints raw lines, prefixed [container] when multiple sources. Bumps go-sdk to the (auto-generated) revision carrying Sandboxes.GetSandboxLogs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
--tail is job-only (server-side tail for sandbox is a fast-follow), so --tail + --sandbox now errors. The sandbox-only selectors (--workload/--resource/--step/--container/--since/--since-time) now error when combined with --job. Previously these were silently ignored, which reads as 'applied'. Adds the matching cobra MarkFlagsMutuallyExclusive guards alongside the existing job/sandbox and stream/sandbox ones. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
Author
|
Fixed in
Done via cobra |
Contributor
Author
|
@scott-cotton this is ready for other pass |
scott-cotton
approved these changes
Jul 17, 2026
scott-cotton
left a comment
Member
There was a problem hiding this comment.
LGTM
remember to merge the go-sdk which it uses and add that to go.mod
This was referenced Jul 17, 2026
Re-pin go-sdk from the pre-merge bridge branch to the auto-generated revision (ENG-1111, from the merged ENG-1110 spec). That regen also carries the principal-identity CreatedBy rework, so FormatCreatedBy now renders the new Kind/Name/PublicID fields (was ActorType/UserEmail/APIKeyMasked). go build ./... green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
foxish
pushed a commit
that referenced
this pull request
Jul 30, 2026
## What Adds `-f/--follow` to `signadot logs` for the **sandbox** path (ENG-1113). Stacked on #351 (ENG-1112) — base is `feat/sandbox-logs`; will retarget to `main` once #351 merges. The sandbox-scoped endpoint is a point-in-time snapshot, so follow tails by polling on an interval (2s) and advancing `sinceTime`. Native pod-log streaming is a fast-follow (ENG-1115). The job path already streams via SSE and is unchanged. ## Correctness - **Per-container de-dup.** All containers share a single `sinceTime` per request, so a global high-water mark would drop lines from a lagging container. Instead each container is de-duped against its own last-printed timestamp, and the next poll uses the *oldest* per-container high-water mark — no lost or repeated lines across multiple containers. - **Error handling.** The first poll surfaces selector errors (unknown workload/container/resource/step) so a typo fails fast; subsequent transient errors (pod not running yet, restarts) are reported once to stderr and retried. - **Graceful stop** on SIGINT/SIGTERM. - Rejected with `-o json|yaml` (follow streams plain lines only). ## Testing (live, local cluster) Followed a 2-container fork (`app` + `sidecar`, each logging every 1s): ```console $ signadot logs --sandbox follow-test --workload multi -f [app] APP 0 [sidecar] SIDE 0 [app] APP 1 ... ``` - ~10s of `-f`: **70 lines, 70 unique (0 duplicates)**, 35 `[app]` + 35 `[sidecar]`, sequential with no gaps. - `-f -c app` → single container, raw (unprefixed), tails live. - `-f -o json` → `Error: --follow cannot be combined with -o json`. - `-f --workload nope` → first poll surfaces `400 … workload "nope" not found …`. - SIGTERM/Ctrl-C → stops promptly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.


What
Extends
signadot logswith a sandbox log source, over the sandbox-scopedendpoint added in signadot/signadot#7229 (ENG-1110). Previously
logsonlyserved jobs.
Flags
--sandbox— sandbox name (no short form;-sis--stream).--workload— sandboxed workload (fork) name. Mutually exclusive with--resource.--resource[--step] — sandbox resource;--stepselects one plugin step (resource-only).-c/--container— defaults to all containers.--since(relative duration, converted client-side) /--since-time(RFC3339).-o json|yaml— structured[]ContainerLogs; default prints raw lines,[container]-prefixed when there is more than one source.--job/--sandboxmutually exclusive;--streamis job-only (both enforced).The job path is unchanged/backward-compatible.
Dependency note
Pins
go-sdkto the pre-merge revision that carriesSandboxes.GetSandboxLogs(pushed branch
davido/eng-1111-sandbox-logs-client). The go-sdk isauto-generated from the monorepo spec, so once #7229 merges and the SDK
regenerates, re-pin to that official revision. (ENG-1112 is blocked-by ENG-1111.)
Testing
Built the binary and ran it against a local minikube control plane + operator
with the endpoint deployed, over real fork and resource sandboxes:
--workload logger--since 6s--since-time <future>-o yaml/-o json--resource prres[main]-prefixed--resource prres --step step2400surfaced with the available list--workload+--resource--stepwithout--resource--workloadnor--resource--job+--sandbox--stream+--sandbox--job <missing>(job path)Examples (run against a local cluster)
Point the CLI at your API (
SIGNADOT_API_URL/SIGNADOT_ORG/SIGNADOT_API_KEY, or~/.signadot/config.yaml), then:The job path is unchanged:
signadot logs --job <job> [--stream stdout|stderr] [--tail N].🤖 Generated with Claude Code