Skip to content

feat(release): attach the .deb and .rpm nobody could obtain (#138) - #420

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/138a-release-packages
Aug 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/138a-release-packages

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Part (a) of #138. Parts (b) and (c) are not in this PR — see the bottom.

The packages were built and never shipped

nfpm.yaml has worked for several releases. ci.yml's packaging job builds both formats on every PR, installs the deb, runs the postinstall scriptlet, and loads the installed modulefile under Lmod. And release.yml contained zero references to package-linux, nfpm, .deb or .rpm, so every published release is exactly ten assets — five tarballs and five checksums:

$ gh release view v0.13.0 --json assets --jq '[.assets[].name] | length'
10

Same for v0.12.0 and v0.11.0. A package CI proves installable and no user can obtain is scripts/preremove.sh before #207: working code with nothing invoking it.

The structural cause is the one #198 had. make package-linux was exercised only by a job that cannot publish anything, so nothing anywhere compared what CI builds against what a release attaches, and the two drifted in the direction that is invisible from a green tree.

What this does

A package-linux job between build and docker-build-push, building both formats for amd64 and arm64, and publish now waits on it. The waiting matters more than it looks: without it a packaging failure publishes the release anyway, missing the packages, and a release page that looks finished is harder to notice than one that failed.

The job also reads the version back out of a built package with `dpkg-deb --field`, which closes the gap nfpm.yaml's own comment names — the tag was checked against the version constant, and the constant against nfpm.yaml, and nothing checked either against what nfpm actually wrote. That is not cosmetic: `apt-get install --only-upgrade` and `dnf update` decide whether to act by comparing versions, so a package declaring a version it does not contain is an upgrade that silently does not happen.

The read-back's first draft was wrong, and running make package-linux rather than reasoning about the filename is what caught it. nfpm writes the release suffix into both the name and the field — objectfs_0.13.0-1_amd64.deb, Version: 0.13.0-1, because nfpm.yaml pins release: '1' — so the version without the -1 would have failed the first release it was added to protect.

The gate

internal/config/release_packages_test.go couples the two workflows the way release_platforms_test.go does for #198: a package format ci.yml builds is one release.yml ships.

Two of its checks initially survived mutation, for a reason this project has now hit three times: a `strings.Contains` over a whole file is satisfied by prose about the thing. Deleting the `run: make package-linux` step still passed, because the comment above the job explains what that target builds. Removing the .deb and .rpm upload paths still passed, because a comment and the summary step both name them.

Full-line comments are now stripped and the upload assertion is scoped to one named step. All eight mutations are caught:

mutation
R1 no-package-build CAUGHT
R2 built-not-attached CAUGHT
R2b deb-only-dropped CAUGHT
R2c step-renamed CAUGHT
R3 publish-does-not-wait CAUGHT
R4 no-version-readback CAUGHT
R5 missing-release-suffix CAUGHT
R6 job-renamed CAUGHT

R2b and R2c are the ones worth noting: a deb-only deletion hiding behind the rpm, and a renamed step — which the jobStep/needsList helpers t.Fatalf on rather than passing for the wrong reason.

Verification

  • `make package-linux` locally → objectfs_0.13.0-1_amd64.deb, objectfs_0.13.0-1_arm64.deb, objectfs-0.13.0-1.x86_64.rpm, objectfs-0.13.0-1.aarch64.rpm
  • `dpkg-deb --field ... Version` → 0.13.0-1, confirmed in a debian:12 container
  • go test -race ./... — clean
  • Coverage gate under CI's exact command — 35 packages at or above floor
  • The gates pass in a linux/amd64 golang:1.26-alpine container
  • go build, gofmt -l ., go vet, golangci-lint run — 0 issues
  • release.yml parses: 5 jobs, publish needs all four

Not in this PR

#138 also specifies an install script and apt/yum repositories. Those are parts (b) and (c), and (c) has no host: objectfs.io and packages.objectfs.io both resolve to Porkbun parking IPs and neither completes a TLS handshake. That needs a hosting decision (stand up packages.objectfs.io, use Cloudsmith/Fury/a Pages apt-yum repo/COPR/OBS, or skip repositories), not code. Measurements and a recommended split are on #138.

Closes nothing — #138 stays open for (b) and (c).

nfpm.yaml has worked for several releases and ci.yml's packaging job builds
both formats on every PR, installs the deb, runs the postinstall scriptlet
and loads the modulefile under Lmod. release.yml had zero references to
package-linux, nfpm, .deb or .rpm, so every published release is ten assets:
five tarballs and five checksums.

    $ gh release view v0.13.0 --json assets --jq '[.assets[].name] | length'
    10

Same for v0.12.0 and v0.11.0. A package CI proves installable and no user
can obtain is scripts/preremove.sh before #207 -- working code with nothing
invoking it. The structural cause is #198's: make package-linux was
exercised only by a job that cannot publish, so nothing compared what CI
builds against what a release attaches.

A package-linux job now builds amd64 and arm64 packages, and publish waits
on it -- without that, a packaging failure publishes the release anyway and
a release page that looks finished is harder to notice than one that failed.
The job reads the version back out of a built package with `dpkg-deb
--field`, closing the gap nfpm.yaml's own comment names: the tag was checked
against the version constant and the constant against nfpm.yaml, and nothing
checked either against what nfpm wrote. apt-get install --only-upgrade and
dnf update decide whether to act by comparing versions, so a package
declaring a version it does not contain is an upgrade that silently does not
happen.

That read-back's first draft was wrong and running the target rather than
reasoning about the filename caught it: nfpm writes the release suffix into
both the name and the field (objectfs_0.13.0-1_amd64.deb, Version 0.13.0-1,
because nfpm.yaml pins release: '1'), so the bare version would have failed
the first release it was added to protect.

internal/config/release_packages_test.go couples the two workflows the way
release_platforms_test.go does for #198. Two of its checks initially
survived mutation, for the reason this project has now hit three times: a
strings.Contains over a whole file is satisfied by prose about the thing.
Deleting the `run: make package-linux` step passed because the comment above
the job explains what that target builds; removing the .deb and .rpm upload
paths passed because a comment and the summary step name them. Full-line
comments are now stripped and the upload assertion is scoped to one named
step, after which all eight mutations are caught -- including a deb-only
deletion hiding behind the rpm, and a renamed step, which the helpers
t.Fatalf on rather than passing for the wrong reason.

This is part (a) of #138. Parts (b) install.sh and (c) the apt/yum
repository setup are deliberately absent; (c) has no host, since
objectfs.io and packages.objectfs.io are both registrar parking pages that
do not complete a TLS handshake.
@scttfrdmn
scttfrdmn merged commit cbb73d0 into main Aug 9, 2026
39 checks passed
@scttfrdmn
scttfrdmn deleted the feat/138a-release-packages branch August 9, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant