Build tdigest for Ubuntu 20.04 (focal) — PG11–16 pipeline - #1239
Buket (aybuket) wants to merge 5 commits into
Conversation
Rebuild tdigest .deb packages for Ubuntu 20.04 (focal) from upstream source, mirroring the focal PostGIS pipeline. PGDG dropped focal (focal-pgdg 404s, frozen archive stops at tdigest 1.4.3), so newer tdigest (default 1.4.5, memory-safety fixes) is rebuilt from upstream source + the frozen focal-era debian/ packaging. One multi-version source build emits postgresql-<major>-tdigest for PG12-16, signed via the debsigner image and smoke-tested in a stock ubuntu:20.04.
494e14a to
439675c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Some advertised dispatch inputs fail because of a source-directory collision and unsupported PostgreSQL majors.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Builds, signs, and smoke-tests tdigest 1.4.6 packages for PostgreSQL 11–16 on Ubuntu 20.04.
Changes:
- Adds a focal builder using archived PGDG packaging.
- Adds package signing and validation workflow.
- Tests clean installation and upgrades from tdigest 1.4.3.
File summaries
| File | Description |
|---|---|
scripts/build_tdigest_focal |
Builds multi-version tdigest packages. |
scripts/smoke_test_focal_tdigest_debs |
Tests installation and upgrades. |
dockerfiles/focal-tdigest-builder/Dockerfile |
Defines the focal build environment. |
.github/workflows/build-tdigest-focal.yml |
Orchestrates build, signing, and testing. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Resolve the upstream release and checksum once per workflow, and discover archived packaging and upgrade baselines through APT. Validate PG11-16 inputs, isolate packaging sources, require matching DWARF symbol packages, and strengthen clean-install and upgrade checks.
There was a problem hiding this comment.
🟡 Changes recommended
Historical rebuild handling and automatic patch removal can produce unusable or incomplete packages.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
scripts/build_tdigest_focal:66
- The fresh workspace does not prevent stale files in the persistent
OUTPUT_DIR. Reusing the documented/packagesvolume after building another version or set of majors leaves extra.debfiles that the signing, upload, verification, and smoke-test globs will include. Remove the previous tdigest artifacts before collecting this invocation's output.
dockerfiles/focal-tdigest-builder/Dockerfile:62
- This line does not enforce the
debhelper >= 13requirement stated above it:dpkg-queryonly prints installed versions and succeeds for any installeddebhelper. Make the image check compare the installed version so an incompatible archive/toolchain fails at this intended guard rather than later during package dependency resolution.
RUN dpkg-query -W -f='${Package} ${Version}\n' debhelper postgresql-common-dev dh-exec
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Balanced
Apply the full Debian patch series and enforce debhelper >= 13. Stage and validate artifacts before replacing previous tdigest output. Derive upgradeable revisions for same-upstream rebuilds and select compatible archived runtime/dbgsym baselines without attempting extension downgrades.
What and why
PGDG no longer publishes packages for Ubuntu 20.04 (
focal-pgdgreturns 404), and its archive is frozen. This pipeline rebuilds the latest stable upstream tdigest release for PostgreSQL 11–16, including matching debug-symbol packages, using the archived focal Debian packaging and build tooling.Release and packaging discovery
tdigest_versiondefaults tolatest. The workflow resolves GitHub's latest stable release once and passes the resolved version, source URL, archive format, and SHA-256 into the builder. The smoke-test job uses that same resolved version.debian/. Upgrade-test baselines are discovered from APT separately for each PostgreSQL major, before installing the newly built packages.tdigest-source.envalongside the artifacts.Implementation
dockerfiles/focal-tdigest-builder/Dockerfilescripts/resolve_tdigest_focalscripts/build_tdigest_focalscripts/smoke_test_focal_tdigest_debs.github/workflows/build-tdigest-focal.ymlOne multi-version PGXS source build covers all requested majors. The builder writes
debian/pgversionsand regeneratesdebian/controlwithpg_buildext updatecontrol, so only the requested packages are declared and built. The default is 11 12 13 14 15 16; values outside that range are rejected before the build.Each major produces:
postgresql-<major>-tdigest, containing its own library, extension control file, and SQL upgrade chain.postgresql-<major>-tdigest-dbgsym, containing matching debug information.The build enables debug information and requires exactly one debug-symbol package per major. Ubuntu
.ddebartifacts are renamed to.debso runtime and symbol packages follow the same signing and artifact-upload path.Archived packaging and upstream source are extracted into separate directories within a fresh build workspace. This fixes the source-directory collision when rebuilding the same upstream version as the archived packaging. Explicit historical rebuilds also handle Debian changelog version ordering.
Verification performed by the pipeline
.debwith the existing debsigner image and require an embedded_gpgmaintsignature.extversion, and execute a percentile aggregate on every major.ALTER EXTENSION tdigest UPDATE, and repeat version and aggregate checks.run_tests=1runs the upstream regression suite through the multi-version packaging build.Local validation
Tested using Podman with Ubuntu 20.04 containers:
git diff --check.Package signing was not exercised locally; it requires the repository's GitHub Actions secrets.
Workflow inputs
tdigest_versionlatestlatestdiscovers the latest stable release; an explicit version selects that releasepg_versions11 12 13 14 15 16tdigest_sha256run_tests01to run upstream regression testsThe workflow supports manual dispatch and runs on pushes to
tdigest-focal. The package revision defaults to1.citus20.04+1; the upstream part of the package version comes from release discovery.