← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Jürgen Gmach has proposed merging ~jugmac00/lpci:add-support-for-noble-to-ppas into lpci:main.

Commit message:
Add support for Noble for additional archives (PPAs)

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jugmac00/lpci/+git/lpcraft/+merge/465262
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/lpci:add-support-for-noble-to-ppas into lpci:main.
diff --git a/NEWS.rst b/NEWS.rst
index 867dd2c..a10bc35 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
 Version history
 ===============
 
+0.2.8 (2024-04-30)
+==================
+
+- Add support for Noble for additional archives (PPAs).
+
 0.2.7 (2024-04-11)
 ==================
 
diff --git a/lpci/config.py b/lpci/config.py
index 4af17e5..ccedfdc 100644
--- a/lpci/config.py
+++ b/lpci/config.py
@@ -115,15 +115,13 @@ class PackageSuite(str, Enum):
     """Specifies the suite of the package repository.
 
     e.g. xenial, focal, ...
+    This validator is used for PPAs, not for the series in general.
     """
 
-    # XXX jugmac00 2023-03-10 the intention of this class was to verify that
-    # only supported distroseries are present in the .launchpad.yaml file
-    # but this does not work as intended, as you can specify arbitrary
-    # strings which later possibly result in a KeyError
     bionic = "bionic"  # 18.04
     focal = "focal"  # 20.04
     jammy = "jammy"  # 22.04
+    noble = "noble"  # 24.04
 
 
 class PPAShortFormURL(pydantic.ConstrainedStr):
diff --git a/lpci/tests/test_config.py b/lpci/tests/test_config.py
index 17cc308..4c9d10a 100644
--- a/lpci/tests/test_config.py
+++ b/lpci/tests/test_config.py
@@ -522,6 +522,114 @@ class TestConfig(TestCase):
             config.jobs["test"][0].package_repositories,
         )
 
+    def test_package_repositories_support_all_supported_LTS_releases(self):
+        """Supported releases as of now:
+
+        - bionic
+        - focal
+        - jammy
+        - noble
+        """
+        path = self.create_config(
+            dedent(
+                """
+                pipeline:
+                    - test
+
+                jobs:
+                    test:
+                        series: bionic
+                        architectures: amd64
+                        packages: [nginx, apache2]
+                        package-repositories:
+                            - type: apt
+                              formats: [deb]
+                              components: [main]
+                              suites: [bionic]
+                              url: https://canonical.example.org/artifactory/bionic-golang-backport
+                            - type: apt
+                              formats: [deb]
+                              components: [main]
+                              suites: [focal]
+                              url: https://canonical.example.org/artifactory/focal-golang-backport
+                            - type: apt
+                              formats: [deb]
+                              components: [main]
+                              suites: [jammy]
+                              url: https://canonical.example.org/artifactory/jammy-golang-backport
+                            - type: apt
+                              formats: [deb]
+                              components: [main]
+                              suites: [noble]
+                              url: https://canonical.example.org/artifactory/noble-golang-backport
+                """  # noqa: E501
+            )
+        )
+
+        config = Config.load(path)
+
+        self.assertEqual(
+            [
+                PackageRepository(
+                    type=PackageType.apt,
+                    formats=[PackageFormat.deb],
+                    components=[PackageComponent.main],
+                    suites=[PackageSuite.bionic],
+                    url=AnyHttpUrl(
+                        "https://canonical.example.org/artifactory/bionic-golang-backport";,  # noqa: E501
+                        scheme="https",
+                        host="canonical.example.org",
+                        tld="org",
+                        host_type="domain",
+                        path="/artifactory/bionic-golang-backport",
+                    ),
+                ),
+                PackageRepository(
+                    type=PackageType.apt,
+                    formats=[PackageFormat.deb],
+                    components=[PackageComponent.main],
+                    suites=[PackageSuite.focal],
+                    url=AnyHttpUrl(
+                        "https://canonical.example.org/artifactory/focal-golang-backport";,  # noqa: E501
+                        scheme="https",
+                        host="canonical.example.org",
+                        tld="org",
+                        host_type="domain",
+                        path="/artifactory/focal-golang-backport",
+                    ),
+                ),
+                PackageRepository(
+                    type=PackageType.apt,
+                    formats=[PackageFormat.deb],
+                    components=[PackageComponent.main],
+                    suites=[PackageSuite.jammy],
+                    url=AnyHttpUrl(
+                        "https://canonical.example.org/artifactory/jammy-golang-backport";,  # noqa: E501
+                        scheme="https",
+                        host="canonical.example.org",
+                        tld="org",
+                        host_type="domain",
+                        path="/artifactory/jammy-golang-backport",
+                    ),
+                ),
+                PackageRepository(
+                    type=PackageType.apt,
+                    formats=[PackageFormat.deb],
+                    components=[PackageComponent.main],
+                    suites=[PackageSuite.noble],
+                    url=AnyHttpUrl(
+                        "https://canonical.example.org/artifactory/noble-golang-backport";,  # noqa: E501
+                        scheme="https",
+                        host="canonical.example.org",
+                        tld="org",
+                        host_type="domain",
+                        path="/artifactory/noble-golang-backport",
+                    ),
+                ),
+            ],
+            config.jobs["test"][0].package_repositories,
+        )
+
     def test_package_repositories_as_string(self):
         path = self.create_config(
             dedent(