#31346·bazel

Documentation workspace status masks setup and Git failures

Author: gztong666Created Sep 26, 2026Updated Sep 30, 2026
Labelstype: bugP2team-OSShelp wantedteam-Documentation

Description of the bug:

scripts/docs/get_workspace_status.sh captures get_release_name in a command substitution and later embeds git rev-parse inside a successful echo. The script does not explicitly check either operation. A failed setup or Git lookup can therefore produce a successful-looking but incorrect BUILD_SCM_REVISION, which is used by the docs Bazel configuration.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Run the script from a context where scripts/release/common.sh cannot be sourced, or put a git stub first on PATH that exits nonzero for rev-parse.
  2. Invoke scripts/docs/get_workspace_status.sh.
  3. Observe that it can still exit successfully and print an incomplete value such as BUILD_SCM_REVISION UNSAFE_ instead of failing.

Expected: setup and revision lookup errors are propagated, so documentation builds cannot be stamped with an invalid revision.

Which operating system are you running Bazel on?

Linux or macOS (Bash documentation tooling)

What is the output of bazel info release?

development version (current master)

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

Source inspection and isolated script-level reproduction against the current master revision.

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

https://github.com/bazelbuild/bazel.git
680f57bbe5f72e29ac091ba4fcfe12f5f53dc80b

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

Not bisected. The behavior is present on the current master revision.

Have you found anything relevant by searching the web?

Searched open and closed bazelbuild/bazel issues using the affected file name and failure mode. I did not find an issue describing this specific behavior.

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

Current source: https://github.com/bazelbuild/bazel/blob/master/scripts/docs/get_workspace_status.sh