[Merge] lp:~sil2100/ubuntu-release-upgrader/snap-size-estimation into lp:ubuntu-release-upgrader

Łukasz Zemczak lukasz.zemczak at canonical.com
Fri Aug 9 13:16:29 UTC 2019


Łukasz Zemczak has proposed merging lp:~sil2100/ubuntu-release-upgrader/snap-size-estimation into lp:ubuntu-release-upgrader.

Commit message:
Modify DistUpgradeQuirks to calculate extra space needed for snaps that need to be installed during upgrade (replacing old debs) and add that to estimates done in checkFreeSpace().

Requested reviews:
  Ubuntu Core Development Team (ubuntu-core-dev)

For more details, see:
https://code.launchpad.net/~sil2100/ubuntu-release-upgrader/snap-size-estimation/+merge/371120

Modify DistUpgradeQuirks to calculate extra space needed for snaps that need to be installed during upgrade (replacing old debs) and add that to estimates done in checkFreeSpace().

This branch is now ready for an initial review. I had a few design bikeshedding issues while working on this, so I'm still not entirely happy with the end result. For instance, I don't like how it looks with the consecutive quirks assuming the previous ones set up everything for them - but that seemed to be optimal.

I added all the estimation as a quirk, alongside of the existing ones for replacing debs with snaps. Seemed to be 'consistent' with the current approach. In cases where quirks are not ran, the extra_snap_space is 0 so nothing funny is happening. I also added some very basic unit testing for the new methods added. They're not very pretty, mostly because a lot of the functionality had to be mocked as it required network access, which we don't want to rely on in unit testing.
For fetching the size, I try to be as accurate as possible - which is why I am performing raw API calls to the snapstore as per their recommendation. I could not use snap_info as we need to get the size of the snap for the specific branch (stable/ubuntu-x.x) - and only a fake snap_refresh allows that (which needs the snap-id specified). At first I wanted to be consistent and just use `snap info`, but as said - the command didn't seem to allow specifying the branch that needed to be checked.

I'm open to any propositions. This is my first contribution to u-r-u so apologies if the coding style is not adequate. I still need to test it in practice, which is why I'd prefer if we didn't merge it yet before more testing.
-- 
Your team Ubuntu Core Development Team is requested to review the proposed merge of lp:~sil2100/ubuntu-release-upgrader/snap-size-estimation into lp:ubuntu-release-upgrader.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: review-diff.txt
Type: text/x-diff
Size: 18902 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-reviews/attachments/20190809/6835d2ac/attachment.diff>


More information about the Ubuntu-reviews mailing list