Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
==========================================
+ Coverage 55.05% 58.60% +3.54%
==========================================
Files 33 45 +12
Lines 4299 5075 +776
==========================================
+ Hits 2367 2974 +607
- Misses 1932 2101 +169
🚀 New features to boost your workflow:
|
d72a414 to
dedeac8
Compare
A new command to release the packages built by build-in-container. For now it only parses its options and prints a summary. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Reads the build output directory, with one directory per platform label, and verifies it against its sha256sums.txt files. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
60dbede to
9926265
Compare
Maps a build label like PACKAGES_x86_64_linux_debian_12 to how its packages appear in a release: title, arch, classexpr and release directory, as in the releases made by the legacy release.py. It also defines the order in which the packages are listed on the downloads page. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Plans where each .deb, .rpm and .msi of the build will be published, its download URL, and how it is shown in the release data. Prints the plan, but copies nothing yet. Nightlies get no destination, as they are not published. Instead, their URL links to the build on buildcache itself. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Plans the masterfiles tarballs, the binary tarball and the Vagrant quickstart, and for community the source tarballs, in the same order as the legacy release.py lists them. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Copies the planned files to the release dir. Each file is written in a temporary directory in the output dir and then renamed, so a published file is always complete. Existing files are skipped, so a failed run can be run again. The output dir is locked while writing, and the disk space is checked first. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Signs the .rpm and .deb copies with the release key. Signing is reproducible: the signature time is the build time of the package, set from SOURCE_DATE_EPOCH by build-in-container, so signing the same build with the same key gives identical files. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The formats of releases.json and the per-version documents, and the version rules behind them: sorting, LTS branches, support dates, titles and the latest flags. They give the same results as the legacy release.py. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Writes release-data/<project>/<version>.json with the checksums of the published files, and adds the version to releases.json. If there is no local releases.json yet, the published one is fetched. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
cbe80c4 to
141b09c
Compare
Adds a community release to the APT and YUM repositories, and regenerates and signs their metadata, with the same settings as the legacy release.py, as both write to the same repositories. It adds the signed copies from the release dir, and refuses unsigned packages. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Uploads the release to S3. --bucket test uploads the repositories to the test bucket, to try installing from them. --bucket prod uploads the release files, the repositories, and the release data last, so it never links to files that are not uploaded yet. Nightlies only upload their release data. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
ecbb431 to
2e05c2b
Compare
Recreates published community and enterprise releases from small fake packages, with the real packaging and signing tools, and compares the release data with the published one. Also checks the signatures, that signing is reproducible, and a master nightly. Runs as its own CI job, as it needs tools that dev machines usually lack. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Explains what the commands do, how to run them for feature and patch releases, how the nightlies run them, and what each file is responsible for. Ticket: ENT-14700 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
2e05c2b to
8103312
Compare
| """Return the branch of a version in releases.json. | ||
|
|
||
| A version number like 3.30.0 becomes 3.30.x. | ||
| Community master becomes nightly-master. |
There was a problem hiding this comment.
This seems a bit strange. So not-community master is just master? Doesn't seem quite right.
| ("community", "master", "nightly-master"), | ||
| ("enterprise", "master", "master"), |
There was a problem hiding this comment.
yeah, I wonder about this nightly-master and master like I mentioned earlier.
| def _limit_to_role(project: str, hub: bool, classexpr: str) -> str: | ||
| """Limit a classexpr to hubs or to non-hubs, where needed.""" | ||
| if project == "community": | ||
| # Community has one package for both hubs and agents |
There was a problem hiding this comment.
It seems you used the term "hub" differently in the comment. Maybe better is "Community has one package for both policy servers and agents"?
https://docs.cfengine.com/docs/lts/overview/glossary/#hub
https://docs.cfengine.com/docs/lts/overview/glossary/#policy-server
|
|
||
| # Every package in the published release-data/<project>/3.29.0.json, made by | ||
| # the legacy release.py: label, title, arch, classexpr, release_dir. Except the | ||
| # Ubuntu agent titles, which had .04. |
There was a problem hiding this comment.
Why drop the .04? Isn't that marginally significant since there is "always" also a .10 release?
| NO_CLASSEXPR = "!any" | ||
| NO_ARCH = "no arch" | ||
| # The label whose binary tarball is published, as in the legacy release.py | ||
| BINARY_TARBALL_LABEL = "PACKAGES_x86_64_linux_redhat_7" |
There was a problem hiding this comment.
Using redhat_7 as the "oldest rpm platform" is linked to buildscripts/build-scripts/labels.txt so it might be good to mention that location here and this location there.
| masterfiles_packages.append(source) | ||
| else: | ||
| masterfiles_sources.append(source) | ||
| elif source.name.startswith("cfengine-3."): |
There was a problem hiding this comment.
maybe change this to cfengine-\d. regex so we can get to 4 without remembering this line of code?
| source: Path, destination: Path, output_dir: str, *, dry_run: bool | ||
| ) -> None: | ||
| """Copy source to destination unless it exists, and print what is done.""" | ||
| if destination.exists(): |
There was a problem hiding this comment.
Do you think we should check the sizes or even checksums of the files instead of just existence?
|
|
||
| def copy_files(planned: list[PlannedFile], output_dir: str, *, dry_run: bool) -> None: | ||
| """Copy the planned files to their destinations. | ||
| """Copy the planned files to their destinations, signing .rpm and .deb. |
There was a problem hiding this comment.
I got this far in the review so far.. stopped here in "Added signing of packages to cfengine dev release" commit. I will continue tomorrow.
Adds three commands to release the packages built by build-in-container, for 3.30 and later. They replace the legacy release.py and sync-packages-to-s3.sh in infra, which stay in use for older LTS branches.
cfengine dev releasecopies and signs the release files, and writes the release data. Signing is reproducible.cfengine dev update-repoadds a community release to the APT and YUM repositories.cfengine dev publishuploads to S3.The commits build the commands up step by step, so they can be reviewed one at a time.
src/cfengine_cli/release/README.mdexplains how to make a release with them, and what each file does. The newrelease-e2eCI job recreates published releases with the real packaging and signing tools.🤖 Generated with Claude Code