Skip to content

ENT-14700: Added cfengine dev release commands - #292

Draft
larsewi wants to merge 13 commits into
cfengine:mainfrom
larsewi:release-command
Draft

larsewi wants to merge 13 commits into
cfengine:mainfrom
larsewi:release-command

Conversation

@larsewi

@larsewi larsewi commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

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 release copies and signs the release files, and writes the release data. Signing is reproducible.
  • cfengine dev update-repo adds a community release to the APT and YUM repositories.
  • cfengine dev publish uploads 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.md explains how to make a release with them, and what each file does. The new release-e2e CI job recreates published releases with the real packaging and signing tools.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.56161% with 173 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.48%. Comparing base (89a64ed) to head (60dbede).

Files with missing lines Patch % Lines
src/cfengine_cli/release/update_repo.py 39.42% 63 Missing ⚠️
src/cfengine_cli/release/utils.py 61.98% 46 Missing ⚠️
src/cfengine_cli/release/release.py 30.23% 30 Missing ⚠️
src/cfengine_cli/release/publish.py 73.80% 11 Missing ⚠️
src/cfengine_cli/release/release_data.py 83.87% 10 Missing ⚠️
src/cfengine_cli/dev.py 33.33% 6 Missing ⚠️
src/cfengine_cli/release/checksums.py 86.04% 6 Missing ⚠️
src/cfengine_cli/release/metadata.py 99.20% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #292      +/-   ##
==========================================
+ Coverage   55.05%   58.48%   +3.42%     
==========================================
  Files          33       45      +12     
  Lines        4299     5070     +771     
==========================================
+ Hits         2367     2965     +598     
- Misses       1932     2105     +173     
Files with missing lines Coverage Δ
src/cfengine_cli/main.py 62.40% <100.00%> (+1.08%) ⬆️
src/cfengine_cli/release/args.py 100.00% <100.00%> (ø)
src/cfengine_cli/release/build.py 100.00% <100.00%> (ø)
src/cfengine_cli/release/copy_files.py 100.00% <100.00%> (ø)
src/cfengine_cli/release/plan.py 100.00% <100.00%> (ø)
src/cfengine_cli/release/platforms.py 100.00% <100.00%> (ø)
src/cfengine_cli/release/metadata.py 99.20% <99.20%> (ø)
src/cfengine_cli/dev.py 28.35% <33.33%> (+0.77%) ⬆️
src/cfengine_cli/release/checksums.py 86.04% <86.04%> (ø)
src/cfengine_cli/release/release_data.py 83.87% <83.87%> (ø)
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@larsewi
larsewi force-pushed the release-command branch 3 times, most recently from d72a414 to dedeac8 Compare November 27, 2026 15:48
larsewi and others added 13 commits November 27, 2026 17:13
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>
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 is published, its download
URL, and how it is shown in the release data, and prints the plan. Nightlies
copy nothing, and link to the build on buildcache.

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>
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant