* many: add support for user daemons in "snapctl services" by introducing the same --user/--global switches as "snap services"
* o/hookstate/ctlcmd: remove error messages
* cmd/snap,o/hookstate/ctlcmd: correct some doc strings
This field determines the time after which a pending refresh
is forced for a running snap in the next auto-refresh.
* many: prepare RefreshInhibitProceedTime for configurable max inhibition
* many: remove unneeded newline in RefreshInhibitProceedTime doc comment
* client/packages_test: test client snap with nil RefreshInhibitProceedTime
* client/packages_test: make TestClientSnap tests more readable
* many: precompute refreshInhibitProceedTime in aboutSnap
This avoids locking/unlocking each snap to get RefreshInhibitProceedTime.
We get the proceed time while already holding the lock.
Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
Replace ioutil.WriteFile with os.WriteFile since the former has been
deprecated since go1.16 and simply calls the latter.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
* store: Return categories in find results
This allows clients to show the categories as snapcraft.io does.
Fixes https://bugs.launchpad.net/snapd/+bug/1838786
* Remove unnecessary CategoryInfos type
* Only show categories when using --verbose
* Add tests for snap info printing categories
* Update cmd/snap/cmd_info.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update cmd/snap/cmd_info.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* v1 store API doesn't return categories
* Drop category information from snap info
Other snap commands don't support categories yet, this change should be part of that.
* Add /v2/categories and support /v2/find?category=foo
* Add note that section is deprecated
* Update client/packages.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update daemon/api_categories.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update store/store.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update store/details_v2.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Update client/packages.go
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
* Improve test error message
* Drop copy/pasted comments that doesn't seem relevant
* Remove unused import
* Reorder CategoryInfo struct
* Fix accepted content type for store v2/snaps/categories request
* Set APILevel for v2/snaps/categories request
* Update accept string used to get data for store test
* Make /v2/categories return objects not just strings
---------
Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
Exposes the longest hold placed by a gating snap and the user hold,
keyed by "gating-hold" and "user-hold", respectively.
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
to be backward compatible both in terms of what happens on a snapd revert or
dealing with data saved by an old snapd we still need to operate on the
fields/storage locations previously used for contact and website
This commit replaces the use of "sanity" with more inclusive
naming.
When `sanity` is used in a more general sense either `validity`
or `quick` is used.