Commit Graph

5067 Commits

Author SHA1 Message Date
Dan Bungert 0f3b94349b filesystem: use_gap with gaps.after 2022-07-11 18:17:19 -06:00
Dan Bungert 76c708b951 gaps: add utility gaps.after 2022-07-11 11:51:13 -06:00
Dan Bungert daddb0af5f filesystem: remove debug artifact 2022-07-11 11:50:38 -06:00
Dan Bungert 8b5ee61483
Merge pull request #1345 from dbungert/more-lint
workflow: +kinetic for linter
2022-07-08 08:54:27 -06:00
Dan Bungert d8f80d1e33 workflow: +kinetic for linter
Add a second linter container to also lint against the newer python.
2022-07-08 08:31:34 -06:00
Dan Bungert c6078bd77c
Merge pull request #1344 from ogayot/lint-jammy
filesystem: fix use of f-string without placeholder
2022-07-08 07:55:57 -06:00
Olivier Gayot a0b2e765ba filesystem: fix use of f-string without placeholder
When running make lint with flake8 >= 4.0.0 (available in jammy), the
following error is reported:

subiquity/server/controllers/filesystem.py:158:33:
F541 f-string is missing placeholders

Github runs the lint job in a focal container, where only version 3.8.4
of flake8 is installed. F541 is not implemented in 3.8.4 so it does not
fail.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-08 09:48:04 +02:00
Olivier Gayot b2639c13d4
Merge pull request #1343 from ogayot/ubuntu-pro-subscription-screen
ubuntu-pro: add info about subscription in former services screen
2022-07-08 09:13:49 +02:00
Dan Bungert bb8fd4dbd3
Merge pull request #1341 from dbungert/v2-guided-overhaul
filesystem: overhaul v2 guided
2022-07-07 08:02:39 -06:00
Dan Bungert b74e53679c boot: allow plans with None bootloader 2022-07-07 07:45:26 -06:00
Dan Bungert b895fba66a filesystem: api tests for v2 guided 2022-07-07 07:45:26 -06:00
Dan Bungert 4c4506ac37 filesystem: better BIOS tests 2022-07-07 07:45:26 -06:00
Dan Bungert be4cd23ffe filesystem: no guided UseGap when disk is empty 2022-07-07 07:45:26 -06:00
Dan Bungert be805ffb36 filesystem: allow boot to resize a preserved part 2022-07-07 07:45:26 -06:00
Dan Bungert 1f3d36510f filesystem: guided_method can take a gap 2022-07-07 07:41:04 -06:00
Dan Bungert 7a9e920de1 gaps: add within()
To simplify tracking of gap usage, allow looking up a gap based on a
preceeding, usually larger, gap.
2022-07-07 07:41:04 -06:00
Dan Bungert 5d5f9ca49e filesystem: start new guided API POST 2022-07-07 07:31:12 -06:00
Dan Bungert 78f23153e5 filesystem: sort guided cases on available size 2022-07-07 07:31:12 -06:00
Dan Bungert 2f12610290 filesystem: add new guided API GET 2022-07-07 07:31:12 -06:00
Dan Bungert 1916f08342 filesystem: move v2 guided GET to deprecated 2022-07-07 07:23:10 -06:00
Dan Bungert 1ee323bb95 filesystem: get_guided_disks check_boot flag 2022-07-07 07:23:10 -06:00
Dan Bungert 6d403646b9 filesystem: extract guided disk enumeration 2022-07-07 07:23:10 -06:00
Olivier Gayot acac7a8d5b ubuntu-pro: add info about subscription in former services screen
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-07 14:54:15 +02:00
Olivier Gayot 746e559c47
Merge pull request #1342 from ogayot/u-a-c-distinguish-error-invalid
ubuntu-advantage: determine on error if token was invalid
2022-07-06 17:04:10 +02:00
Olivier Gayot 9d6bbf2b9c ubuntu-advantage: determine on error if token was invalid
In case of error, u-a-c exits with status 1. When the contract token
supplied is invalid, it is also considered an error ; which previously
made us unable to make the distinction between:
 * an invalid token
 * a more generic error such as network error or service unavailable error

Thanks to an update in u-a-c, we can now determine if the token was
invalid, by parsing the standard output of the process, even when it
exits with status 1.

The output is expected to be a JSON object that includes an array of
errors where each error has a specific error code.

