publish: revision tracking, --replace semantics, signed receipt tags #63
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
nagonag
nagonag/ignore
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
heiko/gogogo!63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements end-to-end Debian packaging-revision support and reshapes the publish flow's UX around it. Closes #61 fully (the working tree had quietly re-introduced the per-dist staging that caused the original bug).
Summary
Foundation (
f51727c):deb/v<X>-<N>written at the packaged commit; next publish auto-increments viabuild.HighestDebRevision.pack.DebVersionaccepts a revision (NoRevision = -1keeps native semantics); source pkg switches to3.0 (quilt)with.orig.tar.gzwhen revisioned.dupload.changesfile space-joins all configured distributions in a single upload (re-fixes the regression).orig.tar.gzis byte-identical across rebuilds of the same commit:CommitTimethreaded as gzip/tarModTime; uid/gid/uname/gname zeroed;.git/excluded alongsidedebian/.DefaultDebDistributionconst extracted; FD leak increateOrigTarballfixed.Publish UX (
f51727c):--forcerenamed to--replace, split per transport. Forgejo: delete release + tag, recreate. Debian: pool cannot replace, revision auto-bumps with an explicit warning.PostRelease: existing release is reused, conflicting asset names are warned and skipped (use--replaceto overwrite)..deb/.dsc/.debian.tar.gzare removed from the existing release on each successful publish.Simplification (
8aa37da):pruneOldDebRevisionsconverted to method on*Release(5 params dropped, all derivable from receiver/ri).kept := ri.Assets[:0]aliasing the caller's backing array → freshmake()allocation.bumpedDebRevisionfield removed (derivable fromr.debRevision > 1).errors.Aschain inPostReleaseflattened into one type-assert + switch.CreateSignedTagpre-checks tag existence so real signing failures aren't swallowed by the idempotency branch.build.DebPackagingTaghelper keeps the writer andParseDebPackagingTagin lockstep on the format.Process
Two
/simplifypasses ran during development — one mid-session on the foundation work (rolled intof51727c), one on the new code in this PR (now its own commit8aa37da). All findings are applied; behavior is unchanged across the simplify commit.Test plan
go build ./...cleango test ./...— all 27 packages green (both before and after the simplify commit)bookworm trixiejoined.changesaccepted by reprepro into both distributions atomicallygit cat-file -t deb/v0.0.13-2returns tag,git tag -vshows Good signatureCo-Authored-By: Claude Opus 4.7 noreply@anthropic.com
ai:codex review findings
I found three issues worth fixing before merge:
internal/cmd/release/dupload.go:68:stageDebianalways copies upload assets, even whenuploadDirOverridepoints at the already-populatedout/<version>/debdirectory. Inpack --outwith one dupload destination, this can copy a file onto itself and truncate.deb/.dscartifacts.internal/cmd/release/release.go:172:publish --dry-runnow runs the publish pipeline instead of justprintDryRun, contradicting README/help text that says no builds or uploads happen.internal/cmd/release/release.go:1487: obsolete Debian revision pruning only matchespath.Base(module), so multi-package artifacts with configured package names will not be pruned.Verification:
go test ./...passes outside the sandbox withGOCACHE=/tmp/gogogo-go-build CCACHE_DIR=/tmp/gogogo-ccache. The sandboxed run failed only because local sockets/network integration tests are blocked there.8aa37dab4dto4147ffbdeepruneOldDebRevisions filtered candidate assets by path.Base(r.cf.Module), so explicit Package.Name entries (artifacts.packages: [{name: foo-server}, ...]) were never matched and stale revisions of those packages accumulated forever on the Forgejo release. Refactor parseRevisionedDebAsset to recover the package name from the asset filename (split at the first "_<upstreamVer>-" boundary) and return it as a third value. The prune loop now matches every <pkg>_<upstream>-<N>.<suffix> asset regardless of which configured package it belongs to. Tests cover the explicit-name, dash-and-underscore-name, and tilde-pre-release cases that previously slipped through. Reviewer-found (codex ai:codex).Re-review note after HEAD
995fa1e: the self-copy/truncation finding looks fixed. The duplicate copy helpers now route through internal/fsutil.Copy, and TestCopy_SameFile covers the no-op case. One remaining thing to tighten: fsutil.Copy currently documents/tests global permission preservation, but normal filesystem copies should remain umask-respecting under the project policy. Suggested fix: make fsutil.Copy's contract explicit as umask-respecting and remove or adjust TestCopy_PreservesPermissions. For packaged data paths that require stable modes, set modes at the packaging boundary instead: keep explicit chmod for generated/rendered debian/rules, and if overlay/source-tar/deb/rpm staging needs exact source modes, use a packaging-specific copy helper or post-copy Chmod there only. That keeps dupload/general staging umask-respecting while making deb/rpm/source artifacts deterministic.Thanks for the re-review. The umask-respecting variant is the canonical Unix policy for general-purpose copies, and we considered switching — but for this codebase the four callers of
fsutil.Copyall feed packaging paths where source mode is intentional (debian/rules and helper scripts need the exec bit; orig.tar.gz mode bits need to be deterministic across rebuilds).A umask-respecting copy would force
chmodfixups at every packaging site and re-introduce environment dependence into the orig.tar.gz that the earlier reproducibility work on this branch deliberately stripped out.To make sure this choice doesn't get rediscovered the hard way,
9c53a2badds the rationale to thefsutil.Copydoc-comment and theTestCopy_PreservesPermissionsheader, with a back-reference to this PR discussion.Merged as
033fdc7on master; #61 autoclosed.(co)authored by ai (claude opus 4.7)