Show service kind in service list - #17
Merged
Merged
Conversation
The listing gave no indication of a service's workload type, and rendered batch services with columns that only mean something for a function: version 0, and a "last deployed" humanised from the zero timestamp, which prints as "a long while ago". That reads as deployed in the distant past when a batch service is never deployed at all, by design. Adds a KIND column, and renders version and last-deployed as "-" when a service has never been deployed -- which also fixes the same misleading output for a function service that has been created but not yet deployed. An empty kind, from a server predating the field, shows "-" rather than "function": that would be a guess presented as fact. The column is deliberately uncoloured. tabwriter measures cell width in bytes, so an ANSI sequence makes a cell look about nine characters wider than it prints and skews the whole table. That is already visible wherever colorize() is used inside a tabwriter elsewhere in this CLI, and is worth fixing on its own rather than as a side effect of adding a column.
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.
Requires platform 2.5.0, which added
kindto the listing response (already deployed).Before — no indication of type, and batch rows rendered with columns that only mean something for a function:
That
a long while agois the zero timestamp humanised. It reads as deployed in the distant past when a batch service is never deployed at all.After:
The
-for never-deployed also fixes the same misleading output for a function service created but not yet deployed. An empty kind, from a server predating the field, shows-rather thanfunction— that would be a guess presented as fact.On highlighting: I tried colouring
batchcyan and backed it out.tabwritermeasures cell width in bytes, so the ANSI sequence makes the cell look ~9 characters wider than it prints and skews every following column. Worth knowing that this already happens wherevercolorize()is used inside a tabwriter here — inbatch list, the header'sEXITand the row's value don't line up. Happy to fix that repo-wide separately; it needs visible-width-aware padding rather than raw tabwriter.