Skip to content

feat(releasing): include shell completions in deb, rpm, and archive packages#25552

Open
thomasqueirozb wants to merge 1 commit into
masterfrom
releasing/shell-completions
Open

feat(releasing): include shell completions in deb, rpm, and archive packages#25552
thomasqueirozb wants to merge 1 commit into
masterfrom
releasing/shell-completions

Conversation

@thomasqueirozb
Copy link
Copy Markdown
Member

@thomasqueirozb thomasqueirozb commented Jun 1, 2026

Summary

Add shell completions for bash, zsh, and fish to .deb, .rpm, and .tar.gz archive packages. Completions are generated at package build time using vector completion <shell> and installed to the standard system paths for each shell.

For cross-compiled builds where the binary cannot run on the host, completion files are created as empty stubs so packaging does not fail.

Note

Changes are also needed in https://github.com/vectordotdev/homebrew-brew

diff --git a/Formula/vector.rb b/Formula/vector.rb
index 755cb63..bfe0c49 100644
--- a/Formula/vector.rb
+++ b/Formula/vector.rb
@@ -19,6 +19,9 @@ class Vector < Formula
 
   def install
     bin.install "bin/vector"
+    bash_completion.install "completion/bash/vector"
+    zsh_completion.install "completion/zsh/_vector"
+    fish_completion.install "completion/fish/vector.fish"
 
     # Set up Vector for local development
     inreplace "config/vector.yaml" do |s|

Vector configuration

NA

How did you test this PR?

Reviewed the packaging scripts and spec file changes. The verify-install.sh script now checks for the presence of completion files after installation.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@thomasqueirozb thomasqueirozb marked this pull request as ready for review June 1, 2026 16:36
@thomasqueirozb thomasqueirozb requested a review from a team as a code owner June 1, 2026 16:36
@github-actions github-actions Bot added the domain: releasing Anything related to releasing Vector label Jun 1, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f42a9de707

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +99 to +106
VECTOR_BIN="$ARCHIVE_DIR/bin/vector"
if "$VECTOR_BIN" --version >/dev/null 2>&1; then
mkdir -p "$ARCHIVE_DIR/completion/bash" \
"$ARCHIVE_DIR/completion/zsh" \
"$ARCHIVE_DIR/completion/fish"
"$VECTOR_BIN" completion bash > "$ARCHIVE_DIR/completion/bash/vector"
"$VECTOR_BIN" completion zsh > "$ARCHIVE_DIR/completion/zsh/_vector"
"$VECTOR_BIN" completion fish > "$ARCHIVE_DIR/completion/fish/vector.fish"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Generate completions in the release archive path

This only updates scripts/package-archive.sh, but the Linux release workflow I checked builds and uploads the .tar.gz artifacts via make ... package-${{ matrix.target }}-all in .github/workflows/publish.yml:130, which goes through Makefile.packaging and the target/%/vector.tar.gz rule in Makefile, not this script. As a result, the published Linux archive packages still contain only the existing bin, config, and systemd files and will not include the new completion files, while the changelog and PR summary say archives include them.

Useful? React with 👍 / 👎.

Comment thread scripts/package-deb.sh
Comment on lines +59 to +60
"$VECTOR_BIN" completion bash > "$PROJECT_ROOT/target/completion/bash/vector" 2>/dev/null || \
touch "$PROJECT_ROOT/target/completion/bash/vector"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid packaging empty completions for cross-built packages

For cross-built packages where $VECTOR_BIN cannot execute on the builder (for example the package-deb-armv7-gnu and package-deb-arm-gnu targets in Makefile.packaging), the failed command has already truncated/created the destination via > ... and this fallback leaves a zero-byte completion file in the package; verify-install.sh only checks -f, so the release can pass verification while completions do nothing for users. Generate these from a runnable host binary or otherwise avoid installing empty stubs as if completions were available.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: releasing Anything related to releasing Vector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issue: Shell completion for different packaging

1 participant