Repository navigation
feat(apt): build and publish the signed APT repository from mmt-dpi Releases (#2) - #5
Conversation
…#2) Fetch the last 2 mmt-dpi Releases and verify SHA256SUMS and every .deb against SHA256SUMS and their build-provenance attestations; build one pool per suite with apt-ftparchive, reproducibly; sign with subkey A from stdin in a throwaway GNUPGHOME; verify with gpgv against the committed keyring alone; test the signing path with a throwaway key; smoke-install mmt-dpi in containers.
…#2) One workflow deploys Pages, so a site-only deploy can no longer erase dists/ and pool/. Runs on repository_dispatch, workflow_dispatch, pushes to main and pull requests; without the signing key it is an unsigned dry run that never deploys.
- verify-repo: fail on EXPKEYSIG/REVKEYSIG/EXPSIG/BADSIG/ERRSIG/NO_PUBKEY (gpgv exits 0 for an expired key), require one GOODSIG and VALIDSIG, and refuse an empty --expect-signer. - fetch-releases: the canonical names in the attested SHA256SUMS must equal the release's canonical assets; fail clearly if listing fails. - build-repo: a suite without packages fails the build. - Concurrency: only main runs use the pages group. - test-signing: primary never expires; add an expired-keyring negative. - smoke: expect the newest mmt-dpi of the container's own suite. - Pass only whether the secrets are set to the detect step; unset the key in sign-repo.
Review of PR #5: build and publish the signed APT repository (#2)Verdict: WARN The PR is safe to merge. Nothing blocks it, every acceptance criterion of #2 is met, and every security property I tested holds. The WARN covers three things:
Reviewed head: What I ran (scratch dirs outside the repo, throwaway keys only)Host: Ubuntu 24.04 arm64, gh 2.87.3, apt 2.8.3, GnuPG 2.4.4, Docker. Containers used apt 3.0.3 (debian:13) and apt 2.8.3 (ubuntu:24.04).
Focus area 1: fail-closed inputs (fault injection)I ran
No failed run wrote Focus area 3: signing (my own throwaway-key tests, independent of
|
| Case | Raw gpgv |
verify-repo.sh / sign-repo.sh |
|---|---|---|
CI path: secret on stdin, --local-user A! |
— | ✅ 5 InRelease and 5 armoured Release.gpg files; passphrase and key absent from all output; throwaway GNUPGHOME removed |
| expired subkey (signed while valid) | exit 0, EXPKEYSIG |
✅ rejected: gpgv reported EXPKEYSIG |
| revoked subkey (A revoked in the keyring) | exit 0, REVKEYSIG |
✅ rejected: gpgv reported REVKEYSIG |
sign-repo.sh with the revoked keyring |
— | ✅ refuses to sign |
sign-repo.sh with an expired, unrenewed subkey |
— | ✅ refuses to sign |
signed by subkey B, --expect-signer A |
GOODSIG | ✅ rejected |
empty --expect-signer |
— | ✅ rejected |
| InRelease body tampered (BADSIG) | exit 1 | ✅ rejected |
| Packages tampered after signing | — | ✅ rejected (size or hash) |
| keyring without the signer (NO_PUBKEY) | exit 2 | ✅ rejected |
| Release.gpg with an extra unknown-key signature | exit 2 | ✅ rejected |
| Release.gpg missing | — | ✅ rejected |
detect-signing.sh, every partial combination |
— | ✅ exit 1; all set gives signed, none set gives dry-run |
The implementer's fix is correct: gpgv exits 0 for EXPKEYSIG and REVKEYSIG, and verify-repo.sh catches both.
Workflow review:
signruns only whengithub.event_name != 'pull_request' && github.ref == 'refs/heads/main', inapt-signing, whose branch policy ismainonly.- The detect step receives only booleans (
secrets.X != ''). - The key reaches the script through the
printfbuiltin on stdin, and the passphrase through fd 3. set -xappears nowhere, and no step echoes its environment.- The committed keyring is imported before the secret.
deployrunsgpgvagain on the full tree, with--expect-signer.
Focus area 4: deploy and concurrency
- Folding pages.yml in is right. A second deployer would replace the whole site and erase
dists/andpool/.build-repo.shcopiessite/(soindex.htmlnow, and the keyring once committed) into every tree, and refuses asite/that containsdists/orpool/(tested). - The live site after merge:
pages.ymlis deleted in the merge commit, so the merge push does not run it.apt-repo.ymlruns on that push in dry-run mode, anddeployrequiresmode == 'signed'. The current placeholder (Not Yet Live, last modified 2026-11-11 17:47 GMT) stays up and is not wiped. Edits tosite/are not published until the key exists (stated in the README). - Concurrency: the
pagesgroup applies only to non-PR runs onrefs/heads/main. It is set at workflow level, so build, sign, deploy and smoke run strictly one run at a time. Two main runs cannot race. A pending run can be replaced by a newer one, which is harmless because every run lists the releases again. PR runs and runs on other branches getapt-repo-<ref>, and PR runs cancel their older runs. - A PR cannot deploy:
signis skipped on PRs,deploydepends onsign's output, and both environments allowmainonly.
Focus area 5: triggers
repository_dispatch mmt-dpi-release, workflow_dispatch, a push to main with path filters, and pull_request with no secrets. There is no pull_request_target. client_payload.tag is passed only through env: and only echoed; the releases are always listed again. No ${{ }} appears inside any run:.
Focus area 6: reproducibility, and Date moving backwards (tested with apt over HTTP)
- A tree with the same Date but changed indexes is accepted, and the new Packages are fetched.
- A tree with an older Date is downloaded, and then silently discarded.
apt-get updateexits 0 with no warning, and the client keeps the newer cached indexes. Same result on apt 2.8.3 and apt 3.0.3.
So apt does not reject the older Date with an error, but it does not use the new tree either (see finding 3).
Focus area 7: smoke tests
Trusted: yes(the deb822 form of[trusted=yes]) is set only when there is no keyring. It is reachable only through--tree, from the build job's dry-run steps, and prints a banner.--urlrequires--keyring. The live smoke uses deb822 withSigned-By, and checks first that the served keyring is byte-equal to the committed one.
Focus areas 8–10: supply chain, docs, PR body
- Every job sets its own permissions;
pages: writeandid-token: writeare set only indeploy. Every checkout setspersist-credentials: false. No tool is downloaded inapt-repo.yml, and ci.yml's checksums are unchanged. - README and AGENTS.md match the behaviour, and the dry-run status is stated at the top of the README.
- The PR body is accurate, except for one claim (finding 3).
Findings
-
[test-coverage, medium] The negative test for the expired subkey never reaches the EXPKEYSIG check.
scripts/test-signing.sh:73- The test exports its stale keyring with
--export-options export-minimalwhile subkey A is expired. GnuPG 2.4 then drops the expired subkey: the stale keyring holds only the primary key and subkey B. - As a result,
verify-repo.shfails with NO_PUBKEY (gpgv exit 2) instead of EXPKEYSIG. - Mutation test: with the
EXPKEYSIG|REVKEYSIG|…check deleted fromverify-repo.sh,test-signing.shstill exits 0 and still prints "keyring where the signing subkey has expired: rejected (apt would refuse it)". CI therefore does not protect the PR's most serious fix. - The production code is still safe twice over: when I removed the status check, the "exactly one GOODSIG" check still rejected my real expired-subkey tree.
- There is no revoked-subkey case at all.
- Fix:
- export the stale keyring without
export-minimal, and assert thatEXPKEYSIGappears in the error; - add a case where subkey A is revoked and assert that
REVKEYSIGappears; - stop discarding stderr (
2>/dev/null), so each negative check asserts why it failed.
- export the stale keyring without
- The test exports its stale keyring with
-
[ci, medium]
Build unsigned tree and test itcannot be required as the workflow stands..github/workflows/apt-repo.yml:23-28pull_requesthas apaths:filter. A PR that touches only README, docs or ci.yml never reports this check, so a ruleset that required it would leave such PRs waiting forever.- mmt-dpi met the same problem (#490) and solved it with an always-reporting
packages-gatejob. - Fix: drop the PR
paths:filter, or add achangesjob and an always-reporting gate job.
-
[correctness and docs, low] When the newest release is deleted, existing clients keep stale indexes.
- Measured above: apt silently ignores a Release with an older Date. Clients that ran
apt-get updatebefore the deletion keep the Packages entries for the deleted release.apt-get installof those entries then gets a 404 from the pool, until a release newer than the deleted one is published. New clients are unaffected. - Security is not at risk, since the client fails closed.
- The PR body calls this "a documented edge case", but it is documented only in the PR body. README, AGENTS.md and the scripts say nothing about it.
- Fix: add a line to AGENTS.md ("do not delete or demote a published mmt-dpi release; publish a newer one instead"). Optionally, add a
workflow_dispatchinput that overridesSOURCE_DATE_EPOCH.
- Measured above: apt silently ignores a Release with an older Date. Clients that ran
-
[correctness, low] The live smoke does not check that it sees the new deploy.
- Pages serves with
cache-control: max-age=600. smoke-in-container.shsets an expected version only forfile:/repo.- Against the live URL, the smoke can therefore pass against the previous deploy's cached InRelease. It can also fail on a hash mismatch when the cached InRelease and Packages come from different deploys, which the 5 × 20 s retries might not outlast.
- Fix: before running apt, poll until the served
dists/<suite>/InReleaseequals the one just signed, then require the newest version, as the dry run does.
- Pages serves with
-
[note, out of scope] Signed-By trusts every key in the keyring.
- Signed-By trusts the whole keyring, which also contains subkey B, the mmt-dpi tarball key. So a compromise of B would also let it sign APT metadata.
- This follows
docs/signing-key.md, so it is not a defect of this PR. - apt can narrow trust to a single subkey with
Signed-By: <keyring> <SUBA>!, a possible follow-up for the user docs. - Related:
export-minimal, asdocs/signing-key.mdprescribes, drops any subkey that has already expired. This is harmless while renewal happens before expiry.
Acceptance criteria (#2)
| Criterion | Status |
|---|---|
Triggers; signing only in apt-signing |
✅ |
| Fails before signing unless every file verifies against SHA256SUMS and its attestation | ✅ (9 injected faults, all fail closed) |
dists/<codename>/{Release,InRelease,Release.gpg}, Packages(.gz), a pool per suite |
✅ |
| Secret on stdin into a throwaway GNUPGHOME, never printed; gpgv against the committed keyring alone | ✅ |
apt-get install in Ubuntu 24.04 and Debian 13 against the live URL after deploy |
⚠ written but unexercised until the key exists (finding 4) |
| Unsigned dry run that never deploys | ✅ |
Required checks for the main ruleset after merge
- Keep
lint(workflow CI). - Add
Build unsigned tree and test it(workflow APT repository), only after finding 2 is fixed. Until then, keeplintalone. - Never require
Sign with subkey A,Deploy to GitHub PagesorSmoke test the live repository (…). They are skipped on every PR by design.
Uncertainty
- The signed deploy and the live smoke could not run, because no key exists.
- The cross-repo
GITHUB_TOKENreads succeeded in the PR's CI run 43103428814. - The tamper runs served cached assets through a wrapper; the attestation calls were real.
- Findings 1–4 come from executed tests; finding 5 is a judgement.
- test-signing.sh: export the stale keyring without export-minimal, so it keeps the expired subkey A and verify-repo.sh sees EXPKEYSIG instead of NO_PUBKEY; add a revoked-subkey case (REVKEYSIG); every negative check now asserts its error message instead of discarding stderr. - apt-repo.yml: run on every pull request; a `changes` job decides whether the build runs, and the always-reporting `apt-repo-gate` job is the check to require (the mmt-dpi packages-gate pattern). - Live smoke: wait until Pages serves the InRelease and Packages just signed (bounded, default 900 s), then require the newest mmt-dpi. - AGENTS.md, README: never delete or demote a published mmt-dpi release; apt silently ignores a Release with an older Date.
Re-review at 8002524Verdict: PASS The delta ( Findings 1–5
|
| changes | relevant | build | gate |
|---|---|---|---|
| success | true | success | pass |
| success | false | skipped | pass |
| success | true | failure / cancelled / skipped | fail |
| success | false | success | fail |
| failure / cancelled / skipped | — | skipped | fail |
- The gate fails closed whenever the build fails or is cancelled.
- It runs with
if: always(), so it also runs in a cancelled run and fails there. - If the gate itself is cancelled, the check is not satisfied.
- It has
permissions: {}and a 5-minute timeout.
Path filter. I ran it against throwaway repositories with real --no-ff merge commits:
| Change | build |
|---|---|
| docs only | false |
ci.yml only |
false |
scripts/ |
true |
site/ |
true |
apt-repo.yml |
true |
a file moved out of scripts/ |
true (thanks to --no-renames) |
| any non-PR event | true |
no HEAD^1 |
job exits 128, so the gate fails (fail closed) |
Reports on every PR, including docs-only ones: yes. The workflow has no PR path filter now. A docs-only PR runs only changes and apt-repo-gate, and the gate passes there because the build is skipped.
Unchanged: sign still needs a successful build, and push and dispatch runs always build.
Live-smoke wait loop
I tested it against a local HTTP server on the docker bridge, with the real tree and throwaway signatures:
| Case | Result |
|---|---|
site always stale, SMOKE_FRESH_TIMEOUT=20 |
ERROR: after 20 s, …/InRelease is still not the one just deployed, exit 1 after 30 s |
| stale, then fresh after 20 s | waits 30 s, then OK: mmt-dpi 1.10.2-a84a6050 installed on Debian 13, checked against the newest version in the deployed Packages |
--url without --dists; a non-numeric timeout |
clear error |
- The loop is bounded: the deadline is checked after each attempt, so it can overshoot by at most one 15 s sleep plus one round of requests.
- It is not an infinite loop.
Stray commit and branch
db118b9("c", authort <t@t>) appears only in the local reflog offeat/2-build-apt-repo, before areset: moving to 1d1fa8d.- It is not an ancestor of
80025247, and the PR timeline never had it. - It held the same change plus a trailing
xline in README.md.git diff db118b9 80025247shows that the pushed commit drops thex. At head, README.md and AGENTS.md have no barexline. - There is no branch or ref named
pr, local or remote. The remote has onlymainandfeat/2-build-apt-repo. 80025247is authored by Luong NGUYEN and has no AI trailers; neither does the PR body.- The PR body is updated and accurate for the delta.
Notes (low severity, not blocking)
A. A server that never responds is not bounded.
- Neither
curlinscripts/smoke-install.sh(the keyring download and the wait loop) has--max-time, and thesmokejob has notimeout-minutes. - Against a server that accepts connections and never answers,
smoke-install.shwithSMOKE_FRESH_TIMEOUT=5hung until my outertimeout 60killed it (exit 124). In CI it would run until the 6 h job default. - Suggested fix:
curl --connect-timeout 10 --max-time 60andtimeout-minutes: 30onsmoke.
B. The gate passes with an empty relevant output. apt-repo-gate passes when changes succeeded but wrote no build output, because an empty value falls through to "skipped". The filter always writes the output when it succeeds, so this cannot happen today. Requiring RELEVANT to be true or false would make the gate robust against future edits of the filter.
Required checks for main after merge
lint(workflow CI)apt-repo-gate(workflow APT repository)
Do not require Build unsigned tree and test it, Relevant paths changed?, Sign with subkey A, Deploy to GitHub Pages or Smoke test the live repository (…).
Uncertainty
- The signed deploy and the real Pages smoke still cannot run without the key.
- The docs-only path was verified by simulation, not by a real docs-only PR run.
Closes #2
Summary
.github/workflows/apt-repo.ymlrebuilds the APT repository from scratch from the last 2 published Montimage/mmt-dpi Releases, signs it with subkey A inapt-signing, verifies it withgpgvagainst the committed keyring, and deploys it withsite/to Pages. After the deploy, it runsapt-get install mmt-dpiinubuntu:24.04anddebian:13against the live URL.apt-repo-unsignedartifact, tests signing with a throwaway key, and installs from the tree in containers. It never deploys. Pull requests are always dry runs, so this PR's CI exercises the dry run.scripts/*.sh(bash,set -euo pipefail, shellcheck-clean). The workflow only calls the scripts.pages.ymlis folded in and deleted (see the Decision Record below).Decision Record
Folding pages.yml in. A Pages deploy replaces the whole site. With two deployers, every push to
mainthat touchedsite/would have deployedsite/alone and eraseddists/andpool/. A sharedconcurrencygroup serializes deploys, but it does not stop one deploy from overwriting another. Soapt-repo.ymlis now the only deployer, and it copiessite/into the tree. The push trigger therefore also coverssite/**, in addition toscripts/**and the workflow file. One consequence: until the key exists, an edit tosite/index.htmlis not published, because the dry run never deploys. The live page stays as #1 deployed it.Concurrency. Runs on
main(push, dispatch) useconcurrency: { group: pages, cancel-in-progress: false }at workflow level, not job level. That way build, sign, deploy and smoke run one run at a time and in order. With job-level concurrency, a slower, older build could deploy after a newer one. GitHub keeps only the newest pending run in a group. That is fine here, because each run rebuilds from the latest releases. PR runs and branchworkflow_dispatchruns get their ownapt-repo-<ref>group, so they never displace a pendingmainrun.Signed or dry run.
scripts/detect-signing.shruns inapt-signingand receives only whether each secret is set, assecrets.X != '', never the value.APT_SIGNING_KEY,APT_SIGNING_PASSPHRASE, the variableAPT_SIGNING_FINGERPRINTandsite/montimage-archive-keyring.gpgall exist.Job split.
buildholds no secrets. It fetches, verifies, builds and tests.sign(environmentapt-signing,mainonly) receives onlydists/and never sees a.deb.deploy(environmentgithub-pages,pages: writeandid-token: write) never sees a secret, and runsgpgvagain on the full tree before deploying.persist-credentials: falseand the least permissions it needs.Signing (
scripts/sign-repo.sh).printf, so it never appears in a process's arguments. The passphrase goes through fd 3.mktemp -dGNUPGHOMEunder$RUNNER_TEMP, which is removed on exit, and the env vars are unset.--local-user "$APT_SIGNING_FINGERPRINT"(the value ends in!) and--digest-algo SHA512, and writesInRelease(clearsigned) andRelease.gpg(detached, armoured).scripts/verify-repo.shthen checks each file withgpgv --keyring site/montimage-archive-keyring.gpg, in an emptyGNUPGHOME. It requires exactly oneGOODSIGandVALIDSIG, made by the expected subkey. It fails onEXPKEYSIG,REVKEYSIG,EXPSIG,BADSIG,ERRSIGorNO_PUBKEY; gpgv itself exits 0 on an expired key, which apt would then reject. It also checks thatInReleasecarries the text ofRelease, theReleasefields, and everyPackagesand pool size and SHA256.Inputs (
scripts/fetch-releases.sh).published_at, excluding drafts and prereleases.^(mmt-dpi|mmt-dpi-security)_<distro>-<ver>_<arch>\.deb$.SHA256SUMSitself must have an attestation.SHA256SUMSmust equal the canonical assets, so a missing upload fails the run..debmust match itsSHA256SUMSline and passgh attestation verify <file> --repo Montimage/mmt-dpi --signer-workflow Montimage/mmt-dpi/.github/workflows/release-packages.yml --source-ref refs/tags/<tag> --deny-self-hosted-runners. These flags are stricter than--repoalone: a PR or branch build's attestation does not count.Package,VersionandArchitecturecome fromdpkg-deb -fand must agree with the file name.Attestations in the 2 releases: both have them. v1.10.2 and v1.10.1 carry SLSA v1 provenance from
release-packages.yml@refs/tags/<tag>. That covers every one of the 40.debfiles andSHA256SUMS; all were verified in the local run below. v1.10.0 has them too. v1.9.1 and older have no canonical.debnames. If such a release were ever in the window, the build would fail with "predates the canonical package names" rather than publish it unverified. There is no fallback path that skips attestations.Ubuntu 26.04 codename:
resolute(Resolute Raccoon). The package metadata does not name the codename, so I checked official sources:VERSION_CODENAME=resolutein the officialubuntu:26.04image;Dist: resolute / Version: 26.04.1 LTSat https://changelogs.ubuntu.com/meta-release;26.04.The draft used
plucky, which is 25.04 and wrong. The map is inscripts/common.sh.Layout and reproducibility.
pool/<suite>/main/m/mmt-dpi/<Package>_<Version>_<Arch>.deb, with names taken from the control fields: the asset names repeat across releases.apt-ftparchive packagesruns once per file, in sorted order, andreleaseruns with Origin/LabelMontimage, Suite = Codename,amd64 arm64,main, and no Valid-Until.Dateand every mtime are the newest release'spublished_at(SOURCE_DATE_EPOCH), andgzip -nis used. The unsigned tree is byte-identical across runs. Signatures carry the signing time.Rejected:
build-repo.sh: it wrotePackagesby hand, used thepluckycodename, had a$GNUPG_SIGNtypo, swallowed gpg errors with2>/dev/null || true, and allowed a dry-run "skip";Known limit, documented rather than fixed: if the newest release is deleted or demoted,
Datemoves backwards, and apt silently ignores aReleasewith an olderDate(measured in review:apt-get updateexits 0, existing clients keep the stale indexes and get a 404 from the pool for the removed version). AGENTS.md ("Never delete or demote a published mmt-dpi release") and the README now say: publish a newer release instead. I did not add aworkflow_dispatchinput to overrideSOURCE_DATE_EPOCH: an override lasts one run, and the next regular run movesDateback to the newestpublished_at, so clients would ignore that one in turn. It would have to be sticky state, which is not small; publishing a newer release fixes it for good.Test Results (local, real output)
Host: Ubuntu 24.04 arm64, gh 2.87.3, apt 2.8.3, GnuPG 2.4.4, Docker 29.2.1. Work dirs were in a scratch dir outside the repo. No real key was touched.
Lint:
Dry-run build against the real last 2 releases:
Each suite has
mmt-dpiandmmt-dpi-security, at1.10.2-a84a6050and1.10.1-97860a01, for amd64 and arm64.Signing path with a throwaway key, verified with gpgv:
The throwaway subkey A is created already expired and then renewed, the same situation as the maintainer's expiry renewal. Signing succeeds only because the refreshed public keyring is imported first.
apt install from the built tree in containers (arm64 host, so these are the arm64 packages; PR CI runs amd64):
file:/repo,Trusted: yes==> OK: mmt-dpi 1.10.2-a84a6050 installed on Ubuntu 24.04.5 LTS (noble)file:/repo,Trusted: yes==> OK: mmt-dpi 1.10.2-a84a6050 installed on Debian GNU/Linux 13 (trixie) (trixie)Signed-ByGet:1 file:/repo noble InRelease [2267 B]…==> OK: mmt-dpi 1.10.2-a84a6050 installedSigned-ByGet:1 file:/repo trixie InRelease [2269 B]…==> OK: mmt-dpi 1.10.2-a84a6050 installedThe unsigned legs print
WARNING: UNSIGNED dry-run repository. apt is told to trust it (Trusted: yes). Every leg runsdpkg -s mmt-dpi, checksinstall ok installed, and requires the newest version in that suite.Not testable here: the signed deploy and the live smoke job. Both need the real key, which does not exist yet. Their gating, the action pins and the artifact layout were reviewed. The cross-repo
GITHUB_TOKENreads of Montimage/mmt-dpi (release download, attestation API) are exercised by this PR's CI.Actions pinned (looked up with
gh api repos/actions/<name>/git/ref/tags/<tag>; all lightweight tags pointing at commits):3d3c42e5…cf430e03…9000827c…fc324d35…368f8252…Second review (WARN) — fixes
Finding 1, negative signing tests. The stale keyring is now exported without
export-minimal, so it keeps the expired subkey A (the script asserts that subkey A shows validityein it, else the test aborts). A new case revokes subkey A after signing (validityrasserted). Every negative check captures stderr and must fail with its own message:expected <B>,gpgv reported EXPKEYSIG,gpgv reported REVKEYSIG,InRelease does not carry the text of Release. A rejection for any other reason fails the test.Mutation test (scratch copies of
scripts/, real tree from the dry run below; the repository was not modified). Mutant a is the deletion the review asked for; b and c remove only the status names from the pattern, and c shows the revoked case is caught on its own:With the unmodified scripts,
test-signing.shexits 0 (output in the test results below).Finding 2, required check: gate job, not dropping the filter. I chose the mmt-dpi
packages-gatepattern (mmt-dpi #490):pull_requestno longer haspaths:, so the workflow runs on every PR;changesjob (checkout withfetch-depth: 2,git diff --no-renames --name-only -z HEAD^1 HEADon the merge commit) setsbuild=truewhen the PR touchesscripts/**,site/**or.github/workflows/apt-repo.yml; every non-PR event builds;buildruns only whenbuild == 'true';apt-repo-gaterunsif: always()and passes only whenchangessucceeded andbuildissuccess(relevant) orskipped(not relevant). A failed, cancelled or unexpectedly skipped build fails it.Why not drop the filter: the build takes about 4 minutes, downloads ~390 MB of releases and pulls two container images for four apt installs. Spending that on every README or ci.yml PR buys nothing, and the gate costs two few-second jobs. The
pushtrigger keeps itspaths:filter (no required check there).Local check of the filter and gate scripts (extracted from the workflow, run against a throwaway git repo with real
--no-ffmerge commits):Check names to require on
main:lint(workflow CI) andapt-repo-gate(workflow APT repository). Do not requireBuild unsigned tree and test ititself (skipped on unrelated PRs), norRelevant paths changed?,Sign with subkey A,Deploy to GitHub PagesorSmoke test the live repository (…).Finding 3, release deletion. Documented in AGENTS.md and the README (see "Known limit" above); no
SOURCE_DATE_EPOCHinput, for the reason given there.Finding 4, live smoke freshness. The smoke job downloads this run's
apt-repo-distsandapt-repo-signaturesartifacts and passes them as--dists(now required with--url).smoke-install.shreads the image'sVERSION_CODENAMEand architecture, then polls<url>/dists/<suite>/InRelease,main/binary-<arch>/PackagesandPackages.gzevery 15 s until each is byte-equal to the deployed one, for at mostSMOKE_FRESH_TIMEOUTseconds (default 900, above Pages'max-age=600). On timeout it fails with the stale file named. The container then requires the newest mmt-dpi in thatPackages, as the dry run does. Simulated locally: apython3 -m http.serverondocker0serving the real pool, with a staledists/(signed by another throwaway key) swapped for the fresh one after ~35 s:The real Pages path still runs only once the key exists.
Finding 5: trust model unchanged (see "Not in this PR").
Re-run after these fixes (same host; scratch dirs outside the repo; throwaway keys only):
shellcheck scripts/*.shclean; actionlint 1.7.12 (arm64 tarball verified withsha256sum -cagainst upstreamactionlint_1.7.12_checksums.txt; its amd64 line matches ci.yml's pin8aca8db9…a3d8) clean; a freshfetch-releases.sh(40.deb+ 2SHA256SUMS, sha256 and attestations verified),build-repo.sh(5 suites, 390101853 bytes),summarize-repo.sh,test-signing.sh(exit 0), and the four--treesmoke legs (unsigned and throwaway-signed,ubuntu:24.04anddebian:13): all==> OK: mmt-dpi 1.10.2-a84a6050 installed.Acceptance Criteria Verification
repository_dispatchmmt-dpi-release,workflow_dispatch, pushes tomainthat touch the build; signing only inapt-signingon:inapt-repo.yml; thesignjob is the only one withenvironment: apt-signing, and it runs only whengithub.ref == 'refs/heads/main'and the event is not a PRSHA256SUMSand its attestationfetch-releases.shruns inbuild, beforesign; 40/40.deb+ 2/2SHA256SUMSverified abovedists/<codename>/{Release,InRelease,Release.gpg}andmain/binary-{amd64,arm64}/Packages(.gz), each distribution's packages in its own poolGNUPGHOMEunder$RUNNER_TEMP, never printed;gpgvagainst the committed keyring alone before deploysign-repo.sh,verify-repo.sh(emptyGNUPGHOME), run again indeployapt-get update && apt-get install mmt-dpiin Ubuntu 24.04 and Debian 13 against the live URLsmokejob →smoke-install.sh --url … --keyring site/montimage-archive-keyring.gpg --dists <this run's dists>(deb822 +Signed-By; checks that the served keyring equals the committed one, waits until the served InRelease/Packages are the ones just signed, then requires the newest version; simulated locally above)detect-signing.sh→mode=dry-run;deployneedsmode == 'signed'Docs: README ("How the repository is built", dry-run status,
resolutein the suite list) and AGENTS.md (single Pages deployer, script commands).Not in this PR
Signed-Bycould be narrowed to subkey A (<keyring> <SUBA>!) as a follow-up.