Skip to content

Commit

Permalink
Updating ppa naming (New) (#835)
Browse files Browse the repository at this point in the history
* Updated PPA namings in tools

- `daily` changed for 'edge`
- `testing` changed for `beta`
- Added `stable` PPA

* Fixed formatting in tools/release files

* Replaced old ppa naming in documentation

* Updated old ppa reference in snapcraft
  • Loading branch information
fernando79513 authored Nov 23, 2023
1 parent 62834c4 commit f5937ef
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 61 deletions.
2 changes: 1 addition & 1 deletion checkbox-core-snap/series16/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ slots:

package-repositories:
- type: apt
ppa: hardware-certification/public
ppa: checkbox-dev/stable

parts:
version-calculator:
Expand Down
2 changes: 1 addition & 1 deletion checkbox-core-snap/series18/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ slots:

package-repositories:
- type: apt
ppa: hardware-certification/public
ppa: checkbox-dev/stable

parts:
version-calculator:
Expand Down
2 changes: 1 addition & 1 deletion checkbox-core-snap/series20/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ slots:

package-repositories:
- type: apt
ppa: hardware-certification/public
ppa: checkbox-dev/stable

parts:
version-calculator:
Expand Down
2 changes: 1 addition & 1 deletion checkbox-core-snap/series22/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ slots:

package-repositories:
- type: apt
ppa: hardware-certification/public
ppa: checkbox-dev/stable

parts:
version-calculator:
Expand Down
2 changes: 1 addition & 1 deletion checkbox-ng/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions metabox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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'],
},
}
Expand Down
8 changes: 4 additions & 4 deletions providers/certification-client/debian/README.Debian
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions providers/certification-server/debian/README.Debian
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions tools/daily-builds/deb_daily_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Expand All @@ -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 "
Expand All @@ -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,
)
Expand Down
17 changes: 8 additions & 9 deletions tools/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tools/release/lp-copy-packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
# 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 = "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]
Expand Down
4 changes: 4 additions & 0 deletions tools/release/lp-recipe-update-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
74 changes: 44 additions & 30 deletions tools/release/release_deb_monorepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -64,55 +66,67 @@ def check_build(name) -> bool:
[
"/tmp/ppa-dev-tools/scripts/ppa",
"wait",
"ppa:checkbox-dev/testing",
"ppa:checkbox-dev/beta",
"-C",
path
path,
]
)
return True
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"):
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 + '-testing'
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)

checked = [(name, check_build(name)) for name in to_check]
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)


Expand Down

0 comments on commit f5937ef

Please sign in to comment.