Skip to content

[CTX-1481] fix(release): repair 0.0.27 APT and Copr channels - #2579

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-1481/fix-release-channels
Oct 23, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-1481/fix-release-channels

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: packaging | Labels: fix, P1, area:packaging | Milestone: v0.0.28 | RFC: - | Task: CTX-1481

Closes #2578

What failed in 0.0.27

  • APT: APT_GPG_PRIVATE_KEY is non-empty but provisioned base64-encoded and/or with literal \n escapes; echo "$KEY" | gpg --batch --import failed with gpg: no valid OpenPGP data found.
  • Copr: Ubuntu 24.04 has no copr-cli apt package (E: Unable to locate package copr-cli).

The tag v0.0.27 is not moved or re-pointed by this change.

Changes

APT key import

New scripts/import-apt-gpg-key.sh reads the secret from an environment variable, keeps it out of logs, and tries, in order:

  1. the value as supplied;
  2. literal \n escapes converted to real newlines;
  3. CRLF normalized;
  4. whitespace-stripped base64 decoded to a file (armored or binary payload, NUL-safe).

After a successful parse it lists secret keys and requires the pinned fingerprint BCB87D7B489A64168080D900DF4751B6EA711CB8. A wrong key, public-only material, or unparseable input fails with an explicit error. release.yml imports into a private per-run $RUNNER_TEMP/apt-gnupg and only then runs the generator/signing step.

Copr CLI

release.yml now creates a Python venv at $RUNNER_TEMP/copr-cli, upgrades pip, installs copr-cli, exports its bin on PATH, and prints copr-cli --version. The apt install is gone.

Emergency repair workflow

.github/workflows/repair-release-channels.yml is workflow_dispatch only:

  • tag (default v0.0.27, validated as stable vX.Y.Z, release must exist and not be draft/prerelease);
  • channels = all, apt, or copr;
  • environment: release, workflow-level permissions: contents: read.

APT leg: checks out the tag plus repair tooling from the default branch, downloads *.deb + SHA256SUMS with gh release download, requires the checksum file to list exactly the downloaded .deb set and verifies every checksum, imports the key through the same helper, runs generate-apt-repo.py, gpgv-verifies InRelease/Release.gpg, uploads to bitty/apt/..., and compares the read-back Release, InRelease, and Release.gpg byte-for-byte.

Copr leg: downloads *.rpm + SHA256SUMS, applies the same exact-set checksum verification, installs copr-cli in a venv, and uploads x86_64/aarch64 RPMs to the configured project's enabled chroots.

Nix leg (only for channels=all): adopts flake.lock from the default branch only when it differs, is newer than the tag's lock, parses as a v7 lock graph, and passes nix flake metadata; otherwise it skips with a notice. A build runs only after adoption.

The workflow never runs git tag/git push or creates/edits/uploads/deletes release assets; a static test enforces that.

Tests

  • scripts/tests/import-apt-gpg-key.test.sh — hermetic throwaway-key coverage: armored, base64, escaped-newline, base64-of-binary, wrong fingerprint, public-only, unparseable, empty. Also asserts no key material is printed.
  • scripts/tests/check-release-channels.test.sh — static release/repair workflow regressions, including that the importer, release workflow, and repair workflow all pin the committed keyring fingerprint.
  • Wired into .github/workflows/ci.yml, the release validate job, and just check.
  • actionlint clean; act -n dry-runs pass for release.yml (tag push) and repair-release-channels.yml (all and apt).
  • End-to-end APT path exercised with the real v0.0.27 .deb assets and a throwaway key: checksum verification, import, generation, and gpgv all pass.
  • just markdownlint, just ci-local-test, just workflow-publish-test, just status-drift-test, just scratch-paths-test, and the existing APT/Nix/release/AUR/manifest/distro packaging tests pass.
  • gitleaks detect --log-opts origin/main..HEAD clean; the public archive-key fingerprint is allowlisted as a non-secret identifier.
  • just ci-local cannot go green on this host: the pre-existing bitty-runtime::spawn_surface::granted_production_backend_runs_confined_git fails with E_SPAWN_FAILED when run on the host kernel as well (this PR changes no Rust code). Remote Quality gates is the acceptance gate.

Not done

No merge, tag, release edit, or channel publish from this PR. Applying the repairs to v0.0.27 requires dispatching the new workflow after merge (see packaging/README.md). The branch is based on the current origin/main (c6a53a23, the named 07f7c682 plus the FreeBSD packaging commit); v0.0.27 still targets 07f7c682.

The 0.0.27 release run failed the APT job with "no valid OpenPGP data
found" because the secret is provisioned as base64 and/or with literal
\n escapes, while the workflow piped it straight into gpg --import. It
also failed the Copr job because Ubuntu 24.04 has no copr-cli package.

- Add scripts/import-apt-gpg-key.sh: accepts armored, base64, escaped
  newline, and CRLF forms; retries parses; verifies the pinned secret-key
  fingerprint BCB87D7B489A64168080D900DF4751B6EA711CB8; fails closed and
  never prints key material. Import into a private per-run GNUPGHOME.
- Install copr-cli in a Python venv under RUNNER_TEMP, put its bin on
  PATH, and print copr-cli --version instead of apt-get install.
- Add workflow_dispatch repair-release-channels.yml for published tags:
  tag input (default v0.0.27), channels all|apt|copr; verifies release
  SHA256SUMS, republishes APT to bitty/apt with read-back comparison,
  uploads RPMs to Copr, and optionally adopts a newer validated flake.lock
  from the default branch. Read-only repository permissions; never moves
  the tag or mutates release assets.
- Add hermetic importer tests and static workflow regressions; wire both
  into CI, the release validation job, and just check. Document the
  repair runbook and channel behavior.
@Xuepoo Xuepoo added this to the v0.0.28 milestone Oct 23, 2026
@Xuepoo Xuepoo added fix Bug fix P1 Priority: high area:packaging labels Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb2e3125-96bc-45b6-b33c-dee5502d3743
📥 Commits

Reviewing files that changed from the base of the PR and between c6a53a2 and 531763f.

📒 Files selected for processing: 12
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .github/workflows/repair-release-channels.yml
  • .gitleaks.toml
  • justfile
  • packaging/README.md
  • packaging/alpine.md
  • packaging/debian.md
  • packaging/fedora.md
  • scripts/import-apt-gpg-key.sh
  • scripts/tests/check-release-channels.test.sh
  • scripts/tests/import-apt-gpg-key.test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… sets

- Decode base64 key material to a file so binary OpenPGP exports survive
  NUL bytes; add hermetic base64-of-binary coverage.
- Require SHA256SUMS to list exactly the downloaded .deb/.rpm set in the
  repair workflow instead of verifying only the names that were seen.
- Point failed channel summaries at the emergency repair workflow.
@Xuepoo
Xuepoo merged commit 51ac2a5 into main Oct 23, 2026
31 of 33 checks passed
@Xuepoo
Xuepoo deleted the ctx-1481/fix-release-channels branch October 23, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:packaging fix Bug fix P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[0.0.28] fix(release): repair 0.0.27 APT and Copr channels; add emergency repair workflow

1 participant