bazelbuild / bazelbuild/bazel

Publish shell completion scripts separately in releases so they can be downloaded by e.g. the Bazelisk brew formula

Open
#22,659 1 comment 4 reactions 0 assignees View on GitHub
help wanted P2 team-OSS type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

The Bazelisk homebrew formula [downloads the zsh completions](https://github.com/Homebrew/homebrew-core/blob/4c9933e6d18d161dd49c1c0a10917f0bd5cde35d/Formula/b/bazelisk.rb#L23-L26) for the latest bazel release and installs them.

However it can't do the same with fish or bash completions, because they can't be easily downloaded. The bazel formula [builds them directly](https://github.com/Homebrew/homebrew-core/blob/4c9933e6d18d161dd49c1c0a10917f0bd5cde35d/Formula/b/bazel.rb#L56-L57), but that isn't feasible for bazelisk.

Currently the completion scripts are included in the self-extracting archive shell scripts, but aren't otherwise accessible as far as I can tell.

As well as public homebrew, we would also use these files internally if they were available.

### Which category does this issue belong to?

CLI

### What underlying problem are you trying to solve with this feature?

Making it easy to download the shell completion scripts for bash, zsh, and fish.

Doesn't have to be this layout, but as an example it would be great if this worked:

```shell
# One file per completion:
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.bash
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.zsh
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completion.fish

# Or one file, containing _bazel , bazel-complete.bash , bazel.fish
curl -sSL https://github.com/bazelbuild/bazel/releases/latest/download/bazel-completions.tar.gz
```

### Which operating system are you running Bazel on?

macOS latest

### What is the output of `bazel info release`?

release 7.1.2

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

Can't find any existing issues.

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Inspect the release packaging that currently places completion scripts inside the self-extracting archive shell scripts. Trace how release assets are assembled, then expose separate downloadable files or an archive for bash, zsh, and fish completions. Done means the completion assets are published with releases and can be retrieved through stable download URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, fish, github, zsh
Domain
cli, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.