Repository navigation
Publish Redis to self-hosted pacman repositories through release automation - #1
Merged
Merged
Conversation
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
Contributor
Author
|
cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-debianandredis-rpmwhere pacman allows it. The sections below explain the places where Arch needs something different.Two repositories, chosen by
release_typepublicpublishes to[redis]atpackages.redis.io/arch.internalpublishes 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 nextpacman -Syu. So apublicrelease 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
pkgveris the release tag with the hyphens removed:8.12-rc2becomes8.12rc2. pacman does not allow a hyphen inpkgver. The obvious replacement, an underscore, sorts wrong:vercmpranks the internal build8.12_rc1_intabove the8.12_rc1that 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
PKGBUILDand.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
publicrefuses a file name that already exists, and a rebuild of the same Redis version needs apkgrelbump.internalmay 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-addrewrites the whole database.Builds run without network access
The recipe claims that
build(),check(), andpackage()need no network. Until now that was checked once by hand. CI now enforces it:makepkg --nobuildfetches sources and runsprepare(), the container is disconnected from the network, andmakepkg --noextractdoes the rest. A Redis release that adds a download to its build fails here, before it reaches users or a reviewer of anextrapackage.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.shcompares each pinned version with the version the Redis source declares.updpkgsumswould 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-fullasset. For those the source is built with upstream'smake 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
-debugpackage is skipped: its build-id links point into the main package and are reported as dangling.redis.conf. The packaged configuration carries upstream'sloadmodulelines. This is the convention the team agreed on. If a modifiedredis.confis kept on upgrade and loads no modules, the install script says how to merge them fromredis.conf.pacnew.Packageris set, so users can see where the package comes from.Not in this PR
publicrelease has run yet. Theinternalpath has:8.12rc2-3was published to[redis-testing]and installed from it with signature verification.pkgrelbump) has not been tested through tagging.unstableare planned separately.redis-oss-release-automation.