tilt
tilt copied to clipboard
handling resource names with the same prefix
Current Behavior
Tilt caps resource names in tilt ci
/ tilt cli output at 13 characters
https://github.com/tilt-dev/tilt/blob/master/pkg/model/logstore/prefix.go
If two resources have the same 13 character prefix, you won't be able to differentiate them.
Describe the Feature You Want
There are a few ways you could imagine we might differentiate:
- using different colors
- choosing a "unique" prefix
- letting users configure the number of characters in the prefix
we should also look into what Compose does for this. maybe there's an opportunity to share logic?
Thanks @nicks !
I think our CI system supports colors, that's a good start but not very cmd+f
-able. We are also dumping snapshots at the end so this is somewhat tangential to that (since this is while it's running). Perhaps a combo of a unique color generated from the hash of the resource name (since they can't conflict) + some configurability of the length before it's truncated? That way it's easy to see while logs are flying by, and easy to search for, letting teams pick a length that works for them (if your resources are 5 letters like nginx
and web
, 13 may also be a bunch of wasted space). The issue really crops up when you're using tilt with microservices so you have service1-web
and service1-worker
and the like (but longer service names)
i talked to the Compose people about how they handle this problem. The code is here: https://github.com/docker/compose/blob/v2/cmd/formatter/logs.go where they don't do any truncation at all; they just expand the prefix until it fits the whole resource name. that might be a better solution here :thinking: