From 51f6b6c76c1eb81c9835b83661a5fc4b513d482d Mon Sep 17 00:00:00 2001 From: Peter Amiri Date: Fri, 19 Jun 2026 12:27:28 -0700 Subject: [PATCH] fix: scope apt regen to dispatched channel to stop cross-channel index clobber MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish workflow syncs only pool// from R2, but regenerate-apt-metadata.sh hardcoded DISTRIBUTIONS="stable bleeding-edge" and regenerated BOTH channels every run. The non-dispatched channel had an empty local pool, so apt-ftparchive emitted an empty Packages, and the upload step's `find dists` pushed that empty index to R2 — clobbering the other channel's good index. In practice every bleeding-edge snapshot publish wiped the stable index minutes after each stable release (the .deb stays in the R2 pool; only the dists Packages index dies). This is the root cause of #3218 (a recurrence of #2838). The per-channel regen that #2838 was meant to introduce was absent from the live script. Fix: regen reads CHANNELS (default both, for manual full rebuilds when both pools are present locally); the workflow passes CHANNELS= so a publish touches only its own channel's dists. The other channel's R2 index is left untouched. Refs: wheels-dev/wheels#3218, wheels-dev/wheels#2838 Co-Authored-By: Claude Opus 4.8 Signed-off-by: Peter Amiri --- .github/workflows/wheels-released.yml | 5 +++++ scripts/regenerate-apt-metadata.sh | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels-released.yml b/.github/workflows/wheels-released.yml index 5cb0992..408d3ed 100644 --- a/.github/workflows/wheels-released.yml +++ b/.github/workflows/wheels-released.yml @@ -199,6 +199,11 @@ jobs: env: GPG_PASSPHRASE: ${{ secrets.WHEELS_REPO_GPG_PASSPHRASE }} GPG_KEY_ID: ${{ env.GPG_KEY_ID }} + # Scope regen to the dispatched channel only. The sync step above pulls + # just pool// from R2, so regenerating the OTHER channel would + # scan an empty local pool and clobber its R2 index on upload + # (#3218 / #2838). The other channel's dists are left untouched. + CHANNELS: ${{ steps.inputs.outputs.channel }} run: | set -euo pipefail chmod +x scripts/regenerate-apt-metadata.sh diff --git a/scripts/regenerate-apt-metadata.sh b/scripts/regenerate-apt-metadata.sh index b506cd3..31093ad 100755 --- a/scripts/regenerate-apt-metadata.sh +++ b/scripts/regenerate-apt-metadata.sh @@ -20,7 +20,17 @@ fi ARCHITECTURES="amd64 arm64" COMPONENTS="main" -DISTRIBUTIONS="stable bleeding-edge" +# Per-channel regen (CHANNELS env), default = both for manual full rebuilds. +# +# CRITICAL (#3218, recurrence of #2838): the publish workflow only syncs +# pool// from R2, so any channel NOT being published has an +# empty local pool here. Regenerating it would emit an empty Packages, and the +# upload step's `find dists` would then clobber that channel's good R2 index. +# A bleeding-edge snapshot publish was wiping the stable index minutes after +# every stable release. Scoping to the dispatched channel keeps the other +# channel's R2 dists untouched. The workflow passes CHANNELS=; a bare +# manual run still rebuilds both (only safe when both pools are present locally). +DISTRIBUTIONS="${CHANNELS:-stable bleeding-edge}" # apt-ftparchive uses a config file to know where the pool lives. The same # config drives both distributions — only the dist-name and the scan path