Skip to content

Conversation

@renner0e
Copy link

works 🙂
image

@bootc-bot bootc-bot bot requested a review from jeckersb January 21, 2026 16:11
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds shell completion for bash, zsh, and fish to the bootc RPM package. The implementation is straightforward, generating the completion files during the build and installing them. My review focuses on ensuring the packaging adheres to common standards. I've found a minor issue with the naming of the bash completion file, which doesn't follow the Fedora Packaging Guidelines. I've provided suggestions to correct this.

@jeckersb jeckersb self-assigned this Jan 21, 2026
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Thanks!

%endif
%endif

for shell in bash zsh fish; do
Copy link
Collaborator

Choose a reason for hiding this comment

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

A little bit unfortunate to hardcode the list of shells again here; the Rust code supports others too. But OTOH there's a need to deal with the hardcoded RPM macro dirs for these too.

%endif

for shell in bash zsh fish; do
target/release/bootc completion $shell > target/release/bootc.$shell
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also: it is a goal that the build process is encapsulated in Makefile. Let's handle this the same way we do man pages, by having it be a make completion say which is part of make install by default.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i.e. when someone makes a Debian/arch/etc package they don't need to replicate this logic.

Copy link
Author

Choose a reason for hiding this comment

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

should be addressed with: 97f26f9

I am new to Makefiles, thanks for the patience 🙂

Signed-off-by: renner <renner0@posteo.de>
@renner0e renner0e changed the title packaging/rpm: Add shell completions Makefile/rpm: Add shell completions Jan 21, 2026
.PHONY: completion
completion:
mkdir -p target/completion
for shell in bash elvish fish powershell zsh; do \
Copy link
Collaborator

Choose a reason for hiding this comment

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

This list...

install -d $(DESTDIR)$(prefix)/lib/bootc/install
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 target/man/*.5; \
install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 target/man/*.8; \
install -D -m 0644 target/completion/bootc.bash $(DESTDIR)$(prefix)/share/bash-completion/completions/bootc
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is not consistent with this list.

Copy link
Author

Choose a reason for hiding this comment

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

fixed with: eaf920e. I would rather not package elvish and powershell completions in the rpm due to lack of docs and ecosystem around it. I also never used them. I hope that's okay.

Signed-off-by: renner <renner0@posteo.de>
Not packaging those due to the lack of documentation on this.

Signed-off-by: renner <renner0@posteo.de>
%endif
%{_unitdir}/*
%{_mandir}/man*/*bootc*
%if 0%{?rhel} >= 9
Copy link
Collaborator

Choose a reason for hiding this comment

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

AI: Important: This conditional appears inverted. The commit message says "old versions don't have these macros" but the condition uses explicit paths on RHEL 9+, where the macros (%{bash_completions_dir} etc.) do exist.

If the intent is to use explicit paths on old RHEL that lacks the macros, the condition should be %if 0%{?rhel} && 0%{?rhel} < 9 (old RHEL without macros) with explicit paths in that branch.

Alternatively, since the macros expand to identical paths anyway, consider just always using explicit paths and removing the conditional entirely:

%{_datadir}/bash-completion/completions/bootc
%{_datadir}/zsh/site-functions/_bootc
%{_datadir}/fish/vendor_completions.d/bootc.fish

touch %{?buildroot}/%{_docdir}/bootc/baseimage/base/sysroot/.keepdir
find %{?buildroot}/%{_docdir} ! -type d -printf '%{_docdir}/%%P\n' | sort > bootcdoclist.txt

rm -f %{buildroot}/%{_prefix}/share/elvish/lib/bootc.elv
Copy link
Collaborator

Choose a reason for hiding this comment

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

AI: (low) Minor inconsistency: using %{_prefix}/share here vs %{_datadir} elsewhere. Could use %{_datadir} for consistency, though functionally equivalent.

Makefile Outdated
cargo run --release --package xtask -- manpages

.PHONY: completion
completion:
Copy link
Collaborator

Choose a reason for hiding this comment

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

AI: The completion target calls target/release/bootc but doesn't depend on bin. If someone runs make completion or make install without first running make bin, this will fail. Consider adding the dependency:

completion: bin

Signed-off-by: renner <renner0@posteo.de>
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.

3 participants