feat(releasing): include shell completions in deb, rpm, and archive packages#25552
feat(releasing): include shell completions in deb, rpm, and archive packages#25552thomasqueirozb wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 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".
| 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" |
There was a problem hiding this comment.
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 👍 / 👎.
| "$VECTOR_BIN" completion bash > "$PROJECT_ROOT/target/completion/bash/vector" 2>/dev/null || \ | ||
| touch "$PROJECT_ROOT/target/completion/bash/vector" |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Add shell completions for bash, zsh, and fish to
.deb,.rpm, and.tar.gzarchive packages. Completions are generated at package build time usingvector 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-brewVector configuration
NA
How did you test this PR?
Reviewed the packaging scripts and spec file changes. The
verify-install.shscript now checks for the presence of completion files after installation.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References