Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
snap: add `snap refresh --time` option #3240
Conversation
mvo5
and others
added some commits
Jan 31, 2017
| @@ -919,6 +941,7 @@ func init() { | ||
| waitDescs.also(channelDescs).also(modeDescs).also(map[string]string{ | ||
| "revision": i18n.G("Refresh to the given revision"), | ||
| "list": i18n.G("Show available snaps for refresh"), | ||
| + "time": i18n.G("Show auto refresh information"), |
chipaca
Apr 26, 2017
Member
(I see that list has the same problem of not saying “this will not perform the action”)
zyga
Apr 26, 2017
Contributor
10:57 < mvo_> Chipaca: I like your suggestion about the --time help output. how about "Only show refresh time information" or "Only show refresh times information but not
perform any refresh"?
10:59 < zyga> mvo_: maybe `snap refresh --query`
| @@ -919,6 +941,7 @@ func init() { | ||
| waitDescs.also(channelDescs).also(modeDescs).also(map[string]string{ | ||
| "revision": i18n.G("Refresh to the given revision"), | ||
| "list": i18n.G("Show available snaps for refresh"), | ||
| + "time": i18n.G("Show auto refresh information"), |
chipaca
Apr 26, 2017
Member
(I see that list has the same problem of not saying “this will not perform the action”)
zyga
Apr 26, 2017
Contributor
10:57 < mvo_> Chipaca: I like your suggestion about the --time help output. how about "Only show refresh time information" or "Only show refresh times information but not
perform any refresh"?
10:59 < zyga> mvo_: maybe `snap refresh --query`
| @@ -62,6 +66,13 @@ type Schedule struct { | ||
| Weekday string | ||
| } | ||
| +func (sched *Schedule) String() string { | ||
| + if sched.Weekday == "" { | ||
| + return fmt.Sprintf("%s:%s", sched.Start, sched.End) |
mvo5
added some commits
Apr 26, 2017
| break | ||
| fi | ||
| - sleep 1 | ||
| + echo "Doing something that triggers ensure" | ||
| + snap install test-snapd-python-webserver |
mvo5
added some commits
Apr 26, 2017
pedronis
requested a review
from
niemeyer
Apr 27, 2017
| @@ -450,15 +450,23 @@ func autoRefreshInFlight(st *state.State) bool { | ||
| return false | ||
| } | ||
| -func lastRefresh(st *state.State) (time.Time, error) { | ||
| +func (m *SnapManager) LastRefresh() (time.Time, error) { |
pedronis
Apr 28, 2017
Contributor
they should grow a doc comment I think, that also explains they need to be used with the state lock
|
Personally I think it's fine to expose this on /system-info, and maybe/likely later repeat it on GET of some kind of /refresh(-schedule) endpoint as well, once we need an endpoint to control this as well |
chipaca
merged commit cbd7b51
into
snapcore:master
May 4, 2017
5 of 6 checks passed
|
I just noticed this change, I've put some documentation in https://github.com/snapcore/snapd/wiki/REST-API but a couple of questions:
Only my system: Could we change them to use the RFC3339 UTC format?
|
|
PR for date formats #3528 |
mvo5 commentedApr 26, 2017
•
Edited 1 time
-
mvo5
Apr 27, 2017
Based on #2833
This branch adds a new
snap refresh --timeoption that will display information around the refresh times. This is useful for users to make things more transparent and also useful for debugging.Here is the example output:
One thing I wonder about is if this information should be part of sysinfo or if we should create a dedicated endpoint. The branch is currently using sysinfo, but it seems a dedicated endpoint might be needed anyway when we implement something like
snap refresh --delay 2h. Opinions welcome.