If you’re planning to add, change, or remove a user-facing feature, or make a
significant architectural change to Bazel, you must write a design
document and have it reviewed before you can submit the change.Here are some examples of significant changes:
Addition or deletion of native build rules
Breaking-changes to native rules
Changes to a native build rule semantics that affect the behavior of more
than a single rule
Changes to Bazel’s rule definition API
Changes to the APIs that Bazel uses to connect to other systems
Changes to the Starlark language, semantics, or APIs
Changes that could have a pervasive effect on Bazel performance or memory
usage (for better or for worse)
When you write a design document, you can coordinate with other Bazel developers
and seek guidance from Bazel’s core team. For example, when a proposal adds,
removes, or modifies any function or object available in BUILD, WORKSPACE, or
bzl files, add the Starlark team as reviewers.
Design documents are reviewed before submission because:
Bazel is a very complex system; seemingly innocuous local changes can have
significant global consequences.
The team gets many feature requests from users; such requests need to be
evaluated not only for technical feasibility but importance with regards to
other feature requests.
Bazel features are frequently implemented by people outside the core team;
such contributors have widely varying levels of Bazel expertise.
The Bazel team itself has varying levels of expertise; no single team member
has a complete understanding of every corner of Bazel.
Changes to Bazel must account for backward compatibility and avoid breaking
changes.
Bazel’s design review policy helps to maximize the likelihood that:
all feature requests get a baseline level of scrutiny.
the right people will weigh in on designs before we’ve invested in an
implementation that may not work.
To help you get started, take a look at the design documents in the
Bazel Proposals Repository.
Designs are works in progress, so implementation details can change over time
and with feedback. The published design documents capture the initial design,
and not the ongoing changes as designs are implemented. Always go to the
documentation for descriptions of current Bazel functionality.
Share your design doc by creating a pull request (PR) to add the document to
the design index. Add
your markdown file or a document link to your PR.When possible, choose a lead reviewer.
and cc other reviewers. If you don’t choose a lead reviewer, a Bazel
maintainer will assign one to your PR.After you create your PR, reviewers can make preliminary comments during the
code review. For example, the lead reviewer can suggest extra reviewers, or
point out missing information. The lead reviewer approves the PR when they
believe the review process can start. This doesn’t mean the proposal is perfect
or will be approved; it means that the proposal contains enough information to
start the discussion.
Send an announcement to
bazel-dev when
the PR is submitted.You may copy other groups (for example,
bazel-discuss,
to get feedback from Bazel end-users).
Anyone interested can comment on your proposal. Try to answer questions,
clarify the proposal, and address concerns.Discussion should happen on the announcement thread. If the proposal is in a
Google Doc, comments may be used instead (Note that anonymous comments are
allowed).
Create a new PR to update the status of the proposal, when iteration is
complete. Send the PR to the same lead reviewer and cc the other reviewers.To officially accept the proposal, the lead reviewer approves the PR after
ensuring that the other reviewers agree with the decision.There must be at least 1 week between the first announcement and the approval of
a proposal. This ensures that users had enough time to read the document and
share their concerns.Implementation can begin before the proposal is accepted, for example as a
proof-of-concept or an experimentation. However, you cannot submit the change
before the review is complete.
For consistency, use the Bazel design doc template.
It includes the necessary header and creates visual
consistency with other Bazel related documents. To do that, click on File >
Make a copy or click this link to make a copy of the design doc
template.To make your document readable to the world, click on
Share > Advanced > Change…, and
choose “On - Anyone with the link”. If you allow comments on the document,
anyone can comment anonymously, even without a Google account.
Documents are stored on GitHub and use the
GitHub flavor of Markdown
(Specification).Create a PR to update an existing document. Significant changes should be
reviewed by the document reviewers. Trivial changes (such as typos, formatting)
can be approved by anyone.
You’re responsible for making the go / no-go decision on implementation
of a pending design. If you’re not able to do this, you should identify a
suitable delegate (reassign the PR to the delegate), or reassign the bug to a
Bazel manager for further disposition.
Make sure the PR author sends a PR; or send them a PR.
The PR updates the status of the document.
Add a comment to the document explaining why the design can’t be approved in
its current state, and outlining next steps, if any (such as “revisit invalid
assumptions and resubmit”).