From 9ea628691df74d2b793620a9f26ff3d6f089de83 Mon Sep 17 00:00:00 2001 From: Fernando Bravo Date: Thu, 23 Nov 2023 13:12:01 +0100 Subject: [PATCH 1/4] Updated PPA namings in tools - `daily` changed for 'edge` - `testing` changed for `beta` - Added `stable` PPA --- tools/daily-builds/deb_daily_builds.py | 7 ++++--- tools/release/lp-copy-packages.py | 6 +++--- tools/release/lp-recipe-update-build.py | 4 ++++ tools/release/release_deb_monorepo.py | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tools/daily-builds/deb_daily_builds.py b/tools/daily-builds/deb_daily_builds.py index 89e48bce57..933d56d640 100755 --- a/tools/daily-builds/deb_daily_builds.py +++ b/tools/daily-builds/deb_daily_builds.py @@ -65,7 +65,7 @@ def check_build(name) -> bool: [ "/tmp/ppa-dev-tools/scripts/ppa", "wait", - "ppa:checkbox-dev/ppa", + "ppa:checkbox-dev/edge", "-C", path, ] @@ -75,7 +75,8 @@ def check_build(name) -> bool: def main(): - """Parse the checkbox monorepo to trigger deb daily builds in Launchpad.""" + """Parse the checkbox monorepo to trigger deb daily builds in Launchpad. + The daily builds will be stored under the checkbox-dev/edge PPA.""" # First request code import (GitHub -> Launchpad) run( "./tools/release/lp-request-import.py " @@ -99,7 +100,7 @@ def main(): output = ( run( "./tools/release/lp-recipe-update-build.py checkbox " - "--recipe {} -n {}".format(name + "-daily", get_version()), + "--recipe {} -n {}".format(name + "-edge", get_version()), shell=True, check=True, ) diff --git a/tools/release/lp-copy-packages.py b/tools/release/lp-copy-packages.py index 769a43aabc..fd678fd133 100755 --- a/tools/release/lp-copy-packages.py +++ b/tools/release/lp-copy-packages.py @@ -29,10 +29,10 @@ credentials, None, None, service_root="production", version="devel") # Define the source and destination PPAs -source_ppa_name = "testing" +source_ppa_name = "beta" source_owner_name = "checkbox-dev" -dest_ppa_name = "public" -dest_owner_name = "hardware-certification" +dest_ppa_name = "stable" +dest_owner_name = "checkbox-dev" # Load the source and destination PPA owners source_owner = lp.people[source_owner_name] diff --git a/tools/release/lp-recipe-update-build.py b/tools/release/lp-recipe-update-build.py index b4a8bd26dc..7328291399 100755 --- a/tools/release/lp-recipe-update-build.py +++ b/tools/release/lp-recipe-update-build.py @@ -22,6 +22,10 @@ recipe. Meant to be used as part of a checkbox release to the Hardware Certification public PPA and the ~checkbox-dev testing PPA. + +NOTE: The Hardware Certification public PPA has no further use over the +~checkbox-dev testing PPA. It is kept for historical reasons and should be +removed at some point. """ import os diff --git a/tools/release/release_deb_monorepo.py b/tools/release/release_deb_monorepo.py index 0edf14ba38..d223eb42f5 100755 --- a/tools/release/release_deb_monorepo.py +++ b/tools/release/release_deb_monorepo.py @@ -64,7 +64,7 @@ def check_build(name) -> bool: [ "/tmp/ppa-dev-tools/scripts/ppa", "wait", - "ppa:checkbox-dev/testing", + "ppa:checkbox-dev/beta", "-C", path ] @@ -73,7 +73,7 @@ def check_build(name) -> bool: return False def main(): - """Update the PPA testing recipes and kick-off the builds.""" + """Update the PPA beta recipes and kick-off the builds.""" # Request code import staging = "" if os.getenv("CHECKBOX_REPO", "").endswith("staging"): @@ -99,7 +99,7 @@ def main(): new_version = cmd.stdout.decode().rstrip().split('v')[1] print("Request {} build ({})".format( package_name, new_version)) - recipes_name = package_name + '-testing' + recipes_name = package_name + '-beta' output = run( "./tools/release/lp-recipe-update-build.py checkbox " "--recipe {} -n {}".format( From a443d0a3f81f468e4629cffdb2d1b52a4a61d95c Mon Sep 17 00:00:00 2001 From: Fernando Bravo Date: Thu, 23 Nov 2023 13:17:12 +0100 Subject: [PATCH 2/4] Fixed formatting in tools/release files --- tools/release/lp-copy-packages.py | 3 +- tools/release/release_deb_monorepo.py | 70 ++++++++++++++++----------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/tools/release/lp-copy-packages.py b/tools/release/lp-copy-packages.py index fd678fd133..1b0f0068b5 100755 --- a/tools/release/lp-copy-packages.py +++ b/tools/release/lp-copy-packages.py @@ -26,7 +26,8 @@ # Authenticate with Launchpad credentials = Credentials.from_string(os.getenv("LP_CREDENTIALS")) lp = Launchpad( - credentials, None, None, service_root="production", version="devel") + credentials, None, None, service_root="production", version="devel" +) # Define the source and destination PPAs source_ppa_name = "beta" diff --git a/tools/release/release_deb_monorepo.py b/tools/release/release_deb_monorepo.py index d223eb42f5..88c893bfaf 100755 --- a/tools/release/release_deb_monorepo.py +++ b/tools/release/release_deb_monorepo.py @@ -35,24 +35,26 @@ }} """ + def run(*args, **kwargs): """wrapper for subprocess.run.""" try: return subprocess.run( - *args, **kwargs, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + *args, **kwargs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) except subprocess.CalledProcessError as e: - print('{}\n{}'.format(e, e.output.decode())) + print("{}\n{}".format(e, e.output.decode())) raise SystemExit(1) + def _del_file(path): with suppress(FileNotFoundError): os.remove(path) + def check_build(name) -> bool: """ - Checks if a build was succesful, returns true if it was + Checks if a build was successful, returns true if it was """ handle, path = tempfile.mkstemp(text=True) # try to remove the file before exit @@ -66,12 +68,13 @@ def check_build(name) -> bool: "wait", "ppa:checkbox-dev/beta", "-C", - path + path, ] ) return True return False + def main(): """Update the PPA beta recipes and kick-off the builds.""" # Request code import @@ -79,32 +82,43 @@ def main(): if os.getenv("CHECKBOX_REPO", "").endswith("staging"): staging = "-staging" print("Start code import...") - output = run( - "./tools/release/lp-request-import.py {}".format( - "~checkbox-dev/checkbox/+git/checkbox"+staging), - shell=True, check=True).stdout.decode().rstrip() + output = ( + run( + "./tools/release/lp-request-import.py {}".format( + "~checkbox-dev/checkbox/+git/checkbox" + staging + ), + shell=True, + check=True, + ) + .stdout.decode() + .rstrip() + ) print(output) to_check = [] - for path, dirs, files in os.walk('.'): + for path, dirs, files in os.walk("."): if "debian" in dirs: project_path = str(Path(*Path(path).parts)) - package_name = str(project_path).replace('s/', '-') - if package_name.startswith('provider'): - package_name = "checkbox-"+package_name + package_name = str(project_path).replace("s/", "-") + if package_name.startswith("provider"): + package_name = "checkbox-" + package_name if os.getenv("CHECKBOX_REPO", "").endswith("staging"): - package_name = "staging-"+package_name - cmd = run([ - 'git', 'describe', '--tags', - '--abbrev=0', '--match', 'v*']) - new_version = cmd.stdout.decode().rstrip().split('v')[1] - print("Request {} build ({})".format( - package_name, new_version)) - recipes_name = package_name + '-beta' - output = run( - "./tools/release/lp-recipe-update-build.py checkbox " - "--recipe {} -n {}".format( - recipes_name, new_version), - shell=True, check=True).stdout.decode().rstrip() + package_name = "staging-" + package_name + cmd = run( + ["git", "describe", "--tags", "--abbrev=0", "--match", "v*"] + ) + new_version = cmd.stdout.decode().rstrip().split("v")[1] + print("Request {} build ({})".format(package_name, new_version)) + recipes_name = package_name + "-beta" + output = ( + run( + "./tools/release/lp-recipe-update-build.py checkbox " + "--recipe {} -n {}".format(recipes_name, new_version), + shell=True, + check=True, + ) + .stdout.decode() + .rstrip() + ) print(output) to_check.append(package_name) @@ -112,7 +126,7 @@ def main(): for name, ok in checked: if not ok: print("Failed to build:", name) - if any(not ok for (_,ok) in checked): + if any(not ok for (_, ok) in checked): raise SystemExit(1) From d795a24685c4d4f4fed2b4b62845139b21087a97 Mon Sep 17 00:00:00 2001 From: Fernando Bravo Date: Thu, 23 Nov 2023 17:20:14 +0100 Subject: [PATCH 3/4] Replaced old ppa naming in documentation --- checkbox-ng/README.rst | 2 +- metabox/README.md | 4 ++-- .../certification-client/debian/README.Debian | 8 ++++---- .../certification-server/debian/README.Debian | 8 ++++---- tools/release/README.md | 17 ++++++++--------- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/checkbox-ng/README.rst b/checkbox-ng/README.rst index d97b37d70d..19b82caf9d 100644 --- a/checkbox-ng/README.rst +++ b/checkbox-ng/README.rst @@ -7,7 +7,7 @@ desktops, servers and IOT devices with Ubuntu. Installation ============ -$ sudo add-apt-repository ppa:checkbox-dev/ppa +$ sudo add-apt-repository ppa:checkbox-dev/edge $ sudo apt-get update $ sudo apt-get install checkbox-ng diff --git a/metabox/README.md b/metabox/README.md index ff558acc7a..e5e6840d0f 100644 --- a/metabox/README.md +++ b/metabox/README.md @@ -67,7 +67,7 @@ optional arguments: Let's say I want to test: - the [`basic` scenario] (which focuses on Checkbox local) -- using the latest Debian version of Checkbox available in the Daily Builds PPA +- using the latest Debian version of Checkbox available in the Edge PPA - on bionic (18.04) and focal (20.04) - for Checkbox local only (not Checkbox remote) @@ -77,7 +77,7 @@ I can create the following `local-daily-builds-config.py` file: configuration = { 'local': { 'origin': 'ppa', - 'uri': 'ppa:checkbox-dev/ppa', + 'uri': 'ppa:checkbox-dev/edge', 'releases': ['bionic', 'focal'], }, } diff --git a/providers/certification-client/debian/README.Debian b/providers/certification-client/debian/README.Debian index 0a48be9fc6..f08b137c20 100644 --- a/providers/certification-client/debian/README.Debian +++ b/providers/certification-client/debian/README.Debian @@ -1,16 +1,16 @@ -To build this package against the testing PPA +To build this package against the beta PPA sbuild -d precise \ --chroot-setup-commands="apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1B4B6B2D2BBDF2BD" \ --extra-repository="deb http://archive.ubuntu.com/ubuntu precise universe" \ - --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/testing/ubuntu precise main" + --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/beta/ubuntu precise main" -To build this package against the daily PPA +To build this package against the edge PPA sbuild -d precise \ --chroot-setup-commands="apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1B4B6B2D2BBDF2BD" \ --extra-repository="deb http://archive.ubuntu.com/ubuntu precise universe" \ - --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu precise main" + --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/edge/ubuntu precise main" The precise universe component is optional. It is needed if you created a vanilla precise schroot. If you already modified it have universe enabled then diff --git a/providers/certification-server/debian/README.Debian b/providers/certification-server/debian/README.Debian index 0a48be9fc6..f08b137c20 100644 --- a/providers/certification-server/debian/README.Debian +++ b/providers/certification-server/debian/README.Debian @@ -1,16 +1,16 @@ -To build this package against the testing PPA +To build this package against the beta PPA sbuild -d precise \ --chroot-setup-commands="apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1B4B6B2D2BBDF2BD" \ --extra-repository="deb http://archive.ubuntu.com/ubuntu precise universe" \ - --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/testing/ubuntu precise main" + --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/beta/ubuntu precise main" -To build this package against the daily PPA +To build this package against the edge PPA sbuild -d precise \ --chroot-setup-commands="apt-key adv --keyserver keyserver.ubuntu.com --recv-key 1B4B6B2D2BBDF2BD" \ --extra-repository="deb http://archive.ubuntu.com/ubuntu precise universe" \ - --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu precise main" + --extra-repository="deb http://ppa.launchpad.net/checkbox-dev/edge/ubuntu precise main" The precise universe component is optional. It is needed if you created a vanilla precise schroot. If you already modified it have universe enabled then diff --git a/tools/release/README.md b/tools/release/README.md index 05085d6374..3e74ca94ba 100644 --- a/tools/release/README.md +++ b/tools/release/README.md @@ -47,7 +47,7 @@ proceed with the release. ## Promote the previous beta release to stable Internal teams (mostly QA and Certification) are using the version in the beta -snap channels or the Testing PPA to complete their tests. If this version is +snap channels or the beta PPA to complete their tests. If this version is validated, it can then be pushed to stable for other teams and external stakeholders. @@ -132,7 +132,7 @@ a date postfix in the form of `.YYYYMMDD`, this should never happen in a release 3 workflows are triggered on tag push events: -- [checkbox deb packages] *(built and published to the testing PPA)* +- [checkbox deb packages] *(built and published to the beta PPA)* - [checkbox snap packages] *(built and uploaded to their respective beta channels)* - [checkbox core snap packages] *(built and uploaded to their respective beta @@ -177,10 +177,9 @@ be able to send an e-mail to them. ## PPA/Repositories -* [Stable]\: The official release of Checkbox -* [Testing]\: Release candidates of Checkbox before it becomes the official -release -* [Development]\: Daily builds (that may contain experimental features) +* [stable]\: For external customers. +* [beta]\: For Canonical internal users. This version should be the one used for Certification, and early QA pipelines. +* [edge]\: To test recent developments that are not yet in beta. ## Projects released as Debian packages @@ -199,9 +198,9 @@ release [setuptools_scm]: https://github.com/pypa/setuptools_scm/ [Stable release workflow]: https://github.com/canonical/checkbox/actions/workflows/checkbox-stable-release.yml [Bumpversion]: https://github.com/c4urself/bump2version -[Stable]: https://launchpad.net/~hardware-certification/+archive/ubuntu/public -[Testing]: https://code.launchpad.net/~checkbox-dev/+archive/ubuntu/testing -[Development]: https://code.launchpad.net/~checkbox-dev/+archive/ubuntu/ppa +[stable]: https://launchpad.net/~checkbox-dev/+archive/ubuntu/stable +[beta]: https://code.launchpad.net/~checkbox-dev/+archive/ubuntu/beta +[edge]: https://code.launchpad.net/~checkbox-dev/+archive/ubuntu/edge [Launchpad Builders status]: https://launchpad.net/builders [checkbox deb packages]: https://github.com/canonical/checkbox/actions/workflows/deb-beta-release.yml [checkbox snap packages]: https://github.com/canonical/checkbox/actions/workflows/checkbox-snap-beta-release.yml From c2f248b7c7c6934f5a31ad3da3c3ebb0f9df8dff Mon Sep 17 00:00:00 2001 From: Fernando Bravo Date: Thu, 23 Nov 2023 17:23:02 +0100 Subject: [PATCH 4/4] Updated old ppa reference in snapcraft --- checkbox-core-snap/series16/snap/snapcraft.yaml | 2 +- checkbox-core-snap/series18/snap/snapcraft.yaml | 2 +- checkbox-core-snap/series20/snap/snapcraft.yaml | 2 +- checkbox-core-snap/series22/snap/snapcraft.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/checkbox-core-snap/series16/snap/snapcraft.yaml b/checkbox-core-snap/series16/snap/snapcraft.yaml index f18d501ff9..b5e90ee438 100644 --- a/checkbox-core-snap/series16/snap/snapcraft.yaml +++ b/checkbox-core-snap/series16/snap/snapcraft.yaml @@ -54,7 +54,7 @@ slots: package-repositories: - type: apt - ppa: hardware-certification/public + ppa: checkbox-dev/stable parts: version-calculator: diff --git a/checkbox-core-snap/series18/snap/snapcraft.yaml b/checkbox-core-snap/series18/snap/snapcraft.yaml index 7acaf0c4da..0c1117e6a0 100644 --- a/checkbox-core-snap/series18/snap/snapcraft.yaml +++ b/checkbox-core-snap/series18/snap/snapcraft.yaml @@ -58,7 +58,7 @@ slots: package-repositories: - type: apt - ppa: hardware-certification/public + ppa: checkbox-dev/stable parts: version-calculator: diff --git a/checkbox-core-snap/series20/snap/snapcraft.yaml b/checkbox-core-snap/series20/snap/snapcraft.yaml index bfb0a9cbda..071a9769b7 100644 --- a/checkbox-core-snap/series20/snap/snapcraft.yaml +++ b/checkbox-core-snap/series20/snap/snapcraft.yaml @@ -58,7 +58,7 @@ slots: package-repositories: - type: apt - ppa: hardware-certification/public + ppa: checkbox-dev/stable parts: version-calculator: diff --git a/checkbox-core-snap/series22/snap/snapcraft.yaml b/checkbox-core-snap/series22/snap/snapcraft.yaml index b3124d8427..3e91b08bb7 100644 --- a/checkbox-core-snap/series22/snap/snapcraft.yaml +++ b/checkbox-core-snap/series22/snap/snapcraft.yaml @@ -62,7 +62,7 @@ slots: package-repositories: - type: apt - ppa: hardware-certification/public + ppa: checkbox-dev/stable parts: version-calculator: