From 8d1581c52abe3aa696e3d434456a39faa0df565e Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Tue, 9 Jan 2024 14:06:01 +0000 Subject: [PATCH 1/2] Add zed/yoga/2023.1 channel recipes for watcher-* This patch adds recipe metadata for the zed/yoga/2023.1(antelope) stable branches with mapping to the associated channels. The 2.x/stable charmcraft channel is used as this is demonstrated to correctly build the charms. --- .../data/lp-builder-config/openstack.yaml | 78 ++++++++++++++----- pyproject.toml | 2 +- test-requirements.txt | 3 + 3 files changed, 62 insertions(+), 21 deletions(-) diff --git a/charmed_openstack_info/data/lp-builder-config/openstack.yaml b/charmed_openstack_info/data/lp-builder-config/openstack.yaml index a8052dd..b6b7c09 100644 --- a/charmed_openstack_info/data/lp-builder-config/openstack.yaml +++ b/charmed_openstack_info/data/lp-builder-config/openstack.yaml @@ -852,20 +852,6 @@ projects: launchpad: charm-swift-storage repository: https://opendev.org/openstack/charm-swift-storage.git - # Temporarily disabled as don't know the plans for this charm? - # - name: OpenStack Watcher Charm - # Note: watcher is not promulgated - # charmhub: openstack-charmers-next-watcher - # launchpad: charm-watcher - # repository: https://opendev.org/openstack/charm-watcher.git - - # Temporarily disabled as don't know the plans for this charm? - #- name: OpenStack Watcher Dashboard Charm - # Note: watcher-dashboard is not promulgated - # charmhub: openstack-charmers-next-watcher-dashboard - # launchpad: charm-watcher-dashboard - # repository: https://opendev.org/openstack/charm-watcher-dashboard.git - - name: OpenStack Cinder Backup Swift Proxy Charm charmhub: cinder-backup-swift-proxy launchpad: charm-cinder-backup-swift-proxy @@ -2231,18 +2217,44 @@ projects: repository: https://opendev.org/openstack/charm-watcher.git branches: master: + enabled: True build-channels: - charmcraft: "2.x/candidate" + charmcraft: "2.x/stable" channels: - latest/edge bases: - "22.04" - - "23.04" - "23.10" + stable/yoga: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - yoga/stable + bases: + - "22.04" + stable/zed: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - zed/stable + bases: + - "22.04" + - "22.10" + stable/2023.1: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - 2023.1/stable + bases: + - "22.04" + - "23.04" stable/2023.2: enabled: True build-channels: - charmcraft: "2.x/candidate" + charmcraft: "2.x/stable" channels: - 2023.2/stable bases: @@ -2255,18 +2267,44 @@ projects: repository: https://opendev.org/openstack/charm-watcher-dashboard.git branches: master: + enabled: True build-channels: - charmcraft: "2.x/candidate" + charmcraft: "2.x/stable" channels: - latest/edge bases: - "22.04" - - "23.04" - "23.10" + stable/yoga: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - yoga/stable + bases: + - "22.04" + stable/zed: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - zed/stable + bases: + - "22.04" + - "22.10" + stable/2023.1: + enabled: True + build-channels: + charmcraft: "2.x/stable" + channels: + - 2023.1/stable + bases: + - "22.04" + - "23.04" stable/2023.2: enabled: True build-channels: - charmcraft: "2.x/candidate" + charmcraft: "2.x/stable" channels: - 2023.2/stable bases: diff --git a/pyproject.toml b/pyproject.toml index ba5faf7..98f31a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["pbr>=5.7.0", "setuptools>=36.6.0"] -build-backend = "pbr.build" \ No newline at end of file +build-backend = "pbr.build" diff --git a/test-requirements.txt b/test-requirements.txt index 080442f..fb80e56 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,5 +5,8 @@ mypy types-PyYAML # Fix "ModuleNotFoundError: No module named 'DistUtilsExtra'" git+https://git.launchpad.net/~freyes/python-apt@setup-requires#egg=python-apt +# Override charmcraft version in charmhub-lp-tools to <2.5.0 for tests to pass +# See https://github.com/canonical/charmcraft/issues/1472 +charmcraft < 2.5.0 # used to validate the lp-builder-config files. git+https://github.com/openstack-charmers/charmhub-lp-tools.git#egg=charmhub-lp-tools From 558acf9d2c16410db9806e126f6441d2b3a96506 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Tue, 9 Jan 2024 15:15:10 +0000 Subject: [PATCH 2/2] Fix pep8 comparing types error pep8 failed on this patch series, so it includes a "not isinstance()" rather than a !=. --- charmed_openstack_info/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charmed_openstack_info/loader.py b/charmed_openstack_info/loader.py index 9b34523..0e5b4b2 100644 --- a/charmed_openstack_info/loader.py +++ b/charmed_openstack_info/loader.py @@ -146,7 +146,7 @@ def _add_branches(self, branches_spec: Dict[str, Dict]) -> None: ref = f'refs/heads/{branch}' if ref not in self.branches: self.branches[ref] = dict(default_branch_info) - if type(branch_info) != dict: + if not isinstance(branch_info, dict): raise ValueError('Expected a dict for key branches, ' f' instead got {type(branch_info)}')