feat: native .deb/.rpm packaging #41
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!41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "package-deb"
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?
Summary
.deband.rpmbinary builders wired into the release flow; source-package generators (dpkg-source/rpmbuildwhen available); Debian changelog and RPM%changelogformatters; arch/version conversion helpersconfig migrate(issue #40): new subcommand that appends missing top-level sections and missing leaf attributes within existing sections as commented examples — append-only, idempotentpackager, deduplicate metadata resolution withpkgMeta, addderefBoolhelper in configTest plan
go build ./...— cleango test ./...— all passgolangci-lint run ./internal/cmd/migrate/... ./internal/packager/...— 0 issuesgogogo config migrateon a partial config appends missing attributes as commentsconfig migrateis a no-op (idempotency)gogogo releasewithpackages: [deb]in config produces.debasset🤖 Generated with Claude Code
Extends Config with Packages []string and a Formats struct (Common, Deb, RPM, Source) so users can opt into native packaging via: packages: - deb - rpm New internal/packager package adds DebArch / RPMArch (GOARCH -> distro arch, linux only) and DebVersion / RPMVersion (semver tag -> distro version). Pre-releases sort correctly: 1.0.0~rc.1 in Debian, Release 0.1.rc.1 in RPM per Fedora convention. Build metadata is preserved for Debian and dropped for RPM (semver explicitly excludes build metadata from precedence). No behavior change yet; consumers land in later phases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>- Cache fieldSchema and defaultLines as package-level vars (was rebuilt via reflection on every Run/NeedsUpdate/CheckIdempotent call, and config.Default was re-split per missing attribute) - Extract diffConfig() helper to consolidate the missingUnits + missingAttributes pattern across Run, NeedsUpdate, and CheckIdempotent - Extract writeCommented() to deduplicate the inner-line emit loop in appendMissing (attrs and units shared identical bodies) - Drop appendUnits backward-compat shim (its only caller was TestCheckIdempotent, now updated to call appendMissing directly) - Simplify redundant condition in extractSubSectionLines (HasPrefix subsumes the equality check) - Strengthen TestMissingAttributes tests: - PartialSection now keys on full dotted paths instead of leaf-only (which passed by coincidence of unique leaf names today) - Idempotent and SkipsWholeMissing now include positive assertions so a regression that returns nil unconditionally is caught - Rename NoneWhenComplete -> NoneWhenAllPathsSpecified to better describe what's tested (key presence, not value completeness) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>The handling of
config migrateis rubbish.moduleevenmoduleexists, but is commented as#module(note the missing whitespace)Conclusion: we should re-think and maybe only append new options we introduced (commented, if we want them to be opted in) or uncommented, if they need opt-out. E.g. packaging I'd consider as opt-in.
So probably we need to have a config version, current v0, now, with the new features v1, which means, the config subcommand appends the new options only, if the config is <v1
Not sure, if that makes sense.
170ffea627to16e9ca1a21feat: native .deb/.rpm packaging + config migrate subcommandto feat: native .deb/.rpm packagingLatest changes (
3494683)Config:
distributionslist replacesdistributionstringThe single
distributionfield (with/etc/os-releaseautodetection viasystemCodename()) has been removed. In its place:stringto[]string(yaml:"distributions,omitempty")["stable"]— no more host-sniffing.debis uploaded once per distribution entryOther fixes in this commit
/to member names per GNU ar format (fixesdpkg-debcompatibility on some systems); max name length adjusted to 15 bytesUploadRawnow setsreq.GetBodyso the HTTP client can transparently retry/redirect uploadsTest result
Full release of
v0.17.3withpackages: [deb]and no explicitdistributionsconfigured (default path):Build, package, and upload all succeeded. The
.deblanded in thestable/mainpool on the Forgejo package registry as expected.Pull request closed