Skip to content

Bring stratis-cli.spec into sync with Fedora#556

Merged
mulkieran merged 1 commit intostratis-storage:masterfrom
mulkieran:update-stratis-cli-spec
Sep 8, 2025
Merged

Bring stratis-cli.spec into sync with Fedora#556
mulkieran merged 1 commit intostratis-storage:masterfrom
mulkieran:update-stratis-cli-spec

Conversation

@mulkieran
Copy link
Copy Markdown
Member

@mulkieran mulkieran commented Sep 3, 2025

@mulkieran mulkieran self-assigned this Sep 3, 2025
@mulkieran mulkieran moved this to In Progress in 2025September Sep 3, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 3, 2025

Walkthrough

Replaces setuptools-based RPM packaging with a pyproject-driven flow: adjusts BuildRequires, adds %generate_buildrequires and %pyproject_buildrequires, switches build/install to %pyproject_wheel/%pyproject_install, enables pyproject file tracking and import checks, and replaces explicit %files/license/site-packages entries.

Changes

Cohort / File(s) Summary of Changes
Spec migration to pyproject macros
mockbuild_test/stratis-cli.spec
Removed python3-setuptools from top-level BuildRequires (kept python3-devel, a2x); added %generate_buildrequires and %pyproject_buildrequires in %prep; replaced -%py3_build%pyproject_wheel and -%py3_install%pyproject_install; added %pyproject_save_files -l stratis_cli, +%check, and +%pyproject_check_import; replaced explicit -%license LICENSE and site-packages entries with +%files -f %{pyproject_files} (pyproject-driven file list); introduced pyproject-driven checks and file tracking.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Packager
    participant rpmbuild
    participant Spec
    participant Pyproject as PyprojectMacros
    participant System

    Packager->>rpmbuild: start build
    rpmbuild->>Spec: %prep
    Spec->>Pyproject: %generate_buildrequires / %pyproject_buildrequires
    Pyproject-->>rpmbuild: provide buildrequires

    rpmbuild->>Spec: %build
    Spec->>Pyproject: %pyproject_wheel
    Pyproject-->>rpmbuild: build wheel

    rpmbuild->>Spec: %install
    Spec->>Pyproject: %pyproject_install
    Spec->>Pyproject: %pyproject_save_files -l stratis_cli

    rpmbuild->>Spec: %check
    Spec->>Pyproject: +%check / +%pyproject_check_import

    rpmbuild->>Spec: %files
    Spec->>Pyproject: %files -f %{pyproject_files}
    Note over Pyproject,Spec: Files and metadata sourced from pyproject
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

I hop with joy: wheels hum and spin,
Old eggs tucked out, new builds begin.
Macros planted, files now found,
Checks run clean across the ground.
A carrot-cheer for pyproject sound 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d584b33 and b87492f.

📒 Files selected for processing (1)
  • mockbuild_test/stratis-cli.spec (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • mockbuild_test/stratis-cli.spec
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mulkieran mulkieran requested a review from bgurney-rh September 3, 2025 14:19
@mulkieran mulkieran moved this from In Progress to In Review in 2025September Sep 3, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
mockbuild_test/stratis-cli.spec (3)

46-47: Install/save-files look correct; consider two small packaging tweaks

  • -l with %pyproject_save_files is great to enforce license presence; ensure the buildroot has pyproject-rpm-macros ≥ 1.11 everywhere you build (that’s when -l landed). If older builders are in scope, gate this or require a minimum macros version. (lists.fedorahosted.org)
  • Use shell-completion directory macros rather than hardcoded paths (required by Fedora guidelines). Suggested change:
-%{__install} -Dpm0644 -t %{buildroot}%{_datadir}/bash-completion/completions \
+%{__install} -Dpm0644 -t %{buildroot}%{bash_completions_dir} \
   shell-completion/bash/stratis
-%{__install} -Dpm0644 -t %{buildroot}%{_datadir}/zsh/site-functions \
+%{__install} -Dpm0644 -t %{buildroot}%{zsh_completions_dir} \
   shell-completion/zsh/_stratis
-%{__install} -Dpm0644 -t %{buildroot}%{_datadir}/fish/vendor_completions.d \
+%{__install} -Dpm0644 -t %{buildroot}%{fish_completions_dir} \
   shell-completion/fish/stratis.fish

Refs: Fedora shell completions macros guidance. (docs.fedoraproject.org)

Also applies to: 50-55


62-76: Files section is solid; consider not owning parent completion directories

Using -f %{pyproject_files} is correct; README stays listed (it’s not auto-included), and the entry-point binary remains explicit. Optionally, avoid owning parent completion directories that are typically provided by other packages; list only the files. This reduces co-ownership churn. (docs.stg.fedoraproject.org, docs.fedoraproject.org)

 %files -f %{pyproject_files}
 %doc README.rst
 %{_bindir}/stratis
 %{_mandir}/man8/stratis.8*
 %if !0%{?rhel}
-%dir %{_datadir}/bash-completion
-%dir %{_datadir}/bash-completion/completions
-%{_datadir}/bash-completion/completions/stratis
-%dir %{_datadir}/zsh
-%dir %{_datadir}/zsh/site-functions
-%{_datadir}/zsh/site-functions/_stratis
-%dir %{_datadir}/fish
-%dir %{_datadir}/fish/vendor_completions.d
-%{_datadir}/fish/vendor_completions.d/stratis.fish
+%{bash_completions_dir}/stratis
+%{zsh_completions_dir}/_stratis
+%{fish_completions_dir}/stratis.fish
 %endif

42-42: Optional: declarative BuildSystem to trim boilerplate (Fedora ≥ 41/RPM ≥ 4.20)

If you target newer Fedora builders, consider BuildSystem: pyproject to auto-generate the standard sections; you can still append your a2x manpage step. Purely optional. (git.almalinux.org)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7b5ac25 and d584b33.

📒 Files selected for processing (1)
  • mockbuild_test/stratis-cli.spec (2 hunks)
🔇 Additional comments (3)
mockbuild_test/stratis-cli.spec (3)

38-40: Good switch to generated BuildRequires; defaults are sane

Using %generate_buildrequires with %pyproject_buildrequires is the supported path. Note: runtime deps are included by default; the -r flag is not needed anymore. Keeping that default helps your %pyproject_check_import later. (docs.fedoraproject.org)


42-42: Modern build path: %pyproject_wheel

Migration from %py3_build to %pyproject_wheel aligns with current guidance and upcoming deprecation of setup.py macros. (fedoraproject.org)


59-60: Import smoke test is properly wired

%pyproject_check_import after %pyproject_save_files is exactly the intended usage. No flags needed unless you hit known false positives. (git.almalinux.org)

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran force-pushed the update-stratis-cli-spec branch from d584b33 to b87492f Compare September 3, 2025 15:43
@mulkieran mulkieran removed the request for review from bgurney-rh September 8, 2025 13:47
@mulkieran mulkieran merged commit 57a1c87 into stratis-storage:master Sep 8, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in 2025September Sep 8, 2025
@mulkieran mulkieran deleted the update-stratis-cli-spec branch September 8, 2025 13:50
@mulkieran mulkieran moved this from Done to Done(2) in 2025September Sep 16, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done(2)

Development

Successfully merging this pull request may close these issues.

1 participant