feat(targets): add pkg-dnf target (dnf repo / Fedora COPR)#476
feat(targets): add pkg-dnf target (dnf repo / Fedora COPR)#476Alexander-Sorrell-IT wants to merge 2 commits into
Conversation
Adds the dnf/RPM distribution target for Fedora/RHEL-like systems. - build() generates a real RPM .spec (valid version normalization) + a dnf .repo file (self-hosted or Fedora COPR baseurl). - ship() is dry-run-safe and surfaces the exact rpmbuild + (copr-cli build | createrepo_c + GPG-sign) commands; live publish throws not-implemented rather than returning a false success. - Register pkg-dnf in cli adapter-registry; TARGETS.md row added. - manualSetup covers both COPR (hosted) and self-hosted GPG-signed repo paths.
Greptile SummaryAdds the
Confidence Score: 5/5Safe to merge; this is an additive, opt-in adapter with no live publish path yet — all operations are either file generation or dry-run only. All three blocking issues from previous review rounds are addressed: the %changelog header now uses locale-independent date formatting, the COPR gpgkey URL correctly points to the COPR project pubkey, and secret validation is removed so ship() throws immediately. The remaining observations are minor and do not affect any currently shipped code paths. packages/targets/pkg-dnf/src/index.ts — minor arch-field handling and status URL issues, but nothing blocking Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[adapter.build] --> B[renderSpec\nrpmVersion + changelog date]
A --> C[renderRepoFile]
B --> D[Write myapp.spec]
C --> E{coprProject set?}
E -- yes --> F[baseurl: download.copr.fedorainfracloud.org\ngpgkey: COPR pubkey.gpg]
E -- no --> G[baseurl: repoBaseUrl or dnf.sh1pt.com\ngpgkey: RPM-GPG-KEY-name]
F --> H[Write myapp.repo]
G --> H
D --> I[return artifact + commands]
H --> I
J[adapter.ship] --> K{dryRun?}
K -- yes --> L[return dry-run + publishCommands]
K -- no --> M[throw not implemented]
Reviews (2): Last reviewed commit: "fix(pkg-dnf): valid RPM %changelog date,..." | Re-trigger Greptile |
…live ship Addresses Greptile + adversarial review: - %changelog now emits a valid RPM header '* Wed May 29 2026 sh1pt <…> - ver-rel' (rpmbuild rejected the prior freeform line). - COPR .repo gpgkey now points at the COPR project's pubkey.gpg, not the self-hosted fallback (GPG verify would have failed). - ship() throws 'not implemented' immediately (no misleading secret-check first). - Tests assert the changelog format, COPR gpgkey, and the live-throw.
|
Thanks — addressed in the latest commit:
|
Add
pkg-dnftarget — dnf / RPM (Fedora COPR or self-hosted)Implements the
pkg-dnfdistribution target for Fedora/RHEL-like systems, filling the README "Package managers → dnf" entry. Mirrors thepkg-aptadapter convention.What's included
packages/targets/pkg-dnf/— adapter, tests, package.json, tsconfig, README.build()generates a real RPM.spec(with valid version normalization — stripsv, replaces-) and a dnf.repofile (self-hosted baseurl or Fedora COPR results URL).ship()is dry-run-safe and surfaces the exactrpmbuild+ (copr-cli build|createrepo_c+ GPG-sign) commands. Live publish throwsnot implementedrather than returning a false success.pkg-dnfinpackages/cli/src/adapter-registry.ts;TARGETS.mdrow added (✅).manualSetupcovers both COPR (hosted,copr-cli) and self-hosted GPG-signed repo paths.Tests
smokeTest+ spec/repo generation (self-hosted + COPR variants), version normalization, and dry-run command surfacing.pnpm install --frozen-lockfilegreen.No external CLI or secrets needed for build/test (dry-run only).