Merge ~jugmac00/lpci:interims_releases into lpci:main

Proposed by Jürgen Gmach
Status: Merged
Merged at revision: 0d467f067335d3d1c7f0c022e6d9922d3e6739a3
Proposed branch: ~jugmac00/lpci:interims_releases
Merge into: lpci:main
Diff against target: 127 lines (+18/-8)
8 files modified
NEWS.rst (+6/-1)
lpcraft/config.py (+4/-0)
lpcraft/providers/_buildd.py (+2/-0)
lpcraft/providers/_lxd.py (+2/-2)
lpcraft/providers/tests/test_lxd.py (+1/-2)
requirements.in (+1/-1)
requirements.txt (+1/-1)
setup.cfg (+1/-1)
Reviewer Review Type Date Requested Status
Clinton Fung Approve
Colin Watson (community) Approve
Review via email: mp+438664@code.launchpad.net

Commit message

Add support for interims release

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
Revision history for this message
Clinton Fung (clinton-fung) :
review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/NEWS.rst b/NEWS.rst
2index 347d876..c03513f 100644
3--- a/NEWS.rst
4+++ b/NEWS.rst
5@@ -2,9 +2,14 @@
6 Version history
7 ===============
8
9-0.0.48 (unreleased)
10+0.0.48 (2023-03-10)
11 ===================
12
13+- Add support for non-LTS releases, that is currently lunar and kinetic.
14+ Please note that we use daily cloud images
15+ (https://cloud-images.ubuntu.com/daily/) for this purpose,
16+ so we cannot guarantee stability.
17+
18 - Fix various ``mypy`` errors.
19
20 0.0.47 (2023-03-01)
21diff --git a/lpcraft/config.py b/lpcraft/config.py
22index 8a3865c..5b8d126 100644
23--- a/lpcraft/config.py
24+++ b/lpcraft/config.py
25@@ -116,6 +116,10 @@ class PackageSuite(str, Enum):
26 e.g. xenial, focal, ...
27 """
28
29+ # XXX jugmac00 2023-03-10 the intention of this class was to verify that
30+ # only supported distroseries are present in the .launchpad.yaml file
31+ # but this does not work as intended, as you can specify arbitrary
32+ # strings which later possibly result in a KeyError
33 bionic = "bionic" # 18.04
34 focal = "focal" # 20.04
35 jammy = "jammy" # 22.04
36diff --git a/lpcraft/providers/_buildd.py b/lpcraft/providers/_buildd.py
37index 78a5140..bd6b2df 100644
38--- a/lpcraft/providers/_buildd.py
39+++ b/lpcraft/providers/_buildd.py
40@@ -18,6 +18,8 @@ SERIES_TO_BUILDD_IMAGE_ALIAS = {
41 "bionic": bases.BuilddBaseAlias.BIONIC,
42 "focal": bases.BuilddBaseAlias.FOCAL,
43 "jammy": bases.BuilddBaseAlias.JAMMY,
44+ "kinetic": bases.BuilddBaseAlias.KINETIC,
45+ "lunar": bases.BuilddBaseAlias.LUNAR,
46 }
47
48
49diff --git a/lpcraft/providers/_lxd.py b/lpcraft/providers/_lxd.py
50index a2e0927..bdbb5eb 100644
51--- a/lpcraft/providers/_lxd.py
52+++ b/lpcraft/providers/_lxd.py
53@@ -264,7 +264,7 @@ class LXDProvider(Provider):
54 )
55 environment = self.get_command_environment()
56 try:
57- image_remote = lxd.configure_buildd_image_remote(lxc=self.lxc)
58+ image_remote = lxd.get_remote_image(alias.value)
59 except lxd.LXDError as error:
60 raise CommandError(str(error)) from error
61 base_configuration = LPCraftBuilddBaseConfiguration(
62@@ -301,7 +301,7 @@ class LXDProvider(Provider):
63 name=instance_name,
64 base_configuration=base_configuration,
65 image_name=series,
66- image_remote=image_remote,
67+ image_remote=image_remote.remote_name,
68 auto_clean=True,
69 auto_create_project=True,
70 map_user_uid=True,
71diff --git a/lpcraft/providers/tests/test_lxd.py b/lpcraft/providers/tests/test_lxd.py
72index 3b32768..f72fdbf 100644
73--- a/lpcraft/providers/tests/test_lxd.py
74+++ b/lpcraft/providers/tests/test_lxd.py
75@@ -430,7 +430,6 @@ class TestLXDProvider(TestCase):
76 architecture="amd64",
77 ) as instance:
78 self.assertIsNotNone(instance)
79- mock_lxc.remote_add.assert_called_once()
80 mock_lxc.project_list.assert_called_once_with("test-remote")
81 mock_lxc.project_create.assert_called_once_with(
82 project="test-project", remote="test-remote"
83@@ -700,7 +699,7 @@ class TestLXDProvider(TestCase):
84 self, mock_lxd
85 ): # noqa: E501
86 error = LXDError(brief="Boom")
87- mock_lxd.configure_buildd_image_remote.side_effect = error
88+ mock_lxd.get_remote_image.side_effect = error
89 # original behavior has to be restored as lxd is now a mock
90 mock_lxd.LXDError = LXDError
91 provider = makeLXDProvider()
92diff --git a/requirements.in b/requirements.in
93index 7a73bd5..3744a90 100644
94--- a/requirements.in
95+++ b/requirements.in
96@@ -1,5 +1,5 @@
97 craft-cli
98-craft-providers
99+craft-providers>=1.8.0 # 1.8.0 added support of non-LTS releases
100 pydantic
101 PyYAML
102 python-dotenv
103diff --git a/requirements.txt b/requirements.txt
104index 9930c45..283bba5 100644
105--- a/requirements.txt
106+++ b/requirements.txt
107@@ -10,7 +10,7 @@ charset-normalizer==3.0.1
108 # via requests
109 craft-cli==1.2.0
110 # via -r requirements.in
111-craft-providers==1.7.2
112+craft-providers==1.8.0
113 # via -r requirements.in
114 idna==3.4
115 # via requests
116diff --git a/setup.cfg b/setup.cfg
117index c9f86c9..ac37263 100644
118--- a/setup.cfg
119+++ b/setup.cfg
120@@ -1,6 +1,6 @@
121 [metadata]
122 name = lpcraft
123-version = 0.0.48.dev0
124+version = 0.0.48
125 description = Runner for Launchpad CI jobs
126 long_description = file: README.rst
127 long_description_content_type = text/x-rst

Subscribers

People subscribed via source and target branches