`snap list` growing a column

A heads up because this might affect people that’re parsing the output of snap list in scripts and such: we’ll (probably) be adding a column.

This isn’t even up for review yet and the order and wording might change, but I’ll update this as things settle.

Currently snap list output looks like,

Name       Version  Rev   Developer     Notes
core       16-2.31  4017  canonical     core
go         1.10rc2  1406  mwhudson      classic
http       0.9.9-1  x1                  try
snapcraft  2.39     1094  canonical     classic
wethr      1.5.1    17    snapcrafters  -

with this change, it’d be something like

Name       Version  Rev   Tracking        Developer     Notes
core       16-2.31  4017  candidate       canonical     core
go         1.10rc2  1406  1.10/candidate  mwhudson      classic
http       0.9.9-1  x1                                  try
snapcraft  2.39     1094  stable          canonical     classic
wethr      1.5.1    17    stable          snapcrafters  -

EDIT to change the example so that it includes a sideloaded (or in this case, try-mode) snap. This to me says if there’s anybody parsing this by hand they probably have bugs for sideloaded snaps.

While I’m here, I think I’ll change those empties to a - (as for Notes).

2 Likes

This is handy and means I won’t need to reach for ‘snap info’ nearly as much.

Considering the discussion in Ubuntu about ‘snaps in main’ where they want a snap to track a non-existent track until which point it needs to exist, what will the output of the above be in that case? Where the snap came from?

Yes, at least that is my understanding; tracking channel would be something like stable/ubuntu-18.04 (or whatever the thing is called).

Up above you mentioned 1.10/candidate which suggests <track>/<channel> but here you said stable/ubuntu-18.04. Did you accidentally switch them or were you saying that stable/ubuntu-18.04 actually means “it’s tracking stable unless
ubuntu-18.04 exists”?

Maybe it doesn’t matter if the track doesn’t exist-- the column is ‘Tracking’ not ‘The track where the snap came from’. In that light, perhaps ‘ubuntu-18.04’ is all that should be expressed. The fact that ubuntu-18.04 is being tracked, but it doesn’t exist so falls back to ‘stable’ maybe isn’t interesting for this column?

Note that stable is the risk level; the track of the thing we usually call stable is latest (so the channel is latest/stable).

But yes, it’s the tracking channel; the “where it came from” is weird and probably confusing (two users on slightly different refresh windows tracking the same channel could see it “coming from” different channels).

On the other other hand (there’s something in the water I swear), it isn’t clear we want to list the branch in this at all (we don’t show branches in snap info); it’s a bit of an open question. We’ll see.

Turns out, branches can be rather long

Name  Version  Rev   Tracking                                                                                                             Developer  Notes
go    1.9.4    1404  stable                                                                                                               mwhudson   classic
http  0.9.9-1  21    stable/it-was-the-best-of-times--it-was-the-worst-of-times--it-was-the-age-of-wisdom--it-was-the-age-of-foolishness  chipaca    -

So… how about this:

a) if there’s a branch, hint at it (snap info shows the whole thing)

Name  Version  Rev   Tracking  Developer  Notes
go    1.9.4    1404  stable    mwhudson   classic
http  0.9.9-1  21    stable/…  chipaca    -

and perhaps also (b), mention it in Notes

Name  Version  Rev   Tracking  Developer  Notes
go    1.9.4    1404  stable    mwhudson   classic
http  0.9.9-1  21    stable/…  chipaca    tracking-branch

I think (a) is good enough on its own, and avoids Notes getting cluttered, but I’m interested in what the rest (and in particular @snapd) thinks.

@chipaca Option (a) looks very nice, and bonus points for using the unicode character saving two positions. We don’t need to mention anything in Notes since it’s already explicit from the Tracking column.

1 Like

Implemented in:
https://github.com/snapcore/snapd/pull/4702

this is now on master.