Skip to content

Fix release SRPM GoReleaser config - #24

Merged
jnfrati merged 1 commit into
mainfrom
fix/release-srpm-ci
Jun 28, 2026
Merged

Fix release SRPM GoReleaser config#24
jnfrati merged 1 commit into
mainfrom
fix/release-srpm-ci

Conversation

@jnfrati

@jnfrati jnfrati commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the source archive configuration required by GoReleaser SRPM generation
  • move SRPM RPM-specific metadata under nfpmrpm so GoReleaser's strict YAML loader accepts it
  • make the Fedora SELinux policy build chown Docker-generated artifacts back to the host user without interactive sudo

Testing

  • scripts/build-release-properties.sh
  • scripts/build-fedora-selinux-policy.sh
  • goreleaser check
  • goreleaser release --clean --skip=publish,validate
  • go test ./...

Summary by CodeRabbit

  • New Features

    • Improved release packaging metadata for RPM builds and source archives.
    • Build-generated SELinux policy artifacts now keep more user-friendly file ownership when created in containers.
  • Bug Fixes

    • Reduced cases where generated files end up owned by root, making them easier to manage and clean up on the host.
    • Improved fallback handling when restoring file ownership requires elevated permissions.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f3f6cf6a-8caa-42d1-bc06-fff9ef8e909e

📥 Commits

Reviewing files that changed from the base of the PR and between abf774e and 15a2fe2.

📒 Files selected for processing (2)
  • .goreleaser.yml
  • scripts/build-fedora-selinux-policy.sh

📝 Walkthrough

Walkthrough

GoReleaser config gains a source block and relocates group: Applications/Internet under srpm.nfpmrpm. The SELinux policy build script now passes HOST_UID/HOST_GID into the container, conditionally chowns artifacts inside the container, and gates host-side sudo chown on a non-interactive credential check.

Changes

GoReleaser config

Layer / File(s) Summary
Source block and RPM group placement
.goreleaser.yml
Adds a source section with enabled, name_template, and prefix_template; moves group: Applications/Internet from a standalone position into srpm.nfpmrpm.

SELinux build script ownership fixes

Layer / File(s) Summary
Host UID/GID passthrough and in-container chown
scripts/build-fedora-selinux-policy.sh
Passes HOST_UID and HOST_GID via -e flags into the container; adds a conditional chown block inside the container to restore artifact ownership when HOST_UID is nonzero.
Non-interactive sudo guard
scripts/build-fedora-selinux-policy.sh
Gates host-side ownership restoration on sudo -n true succeeding and runs sudo -n chown, replacing the prior simple sudo-exists check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A rabbit tidies up the build den,
Ownership fixed, no root left then,
The RPM group found its proper nest,
And sudo now behaves its best.
Hop hop, the artifacts rest! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-srpm-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jnfrati
jnfrati merged commit 8a3ed05 into main Jun 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant