feat: native .deb/.rpm packaging + config migrate subcommand #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
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.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.