Merge ~corey.bryant/lpci:main into lpci:main

Proposed by Corey Bryant
Status: Merged
Merge reported by: Jürgen Gmach
Merged at revision: 6aec797c5a1bfc60cf131fffb036d4d2d5734c95
Proposed branch: ~corey.bryant/lpci:main
Merge into: lpci:main
Diff against target: 62 lines (+22/-1)
4 files modified
NEWS.rst (+5/-0)
lpci/providers/_buildd.py (+1/-0)
lpci/providers/tests/test_buildd.py (+15/-0)
requirements.in (+1/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+443407@code.launchpad.net

This proposal supersedes a proposal from 2023-05-23.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote : Posted in a previous version of this proposal

Thanks for your contribution!

Could you please add an entry in the NEWS.rst?

Also, `bases.BuilddBaseAlias.DEVEL` was only introduced in craft-providers 1.8.1, but our `requirements.in` specify 1.8.0 as minimum version. Could you please update the minimum required version and the comment?

I do not think we need to apply `tox -e pip-compile` now, as version 1.8.1 was used in the requirements.txt anyway - but we (Launchapd devs) should update the dependencies soon.

I do feel a bit uneasy about adding code without tests, but that is the way we did before for adding new series/versions.

A very simple test that verifies that the key is present in `SERIES_TO_BUILDD_IMAGE_ALIAS` and that it maps to the correct image looks like it would not help too much, but at least it guarantees that we do not remove a series by mistake.

Do you want to add such a test? Do not worry if not, then I think I will add one for all series.

Revision history for this message
Corey Bryant (corey.bryant) wrote : Posted in a previous version of this proposal

Thanks for the review! I have changes but I force pushed them and they're not showing up here so I think I'll resubmit the proposal.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

This is ready for re-review. Thanks again.

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

Thanks!

As we have no merge-bot active here, I think I need to merge this manually.

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

> I have changes but I force pushed them and they're not showing up here so I think I'll resubmit the proposal.

That would indicate an issue with the diff mechanism. I will try to look into that later.

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

And FWIW, following semantic versioning a new feature would properly need a bump of the minor version part, but on the one hand we were not very passionate about that in the past, and I can do that when I cut a new release.

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

This is live now! Thanks again for your contribution.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Tested and works! Thanks! \o/

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 34f9f96..b6e37c7 100644
3--- a/NEWS.rst
4+++ b/NEWS.rst
5@@ -2,6 +2,11 @@
6 Version history
7 ===============
8
9+0.1.3 (unreleased)
10+==================
11+
12+- Add support for non-LTS devel release, which is currently mantic.
13+
14 0.1.2 (2023-05-02)
15 ==================
16
17diff --git a/lpci/providers/_buildd.py b/lpci/providers/_buildd.py
18index 62c5546..88f5e19 100644
19--- a/lpci/providers/_buildd.py
20+++ b/lpci/providers/_buildd.py
21@@ -20,6 +20,7 @@ SERIES_TO_BUILDD_IMAGE_ALIAS = {
22 "jammy": bases.BuilddBaseAlias.JAMMY,
23 "kinetic": bases.BuilddBaseAlias.KINETIC,
24 "lunar": bases.BuilddBaseAlias.LUNAR,
25+ "devel": bases.BuilddBaseAlias.DEVEL,
26 }
27
28
29diff --git a/lpci/providers/tests/test_buildd.py b/lpci/providers/tests/test_buildd.py
30index ea007ef..47d4ea8 100644
31--- a/lpci/providers/tests/test_buildd.py
32+++ b/lpci/providers/tests/test_buildd.py
33@@ -15,3 +15,18 @@ class TestLPCIBuilddBaseConfiguration(TestCase):
34 "foo" == LPCIBuilddBaseConfiguration(
35 alias=BuilddBaseAlias.FOCAL,
36 )
37+
38+ def test_series_to_buildd_image_alias(self):
39+ alias_mapping = {
40+ "16.04": BuilddBaseAlias.XENIAL.value,
41+ "18.04": BuilddBaseAlias.BIONIC.value,
42+ "20.04": BuilddBaseAlias.FOCAL.value,
43+ "22.04": BuilddBaseAlias.JAMMY.value,
44+ "22.10": BuilddBaseAlias.KINETIC.value,
45+ "23.04": BuilddBaseAlias.LUNAR.value,
46+ "devel": BuilddBaseAlias.DEVEL.value,
47+ }
48+ for k, v in alias_mapping.items():
49+ self.assertEqual(k, v)
50+
51+ self.assertEqual(len(BuilddBaseAlias), len(alias_mapping))
52diff --git a/requirements.in b/requirements.in
53index 4679cf3..9f747f4 100644
54--- a/requirements.in
55+++ b/requirements.in
56@@ -1,5 +1,5 @@
57 craft-cli
58-craft-providers>=1.8.0 # 1.8.0 added support of non-LTS releases
59+craft-providers>=1.8.1 # 1.8.1 added support of bases.BuilddBaseAlias.DEVEL
60 launchpadlib[keyring]
61 pydantic
62 PyYAML

Subscribers

People subscribed via source and target branches