The error code for an invalid token is attach-invalid-token ; which we
now look for in the output to determine if the contract token was
invalid.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-06 16:42:23 +02:00
Olivier Gayot 0fa8c54296
Merge pull request #1331 from ogayot/ubuntu-pro-visual-no-ubuntu-one
ubuntu-pro: update screens to match current design mockups
2022-07-05 16:12:15 +02:00
Olivier Gayot 7694b2c4fc ubuntu-pro: suggest the "pro" command instead of "ua"
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot 5e02c67d2e ubuntu-pro: make run_answers interact with the GUI
run_answers now interacts with the GUI for the Ubuntu Pro screens.
When a contract token is provided, it is expected to be valid,
otherwise, the UI will block on Expired token or Invalid token.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot d13ad41528 ubuntu-pro: rework expired/invalid messages boxes
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot 6e06971778 ubuntu-pro: mark token as invalid/expired in red
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot 89a2dc7987 ubuntu-pro: make services a whole screen
It also does not have a different title, because title is set at the view level.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot e69675793c ubuntu-pro: submit token asynchronously if check_token is successful
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot 84a1d38646 ubuntu-pro: add content about auto-enabled vs other services
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot af091b689c ubuntu-pro: add intermediate screen that shows token was added
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot c8ed8abe55 ubuntu-pro: add basic field validation for contract token
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-04 11:47:12 +02:00
Olivier Gayot 6025ead7de ubuntu-pro: move mode selection in a different screen
We now split the Ubuntu Pro screen into two sub views.
The first view asks whether the user wants to skip or upgrade (we call
this the upgrade_yes_no_screen in the code).

The second one asks the user to input the contract token. Going forward,
this view will also be used for Ubuntu One.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot c47a1ac231 ubuntu-pro: use "Continue" instead of "Done" for buttons
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot a2fad919c6 ubuntu-pro: drop UbuntuPro prefix in view classes
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot 9e96711ecd ubuntu-pro: add overlay to show how to register
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot f62550528e ubuntu-pro: show "token" + help instead of "contract token"
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot e87e1afde9 ubuntu-pro: use word "upgrade" rather than "enable" for Ubuntu Pro
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot f9f0ffc4cd ubuntu-pro: reword "Skip Ubuntu Pro" -> "Do this later"
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot 8abb5279d7 ubuntu-pro: add button to show ubuntu pro information
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot 329d37a19c ubuntu-pro: use checkboxes to skip or enter token
Instead of relying on the contract token empty to skip Ubuntu Pro, we
now explicitly ask the user to decide if he wants to input a token or
not. This makes a small difference in that the user is now able to
supply an empty contract token. Our different implementations (i.e.,
mock & based on u-a-c) don't handle empty tokens properly, so we now
reject empty tokens.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot d6f121329f ubuntu-pro: add stretchy widget to show info about Ubuntu Pro
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot fcc21c53a2 ubuntu-pro: add ascii representation for continue anyway & UA services
We now include in the docstring a visual representation of the
"ContinueAnyway" and "UA Services" overlays.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-01 20:02:46 +02:00
Olivier Gayot a9b206dedd
Merge pull request #1340 from ogayot/ubuntu-pro-subscription-information
ubuntu-pro: add subscription info in response to /ubuntu_pro/check_token
2022-07-01 16:42:14 +02:00
Dan Bungert 0e796c9956
Merge pull request #1337 from dbungert/min-size-calc
sizes: calculations for install_min and resize
2022-06-30 11:29:54 -06:00
Dan Bungert 58c1ee834e sizes: calculations for install_min and resize
Add calculations for a suggested minimum install size that contains
padding for swap, updates, boot.
Add calculations for helping resize, to examine the space available and
make suggestions about what the existing partition might be resized to.
2022-06-30 11:14:25 -06:00
Olivier Gayot 7ebef6d609 ubuntu-pro: add subscription info in response to /ubuntu_pro/check_token
The response to /ubuntu_pro/check_token now includes information about
the subscription: the name of the contract and the "name" of the account.

Instead of returning the list of services as an optional field, we now
include the list of services in the subscription object. The
subscription object is itself marked optional. This is a backward
incompatible change.

  {
    "status": "VALID_TOKEN",
    "services": [
      {
        "name": "esm-infra",
        "description": "UA Infra: Extended Security Maintenance (ESM)",
        "auto_enabled": true
      }
    ]
  }

  =>

  {
    "status": "VALID_TOKEN",
    "subscription": {
        "account_name": "user@domain.com",
        "contract_name": "UA Apps - Essential (Virtual)",
        "services": [
          {
            "name": "esm-infra",
            "description": "UA Infra: Extended Security Maintenance (ESM)",
            "auto_enabled": true
          }
        ]
     }
  }

If the token is not valid, the subscription object will be null:

  {
    "status": "EXPIRED_TOKEN",
    "subscription": null
  }

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-30 16:31:56 +02:00