Skip to content

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Jun 7, 2025

this adds a src.rpm packager.

refs goreleaser/goreleaser#3412

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 requested a review from Copilot June 7, 2025 02:46
@caarlos0 caarlos0 self-assigned this Jun 7, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label Jun 7, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 7, 2025
Copy link

cloudflare-workers-and-pages bot commented Jun 7, 2025

Deploying nfpm with  Cloudflare Pages  Cloudflare Pages

Latest commit: ce22b32
Status: ✅  Deploy successful!
Preview URL: https://66bdcb58.nfpm.pages.dev
Branch Preview URL: https://srpm.nfpm.pages.dev

View logs

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for building source RPMs (.src.rpm) alongside regular RPMs by introducing a new SRPM packager variant.

  • Introduce DefaultSRPM and extend RPM with a format field to switch between binary and source RPM formats
  • Register both "rpm" and "src.rpm" packagers and wire through .ConventionalExtension() and .Package()
  • Update all existing tests to target DefaultRPM, and add a placeholder TestSRPM for source RPM validation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
rpm/rpm.go Add format enum, DefaultSRPM, tagSourcePackage, and switchable extension/packaging logic
rpm/rpm_test.go Replace Default with DefaultRPM, inject TestSRPM, and adjust calls for the new packager
Comments suppressed due to low confidence (2)

rpm/rpm.go:55

  • [nitpick] Comment above DefaultSRPM incorrectly references DefaultRPM. Update to // DefaultSRPM SRPM packager. for clarity.
// DefaultRPM RPM packager.

rpm/rpm_test.go:156

  • The new TestSRPM function is missing assertions for source‐RPM metadata and does not close its function body with a } before the next test. Add equivalent validation steps (e.g., checking for the source package tag) and a closing brace.
func TestSRPM(t *testing.T) {

Copy link

codecov bot commented Jun 7, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.28%. Comparing base (9f029a4) to head (ce22b32).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
rpm/rpm.go 75.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #935      +/-   ##
==========================================
- Coverage   69.29%   69.28%   -0.01%     
==========================================
  Files          22       22              
  Lines        3120     3129       +9     
==========================================
+ Hits         2162     2168       +6     
- Misses        745      747       +2     
- Partials      213      214       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@twpayne
Copy link

twpayne commented Jun 7, 2025

LGTM

@caarlos0 caarlos0 merged commit 2e47af6 into main Jun 7, 2025
49 checks passed
@caarlos0 caarlos0 deleted the srpm branch June 7, 2025 16:32
@github-actions github-actions bot added this to the 2.38.0 milestone Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants