Merge ~jugmac00/lpci:add-support-for-noble-to-ppas into lpci:main

Proposed by Jürgen Gmach
Status: Merged
Merged at revision: 1ab888ea97f7ad2de893ef6ca92fea053cc196c6
Proposed branch: ~jugmac00/lpci:add-support-for-noble-to-ppas
Merge into: lpci:main
Diff against target: 169 lines (+116/-5)
4 files modified
NEWS.rst (+5/-0)
lpci/config.py (+2/-4)
lpci/tests/test_config.py (+108/-0)
setup.cfg (+1/-1)
Reviewer Review Type Date Requested Status
Simone Pelosi Approve
Review via email: mp+465262@code.launchpad.net

Commit message

Add support for Noble for additional archives (PPAs)

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) wrote :

LGTM!

review: Approve

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 867dd2c..a10bc35 100644
3--- a/NEWS.rst
4+++ b/NEWS.rst
5@@ -2,6 +2,11 @@
6 Version history
7 ===============
8
9+0.2.8 (2024-04-30)
10+==================
11+
12+- Add support for Noble for additional archives (PPAs).
13+
14 0.2.7 (2024-04-11)
15 ==================
16
17diff --git a/lpci/config.py b/lpci/config.py
18index 4af17e5..ccedfdc 100644
19--- a/lpci/config.py
20+++ b/lpci/config.py
21@@ -115,15 +115,13 @@ class PackageSuite(str, Enum):
22 """Specifies the suite of the package repository.
23
24 e.g. xenial, focal, ...
25+ This validator is used for PPAs, not for the series in general.
26 """
27
28- # XXX jugmac00 2023-03-10 the intention of this class was to verify that
29- # only supported distroseries are present in the .launchpad.yaml file
30- # but this does not work as intended, as you can specify arbitrary
31- # strings which later possibly result in a KeyError
32 bionic = "bionic" # 18.04
33 focal = "focal" # 20.04
34 jammy = "jammy" # 22.04
35+ noble = "noble" # 24.04
36
37
38 class PPAShortFormURL(pydantic.ConstrainedStr):
39diff --git a/lpci/tests/test_config.py b/lpci/tests/test_config.py
40index 17cc308..4c9d10a 100644
41--- a/lpci/tests/test_config.py
42+++ b/lpci/tests/test_config.py
43@@ -522,6 +522,114 @@ class TestConfig(TestCase):
44 config.jobs["test"][0].package_repositories,
45 )
46
47+ def test_package_repositories_support_all_supported_LTS_releases(self):
48+ """Supported releases as of now:
49+
50+ - bionic
51+ - focal
52+ - jammy
53+ - noble
54+ """
55+ path = self.create_config(
56+ dedent(
57+ """
58+ pipeline:
59+ - test
60+
61+ jobs:
62+ test:
63+ series: bionic
64+ architectures: amd64
65+ packages: [nginx, apache2]
66+ package-repositories:
67+ - type: apt
68+ formats: [deb]
69+ components: [main]
70+ suites: [bionic]
71+ url: https://canonical.example.org/artifactory/bionic-golang-backport
72+ - type: apt
73+ formats: [deb]
74+ components: [main]
75+ suites: [focal]
76+ url: https://canonical.example.org/artifactory/focal-golang-backport
77+ - type: apt
78+ formats: [deb]
79+ components: [main]
80+ suites: [jammy]
81+ url: https://canonical.example.org/artifactory/jammy-golang-backport
82+ - type: apt
83+ formats: [deb]
84+ components: [main]
85+ suites: [noble]
86+ url: https://canonical.example.org/artifactory/noble-golang-backport
87+ """ # noqa: E501
88+ )
89+ )
90+
91+ config = Config.load(path)
92+
93+ self.assertEqual(
94+ [
95+ PackageRepository(
96+ type=PackageType.apt,
97+ formats=[PackageFormat.deb],
98+ components=[PackageComponent.main],
99+ suites=[PackageSuite.bionic],
100+ url=AnyHttpUrl(
101+ "https://canonical.example.org/artifactory/bionic-golang-backport", # noqa: E501
102+ scheme="https",
103+ host="canonical.example.org",
104+ tld="org",
105+ host_type="domain",
106+ path="/artifactory/bionic-golang-backport",
107+ ),
108+ ),
109+ PackageRepository(
110+ type=PackageType.apt,
111+ formats=[PackageFormat.deb],
112+ components=[PackageComponent.main],
113+ suites=[PackageSuite.focal],
114+ url=AnyHttpUrl(
115+ "https://canonical.example.org/artifactory/focal-golang-backport", # noqa: E501
116+ scheme="https",
117+ host="canonical.example.org",
118+ tld="org",
119+ host_type="domain",
120+ path="/artifactory/focal-golang-backport",
121+ ),
122+ ),
123+ PackageRepository(
124+ type=PackageType.apt,
125+ formats=[PackageFormat.deb],
126+ components=[PackageComponent.main],
127+ suites=[PackageSuite.jammy],
128+ url=AnyHttpUrl(
129+ "https://canonical.example.org/artifactory/jammy-golang-backport", # noqa: E501
130+ scheme="https",
131+ host="canonical.example.org",
132+ tld="org",
133+ host_type="domain",
134+ path="/artifactory/jammy-golang-backport",
135+ ),
136+ ),
137+ PackageRepository(
138+ type=PackageType.apt,
139+ formats=[PackageFormat.deb],
140+ components=[PackageComponent.main],
141+ suites=[PackageSuite.noble],
142+ url=AnyHttpUrl(
143+ "https://canonical.example.org/artifactory/noble-golang-backport", # noqa: E501
144+ scheme="https",
145+ host="canonical.example.org",
146+ tld="org",
147+ host_type="domain",
148+ path="/artifactory/noble-golang-backport",
149+ ),
150+ ),
151+ ],
152+ config.jobs["test"][0].package_repositories,
153+ )
154+
155 def test_package_repositories_as_string(self):
156 path = self.create_config(
157 dedent(
158diff --git a/setup.cfg b/setup.cfg
159index d556b46..9cf10b7 100644
160--- a/setup.cfg
161+++ b/setup.cfg
162@@ -1,6 +1,6 @@
163 [metadata]
164 name = lpci
165-version = 0.2.7
166+version = 0.2.8
167 description = Runner for Launchpad CI jobs
168 long_description = file: README.rst
169 long_description_content_type = text/x-rst

Subscribers

People subscribed via source and target branches