54 Commits

Author SHA1 Message Date
Miguel Pires
29c9752d66 many: s/ioutil.WriteFile/os.WriteFile (#13217)
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>
2023-09-26 11:38:46 +01:00
Philip Meulengracht
41f96ad50f many: move memory,cpu and thread quota out of experimental (#12529)
* many: repurpose quota-groups experimental feature instead of introducing a new feature flag

* cmd/snap: unhide quota commands

* cmd/snap: add missing help categories for quota commands

* features: remove feature flag from tests

* features,o/servicestate: review feedback

Clarify the docs for the quota-groups feature. Be more specific in regards to the experimental helper text. Simplify function that checks for feature flag
2023-02-01 15:53:50 +01:00
Philip Meulengracht
af1860b2fb features,overlord/servicestate: add support for per-quota requirements (#11962)
* features,overlord/servicestate: add support for per-quota requirements

* overlord/servicestate: add unit tests for the new per-quota requirements

* overlord/servicestate: fix doc

* tests/main/snap-logs-journal: set new experimental flag for this test

* o/servicestate: fix tests after rebase, add additional changes to spread tests after new tests have been introduced

* t/core/persistent-journal-namespace: enable experimental journal quotas

* o/servicestate: allow the old quota-groups option, remove the changes to tests as that is not needed for this PR

* o/servicestate: review feedback

spelling mistake, remove wrong return revealed by test. (but is not hit in this PR due to redundant quota checks)

* multiple: review feedback

fix unit test run

* t/m/snap-quota-journal: try again, couldn't figure out the whitespace
2023-01-26 15:59:47 +01:00
Michael Vogt
06df81c76e many: revert "features: disable refresh-app-awarness by default again"
This reverts commit db339ccd37.

The desktop team is very nervous about disabling
refresh-app-awareness, especially this close to the release of
22.04.1. The worry is that unknown bugs during a refresh may
cause firefox to crash. Given the really good progress we had
with the startup performance and other improvements this would
be very unfortunate. Fwiw, there are no refresh bugs known right
now but the risk is there. The desktop team feels that the
shortcoming in the UX are a better tradeoff than to risk crashes.

We fixed the known issues around refresh-app-awareness:
https://bugs.launchpad.net/snapd/+bug/1975714
https://bugs.launchpad.net/snapd/+bug/1978834
https://github.com/snapcore/snapd/pull/11834
https://github.com/snapcore/snapd/pull/11976
https://github.com/snapcore/snapd/pull/11855

so hopefully this does not hit the other side of this too
hard. Sorry to everyone for yet another flip-flop on this,
it's really hard to find the right trade-off here.

This reverts https://github.com/snapcore/snapd/pull/11912
2022-07-26 12:36:24 +02:00
Michael Vogt
db339ccd37 features: disable refresh-app-awarness by default again
* features: disable refresh-app-awarness by default again

We enabled the `experimental.refresh-app-awareness` option right
before the 22.04 release [1]. However in hindsight this move was
premature. The UX is not quite ready, the refresh is stopped
but the experience should be that once the app is closed the
update gets applied which is not implemented yet. There are
also design issues with e.g. LXD as outlined in LP:#1978005
the need time and design to resolve. Another reason was the
automatic ~/snap -> ~/Snap folder migration. But this is
done differently now.

For the above reasons this commit changes the default again
to `refresh-app-awarness=false` until there is time to
fix the UX and the LXD issues.

[1] https://github.com/snapcore/snapd/pull/11566

* hookstate: disable refresh-app-awareness in gateAutoRefreshHookSuite.SetUpTest() - not strictly needed but when we enable refresh-app-awareness again it will help
2022-07-05 18:02:50 +02:00
Miguel Pires
dd32173b78 o/snapstate: minor simplifications
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-06-13 09:34:20 +01:00
Miguel Pires
91bfc1efad features: add move snap home experimental feature
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-06-09 09:40:24 +01:00
Pawel Stolowski
5a9eb56825 features: enable refresh-app-awareness by default
* Enable refresh-app-awareness by default.

* Update tests.

* Fix comment.

* Pass --ignore-running in spread tests.

* Update hidden-snap-dir test with --ignore-running.

* Fix op-remove-retry test to kill test-snapd-tools.block process.

* Remove --ignore-running flag from hidden-snap-dir (not needed).

* Remove --ignore-running flag from refresh test (not needed).

* Add comment to the test

Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>

* Add comment to the test

Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>

* Add extra comments explaining --ignore-running use in the tests.

Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2022-04-21 09:00:05 +02:00
Miguel Pires
003247d4b7 cmd: use IsEnabled instead of Stat 2021-10-08 17:36:39 +01:00
Miguel Pires
a8f4b392ef many: s/SnapDataDir/SnapDataHomeDir/ 2021-10-04 15:10:55 +01:00
Miguel Pires
c734f653cb many: make naming more consistent 2021-09-29 12:33:20 +01:00
Miguel Pires
2c4d18eaf4 many: enable ~/.snap experimental feature 2021-09-23 23:51:36 +01:00
James Henstridge
88644518c5 Merge remote-tracking branch 'upstream/master' into enable-feature-dbus-activation 2021-05-27 13:33:45 +08:00
Michael Vogt
5603fbe09b features,servicestate: add experimental.quota-control flag
To allow us to still change he API we put resource groups
behind an experimental flag.
2021-04-29 20:35:46 +02:00
Paweł Stołowski
6d51527ddb Renamed refresh-control to gate-auto-refresh-hook. 2021-04-06 08:22:48 +00:00
Paweł Stołowski
bfc82b5fec Add refresh-control feature flag. 2021-04-06 08:22:48 +00:00
James Henstridge
926f7f7d67 features: enable dbus-activation feature by default 2021-03-18 19:12:25 +08:00
Zygmunt Krynicki
02e21d00eb features: enable classic-preserves-xdg-runtime-dir
We agreed to enable this feature after a release a long while ago and
forgot about this entirely. This should improve compatibility of some
snaps that use classic confinement, as $XDG_RUNTIME_DIR will no longer
be altered, allowing unmodified binaries to find sockets and other
resources there.

Forum: https://forum.snapcraft.io/t/classic-confinement-breaks-high-dpi-support/13868
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-10-30 13:28:12 +01:00
Paweł Stołowski
3c26bf46a6 Tweak order of featurs to match tests order (thanks zyga). 2020-09-04 14:55:32 +02:00
Paweł Stołowski
d7901881a0 Add feature flags for disk space awareness and disable disk checks by default. 2020-08-31 16:18:56 +02:00
Zygmunt Krynicki
7b5640f16c features: add HiddenSnapFolder feature flag
This new feature flag will control the location of the per-user snap
data root. When the flag is unset, the ~/snap location is used. When
the flag is set the new ~/.snapdata location will be used as the root of
all other locations (such as SNAP_USER_DATA and SNAP_USER_COMMON).

The flag is implemented on the go and C sides, as both need to observe
it.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-08-21 09:28:19 +02:00
James Henstridge
625ed206f9 features: add dbus-activation feature flag 2020-06-08 19:32:12 +08:00
James Henstridge
bc4a97b4cc Merge remote-tracking branch 'upstream/master' into user-daemons 2020-04-03 09:50:19 +08:00
Zygmunt Krynicki
469e05cc8a Merge pull request #8089 from zyga/feature/enable-robust-mount-namespace-updates
features: enable robust mount ns updates
2020-04-02 17:01:09 +02:00
James Henstridge
bbbbb08b04 Merge remote-tracking branch 'upstream/master' into user-daemons 2020-04-02 10:11:13 +08:00