Repository navigation
Conversation
This was referenced Oct 15, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 15, 2026
scttfrdmn
added a commit
to spore-host/libs
that referenced
this pull request
Oct 15, 2026
spawn list now shows the time left before the termination deadline in the TTL column (spore-host/spawn#900), so a bare "TTL" header reads as the configured TTL. spawn.list.header.ttl becomes "TTL Left" (en), "Rest-TTL" (de), "TTL restante" (es), "TTL restant" (fr), "TTL Restante" (pt) and "残りTTL" (ja), following each locale's existing header casing. Message ID unchanged. Fixes #54
Colour is decided in one place (cmd/color.go colorEnabled): off for --no-color/--accessibility, NO_COLOR, TERM=dumb, or a non-terminal stdout. The list TTL column shows time left before the deadline spawn status uses (spawn:ttl-deadline, else launch + TTL); -o json keeps ttl and adds ttl_deadline and ttl_remaining_seconds. spawn --version prints the same block as spawn version (Refs spore-host/truffle#189). Fixes #898
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.
Fixes
1. ANSI colour escapes when stdout isn't a TTY. The only colour code in
cmd/(spawn list's state cells and bold group headings) checked--no-color/--accessibilityand nothing else, sospawn list | catwrote raw\x1b[32m. Colour is now decided in one place,cmd/color.gocolorEnabled(). It is off for--no-color/--accessibility, a non-emptyNO_COLOR,TERM=dumb, or a stdout that isn't a terminal (golang.org/x/term, already in the module graph, now a direct dependency).--no-colorstill works.2. The TTL column showed the configured TTL. It now shows the time left before the termination deadline. The deadline is resolved with
lifecycleDeadline, the same functionspawn statususes: thespawn:ttl-deadlinetag, whichspawn extendmoves, else launch time + TTL. The issue's case (--ttl 1h, 7 minutes old) now reads53m. The column showsnonewhen there is no TTL,expiredonce the deadline has passed, and-for a terminated instance.-o json:ttlkeeps its meaning (the configured TTL). It gainsttl_deadline(RFC3339 UTC, or"") andttl_remaining_seconds(nullwhen there is no deadline or the instance is terminated,0once the deadline has passed).3.
spawn --version(Refs spore-host/truffle#189) was rejected as an unknown flag.rootCmd.Versionis now set and the version template is the same blockspawn versionprints, shared throughversionText(). The flag skips the network update check.-vis still--verbose.Tests (each watched failing against a revert that compiles)
TestColorAllowed: flag, NO_COLOR, empty NO_COLOR, TERM=dumb, pipe vs terminal. Fails when the NO_COLOR, TERM=dumb or terminal check is removed.TestColorizeStateOffTTYHasNoEscapesandTestSectionHeadingsOffTTYHaveNoEscapes: the reported symptom in list's own output. Fails when the decision goes back to flag-only, and when the terminal check is ignored.TestNoColorFlagStillWinschecks the flag on a terminal.TestColorDecisionIsCentral: discoverscmd/*.goand fails if anything other than root.go (declaration) or color.go readsflagNoColor. Fails when a direct read is added to list.go.TestTTLRemaining: the issue's 53m case, the launch+TTL fallback, an extended tag beating launch+TTL, none, expired, stopped, terminated. Fails when the column goes back toinst.TTL, and when the deadline tag is ignored.TestListJSONKeepsConfiguredTTL: fails ifttlchanges meaning. Also checks the new fields.TestRootVersionFlagMatchesVersionCommand: fails whenrootCmd.Versionis removed.make checkpasses exceptTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Dockerin pkg/taskproto. That test needs a Docker daemon, none was running locally, and this PR doesn't touch it. No AWS resources were created.Caveat
The column header still says "TTL". Its text lives in spore-host/libs i18n (
spawn.list.header.ttl, six locales), so renaming it to "TTL LEFT" needs a libs release. That's left as a follow-up.Fixes #898
Refs spore-host/truffle#189