docs: document the put pre-upload mistake checks

This commit is contained in:
vhaudiquet committed 2026-11-17 10:35:49 +01:00
1 parent 93f1acf484
commit 3244f1c3b3
1 file changed
+30 -1
+30 -1
View File
@@ -254,6 +254,35 @@ Exit codes: 0 all tests passed (skips and flaky allowed), 1 at least one
test failed (or a `--fail-on` trigger), 2 runtime errors (no declared test failed (or a `--fail-on` trigger), 2 runtime errors (no declared
tests, no usable testbed, ...). tests, no usable testbed, ...).
### Pre-upload checks
`pkh put` inspects the `.changes` file (and the source tree next to it)
before anything is uploaded, refusing or questioning common upload
mistakes the archive queue would accept silently. The guards are adapted
from Christian Ehrhardt's dput hooks, and stop uploads carrying:
- an `ubuntu@` or `root@` address in `Changed-By` (a container or VM
default identity leaked into the changelog),
- a `~YY.MM` backport suffix not matching the target series
(`1.0-0ubuntu1~20.10` uploading to focal, which is 20.04),
- quilt patches (`debian/patches/series`) in a native package, where
they would never apply.
Others ask for confirmation, defaulting to "no" so non-interactive runs
refuse the same way:
- no Launchpad bug reference in the changelog entry, or one of the usual
placeholder numbers (`1234`, `9999`),
- Ubuntu changes (`1.0-1ubuntu1`) without an ubuntu.com `Maintainer`
(`update-maintainer` was not run).
Every refusal names the mistake and the way out: `--force` uploads
anyway, skipping the mistake checks together with the duplicate-upload
and superseded-version guards. `pkh build` collects `LP: #NNN` changelog
references into the `Launchpad-Bugs-Fixed` field of the `.changes` file
like Ubuntu's `dpkg-genchanges` does, which is what the bug-reference
guards read.
## End-to-end package harness ## End-to-end package harness
`tests/e2e/` exercises pkh the way it is used in anger: a catalog of ~60 `tests/e2e/` exercises pkh the way it is used in anger: a catalog of ~60
@@ -275,6 +304,6 @@ output layout.
- pull: try to fetch the correct git branch for series on Debian - pull: try to fetch the correct git branch for series on Debian
- deb: asynchronous build, detachable and monitorable - deb: asynchronous build, detachable and monitorable
- put: allow uploads to Debian or Ubuntu archives - put: allow uploads to Debian or Ubuntu archives, refusing `~ppa` versions there (from cpaelzer's dput hooks)
- pull: cache Sources.gz files to improve speed - pull: cache Sources.gz files to improve speed
- pull: 'pkh pull' in a package tree should git pull and re-fetch orig tgz - pull: 'pkh pull' in a package tree should git pull and re-fetch orig tgz