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
diff --git a/NEWS.rst b/NEWS.rst
index 867dd2c..a10bc35 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
2Version history2Version history
3===============3===============
44
50.2.8 (2024-04-30)
6==================
7
8- Add support for Noble for additional archives (PPAs).
9
50.2.7 (2024-04-11)100.2.7 (2024-04-11)
6==================11==================
712
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):
115 """Specifies the suite of the package repository.115 """Specifies the suite of the package repository.
116116
117 e.g. xenial, focal, ...117 e.g. xenial, focal, ...
118 This validator is used for PPAs, not for the series in general.
118 """119 """
119120
120 # XXX jugmac00 2023-03-10 the intention of this class was to verify that
121 # only supported distroseries are present in the .launchpad.yaml file
122 # but this does not work as intended, as you can specify arbitrary
123 # strings which later possibly result in a KeyError
124 bionic = "bionic" # 18.04121 bionic = "bionic" # 18.04
125 focal = "focal" # 20.04122 focal = "focal" # 20.04
126 jammy = "jammy" # 22.04123 jammy = "jammy" # 22.04
124 noble = "noble" # 24.04
127125
128126
129class PPAShortFormURL(pydantic.ConstrainedStr):127class 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):
522 config.jobs["test"][0].package_repositories,522 config.jobs["test"][0].package_repositories,
523 )523 )
524524
525 def test_package_repositories_support_all_supported_LTS_releases(self):
526 """Supported releases as of now:
527
528 - bionic
529 - focal
530 - jammy
531 - noble
532 """
533 path = self.create_config(
534 dedent(
535 """
536 pipeline:
537 - test
538
539 jobs:
540 test:
541 series: bionic
542 architectures: amd64
543 packages: [nginx, apache2]
544 package-repositories:
545 - type: apt
546 formats: [deb]
547 components: [main]
548 suites: [bionic]
549 url: https://canonical.example.org/artifactory/bionic-golang-backport
550 - type: apt
551 formats: [deb]
552 components: [main]
553 suites: [focal]
554 url: https://canonical.example.org/artifactory/focal-golang-backport
555 - type: apt
556 formats: [deb]
557 components: [main]
558 suites: [jammy]
559 url: https://canonical.example.org/artifactory/jammy-golang-backport
560 - type: apt
561 formats: [deb]
562 components: [main]
563 suites: [noble]
564 url: https://canonical.example.org/artifactory/noble-golang-backport
565 """ # noqa: E501
566 )
567 )
568
569 config = Config.load(path)
570
571 self.assertEqual(
572 [
573 PackageRepository(
574 type=PackageType.apt,
575 formats=[PackageFormat.deb],
576 components=[PackageComponent.main],
577 suites=[PackageSuite.bionic],
578 url=AnyHttpUrl(
579 "https://canonical.example.org/artifactory/bionic-golang-backport", # noqa: E501
580 scheme="https",
581 host="canonical.example.org",
582 tld="org",
583 host_type="domain",
584 path="/artifactory/bionic-golang-backport",
585 ),
586 ),
587 PackageRepository(
588 type=PackageType.apt,
589 formats=[PackageFormat.deb],
590 components=[PackageComponent.main],
591 suites=[PackageSuite.focal],
592 url=AnyHttpUrl(
593 "https://canonical.example.org/artifactory/focal-golang-backport", # noqa: E501
594 scheme="https",
595 host="canonical.example.org",
596 tld="org",
597 host_type="domain",
598 path="/artifactory/focal-golang-backport",
599 ),
600 ),
601 PackageRepository(
602 type=PackageType.apt,
603 formats=[PackageFormat.deb],
604 components=[PackageComponent.main],
605 suites=[PackageSuite.jammy],
606 url=AnyHttpUrl(
607 "https://canonical.example.org/artifactory/jammy-golang-backport", # noqa: E501
608 scheme="https",
609 host="canonical.example.org",
610 tld="org",
611 host_type="domain",
612 path="/artifactory/jammy-golang-backport",
613 ),
614 ),
615 PackageRepository(
616 type=PackageType.apt,
617 formats=[PackageFormat.deb],
618 components=[PackageComponent.main],
619 suites=[PackageSuite.noble],
620 url=AnyHttpUrl(
621 "https://canonical.example.org/artifactory/noble-golang-backport", # noqa: E501
622 scheme="https",
623 host="canonical.example.org",
624 tld="org",
625 host_type="domain",
626 path="/artifactory/noble-golang-backport",
627 ),
628 ),
629 ],
630 config.jobs["test"][0].package_repositories,
631 )
632
525 def test_package_repositories_as_string(self):633 def test_package_repositories_as_string(self):
526 path = self.create_config(634 path = self.create_config(
527 dedent(635 dedent(
diff --git a/setup.cfg b/setup.cfg
index d556b46..9cf10b7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
1[metadata]1[metadata]
2name = lpci2name = lpci
3version = 0.2.73version = 0.2.8
4description = Runner for Launchpad CI jobs4description = Runner for Launchpad CI jobs
5long_description = file: README.rst5long_description = file: README.rst
6long_description_content_type = text/x-rst6long_description_content_type = text/x-rst

Subscribers

People subscribed via source and target branches