Skip to content

Publish Redis to self-hosted pacman repositories through release automation - #1

Merged
Peter-Sh merged 19 commits into
masterfrom
release-automation
Nov 19, 2026
Merged

Peter-Sh merged 19 commits into
masterfrom
release-automation

Conversation

@Peter-Sh

@Peter-Sh Peter-Sh commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

Arch users can only get Redis 8 with its modules by building this recipe themselves. Redis already ships apt, rpm, snap, and Docker builds through the release automation. This PR adds Arch to that process: a release tag produces a signed package in a Redis-owned pacman repository, with the same inputs and notifications as the other packages.

The workflows follow redis-debian and redis-rpm where pacman allows it. The sections below explain the places where Arch needs something different.

Two repositories, chosen by release_type

  • public publishes to [redis] at packages.redis.io/arch.
  • internal publishes to [redis-testing] in the staging bucket.

pacman upgrades every user of a repository to the newest pkgver, and it has no notion of a pre-release. A release candidate in [redis] would reach production machines on the next pacman -Syu. So a public release of a tag that is not GA is refused, and release candidates, milestones, and internal builds go to [redis-testing].

Each repository has its own signing key and its own S3 settings. Any branch can publish a test build, so the staging key must not be the key that production users trust.

Versions

pkgver is the release tag with the hyphens removed: 8.12-rc2 becomes 8.12rc2. pacman does not allow a hyphen in pkgver. The obvious replacement, an underscore, sorts wrong: vercmp ranks the internal build 8.12_rc1_int above the 8.12_rc1 that follows it. Without a separator the order is correct for every tag form in use: 8.12m01int < 8.12rc1int < 8.12rc1 < 8.12.0.

The version lives only in PKGBUILD and .SRCINFO. A separate version file would be a second source of truth that can drift from the recipe.

Publishing

pacman clients cache packages by file name and upgrade only when the version grows. A package replaced under the same name gives existing users a checksum error and no upgrade. So public refuses a file name that already exists, and a rebuild of the same Redis version needs a pkgrel bump. internal may overwrite, because test builds are rebuilt often.

The index is uploaded after the packages, so it never lists a file that is not there yet. Publishes to one repository run one at a time, because repo-add rewrites the whole database.

Builds run without network access

The recipe claims that build(), check(), and package() need no network. Until now that was checked once by hand. CI now enforces it: makepkg --nobuild fetches sources and runs prepare(), the container is disconnected from the network, and makepkg --noextract does the rest. A Redis release that adds a download to its build fails here, before it reaches users or a reviewer of an extra package.

Dependency pins fail loudly

Search downloads seven dependencies with CMake. The recipe supplies them as sources so the build can run offline. Two things can go wrong without anyone noticing: Redis moves to a new dependency version, or an upstream tarball changes under the same name.

  • check-pinned-deps.sh compares each pinned version with the version the Redis source declares.
  • The version update refreshes only the checksum of the Redis archive. updpkgsums would refresh all of them and accept a changed dependency tarball without a word. A changed tarball must stop the release so that a person looks at it.

Tags without a release archive

Milestone and internal tags have no redis-full asset. For those the source is built with upstream's make tarball, which produces the same layout. The result is not byte-reproducible, so the build job receives it as an artifact from the job that recorded its checksum.

Other changes

  • namcap errors fail the build. namcap always exits 0, so the script reads its report. The -debug package is skipped: its build-id links point into the main package and are reported as dangling.
  • Module loading uses the standard redis.conf. The packaged configuration carries upstream's loadmodule lines. This is the convention the team agreed on. If a modified redis.conf is kept on upgrade and loads no modules, the install script says how to merge them from redis.conf.pacnew.
  • Smoke test on a real install. A second job installs the built package in a clean container with pacman and checks that the packaged configuration alone loads all four modules.
  • Packager is set, so users can see where the package comes from.

Not in this PR

  • The key URL and fingerprint in the README are placeholders until the keys are published.
  • No public release has run yet. The internal path has: 8.12rc2-3 was published to [redis-testing] and installed from it with signature verification.
  • A rebuild of an already released version (pkgrel bump) has not been tested through tagging.
  • Nightly builds from unstable are planned separately.
  • The automation side is a separate PR in redis-oss-release-automation.

The script points PKGBUILD at a release tag inside an archlinux:base-devel
container: pkgver, _tag, pkgrel (reset only when pkgver changes), checksums
and .SRCINFO. Running it twice for the same tag leaves the tree unchanged,
so the action commits nothing.
pkgver cannot be mapped back to the tag for milestone and internal
releases, so _tag now holds the literal tag that the release automation
writes.
build-n-test.yml is reusable: with a release tag it builds the automation
branch, without one it builds the PKGBUILD as committed. makepkg runs in
archlinux:base-devel, then a fresh archlinux:base container installs the
package and runs redis-smoke-test.sh against the installed files.
Pull requests to master run it without a tag.
release-channel.sh holds the one table from release_type to pacman
repository, S3 location, URL and environment, and rejects public runs of
non-GA tags. release_build_and_test.yml validates the inputs, prepares the
automation/<tag> branch, builds and tests it, and leaves a release_handle
artifact for the publish workflow.

Build failures are posted to Slack with SLACK_BOT_TOKEN: public runs to
the announcement channel (vars.SLACK_CHANNEL_ID) with a link back to the
requesting thread, internal runs to the requested channel and thread.
upload-packages signs each package with a detached .sig, adds it to the
channel's pacman database with repo-add in an Arch container, and uploads
packages first and the database last. The database is also stored under
its symlink names, since S3 has none. Public publishes refuse to replace
an existing package file. release_publish.yml serializes publishes per
release type and merges automation/<tag> back and tags v<tag> for public
releases.

The success message follows the same Slack routing, and its timestamp,
channel and URL go into the release_info artifact.
The key URL and fingerprint are placeholders until the signing key is
published.
…ished

[redis-testing] holds whatever was published last, so repo-add must not
skip an older package. The production GPG key signs both repositories so
users trust one key.
Milestone and internal tags (8.12-m02-int) publish no
redis-full-<tag>.tar.gz, so the PKGBUILD's first source cannot be
downloaded. fetch-redis-source.sh checks for the asset and, on a 404,
builds it with upstream's `make tarball` from a clone of the tag, next
to the PKGBUILD. makepkg uses a source file already present there
instead of downloading it, so the PKGBUILD stays unchanged.

The prepare job uploads the file as the redis-source artifact and the
build job downloads it, so the build hashes the same file whose
checksum was committed. A tag with the asset uploads nothing, and the
download matches nothing without failing.
…ource

update-redis-version.sh no longer runs updpkgsums. It hashes the Redis
archive (the local file from fetch-redis-source.sh, or the release
asset) and replaces only the first sha512sums entry. The dependency
sums stay as committed, so a dependency tarball that changes upstream
fails makepkg instead of being re-hashed into the PKGBUILD.

check-pinned-deps.sh compares each pinned dependency version with the
cmake file that declares it in the extracted Redis archive and fails,
naming the variable, on a mismatch or when the file or version is
missing. Versions are never bumped automatically.
This is a result of internal discussion
@Peter-Sh Peter-Sh changed the title Use self-hosted repositories and align with release-automation Publish Redis to self-hosted pacman repositories through release automation Nov 17, 2026
@Peter-Sh

Copy link
Copy Markdown
Contributor Author

cursor review

@cursor

cursor Bot commented Nov 18, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@Peter-Sh
Peter-Sh merged commit 5dfc309 into master Nov 19, 2026
3 checks passed
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