Better field name for "refreshed" in "snap info" output

Currently in the output of snap info there is a refreshed field which is a rather nifty bit of information: when was the snap created, by its developer?

However, as @Odd_Bloke rightly pointed out, it’s confusing because it might make you think that it’s the timestamp of when you downloaded the snap.

Looking at the code, I see that this is suspiciously called InstallDate, which makes me think it was originally the download date, which is why it’s called refreshed, and then we changed something and our tests didn’t catch this. I can fix this easily.

But! I really like having the snap’s creation time on there. Let’s keep it! But rename it to something else. But I’m terrible with names, so you tell me. I’m going with organolepcy in my code meanwhile.

internally it should be BuildDate?

I like!
and ‘built:’ as a field works as well

Is it “when was the snap created” or “when was the snap revision created”? If the latter, what snap revision does it refer to, the one I currently have installed or the most recent one pushed to the store (or another one)?

Given the above questions, I wonder if there needs to be a bit more detail in the field name (or its representation; it could just be explicit about the revision it’s referring to?) for it to really be useful to users.

I’m working on a fix that will make refreshed be the timestamp the current snap revision was last made active (meaning: when the refresh finished, when the revert finished, when the install finished, … etc). This should match what people want from this field (even though it’ll be different from what snap changes says, but that’s because snap changes could be dealing with 20 different refreshes).

I’m still looking for a clean way of exposing the built timestamp (whether that’s the name of it or not).

1 Like

Thanks for working on that, and +1 on the change suggested right above. “refreshed” has a pretty useful meaning which is quite expected too, so change the data and preserving the meaning sounds like the right direction for the fix.

Having the build time wouldn’t be bad either, but can we please call it “packaged” instead? This goes well with “snap pack” and “snapcraft pack”, and also aligns better in the command line, and with the fact snaps don’t really enforce the build time at packaging time.

Speaking of alignment, can we please take this change to do one other change:

$ snap info core
(...)
type:      core
snap-id:   99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:  edge
refreshed: 2018-02-23T01:22:03-03:00
installed:   16-2.31.1+git587.d3e52a0 (4133) 85MB core
channels:
  stable:    16-2.31.1                (4110) 85MB -
  candidate: 16-2.31.1                (4110) 85MB -
  beta:      16-2.31.1                (4110) 85MB -
  edge:      16-2.31.1+git587.d3e52a0 (4133) 85MB -

I see why installed is aligned the way it is, making the comparison with the maps very comfortable, but it also makes the output look messy. We typically skim through such a document top-to-bottom, and those last lines look all over the place, with extra spacing on the left, extra spacing on the right, and then the channel map is indented.

A trivial change could perhaps sort this out, preserving compatibility:

type:      core
snap-id:   99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:  edge
refreshed: 2018-02-23T01:22:03-03:00
channels:
  stable:    16-2.31.1                (4110) 85MB -
  candidate: 16-2.31.1                (4110) 85MB -
  beta:      16-2.31.1                (4110) 85MB -
  edge:      16-2.31.1+git587.d3e52a0 (4133) 85MB -
installed:   16-2.31.1+git587.d3e52a0 (4133) 85MB core

How does that look?

Hah! I already proposed it that way, with installed moved to the bottom, but closed it as the bigger change was wrong.

I’ll propose this in a bit (I’ve got a half-baked branch with two other fixes to snap info…).

this PR,
https://github.com/snapcore/snapd/pull/4737
does that (and the rename we discussed on IRC).

I’ll write the forum post about the rename before merging it.

1 Like