Build and Test UI¶
If you are running Bazel or other build tools locally, your build and test results are just output to your console.
EngFlow’s Build and Test UI lets you:
- find out why your Bazel builds and tests fail,
- share your build and test results with others for debugging,
- review historical data to discover trends,
- and analyze your runs to optimize your builds and tests.
If you are using EngFlow Remote Execution, you can use the Build and Test UI out
of the box by logging in to your cluster at your cluster-specific
<CLUSTER_ENDPOINT>
.
You can also send your build data to the Build and Test UI without Remote
Execution by forwarding the Build Event Protocol (BEP) with the following
Bazel flags, replacing <CLUSTER_ENDPOINT>
appropriately:
Bash | |
---|---|
Also see the page on
Bazel First-Time Setup and setting up .bazelrc
.
Info
The UI exposes information about your build, potentially including source code.
Adding additional data to invocations¶
You can add supplemental data to your invocations to more easily identify them in EngFlow’s Build and Test UI.
The above screenshot shows part of an invocation’s summary that includes the following additional data:
Source control management system¶
You can add metadata about the source control management (SCM) system used. We currently support four data points:
- Repository
- Branch
- Commit Id
- Whether there are local changes on top of the commit
This metadata can be provided either by setting SCM-specific BES keywords, or via the workspace status. If both methods are used, the BES keywords take precedence over the workspace status keys.
SCM-specific BES Keywords¶
For EngFlow v2.72.0 and above, you can provide metadata on the source control
management system via BES keywords. Add the following command-line flags to
your Bazel invocation, replacing <REPOSITORY_URI>
, <BRANCH_NAME>
and
<COMMIT_ID>
appropriately:
--bes_keywords=engflow:BuildScmRemote=<REPOSITORY_URI>
for the repository--bes_keywords=engflow:BuildScmBranch=<BRANCH_NAME>
for the branch--bes_keywords=engflow:BuildScmRevision=<COMMIT_ID>
for the commit- To indicate whether there are local changes on top of the commit:
--bes_keywords=engflow:BuildScmStatus=modified
for changes--bes_keywords=engflow:BuildScmStatus=clean
for no changes
Here's a concrete example for building source code hosted on GitHub:
Bash | |
---|---|
Workspace status¶
Using the Bazel flag --workspace_status_command
you can specify a command to invoke at the beginning of each build to provide
status information. See the Bazel’s user manual
for more information and the bazelbuild/bazel GitHub repo for an example script.
EngFlow recognizes and surfaces the following workspace status keys in the Build and Test UI:
BUILD_SCM_REMOTE
for the repositoryBUILD_SCM_BRANCH
for the branchBUILD_SCM_REVISION
for the commitBUILD_SCM_STATUS
to indicate whether there are local changes on top of the commit
Below in an example script for git users that populates all of the above:
CI system¶
You can specify details about invocations run as part of your CI setup.
For this, add some Bazel flags to your invocations, replacing
<PIPELINE_NAME>
, <JOB_NAME>
and <URI>
appropriately:
Bash | |
---|---|
Additionally, you may specify the user that triggered a build in CI. Add the
following Bazel flag to your invocations replacing <USER_PRINCIPAL>
with the
identifier of the user that triggered the build (such as alice@engflow.com
):
Info
BES keywords that start with the prefix engflow:
are specially handled by
EngFlow, in this case to surface details about the CI system used.
BES keywords¶
You can tag your invocations flexibly by using BES keywords.
For this, use the Bazel flag --bes_keywords
.
Multiple uses are accumulated:
Info
On the invocations page you can filter invocations by those that include specific BES keywords.
Warning
BES keywords that start with the prefix engflow:
are specially handled by
EngFlow and not added to the invocation search index. They are either
not surfaced in the UI at all, or handled separately. See
CI system for an example.