Skip to main content
Version: 5.10.x

WorkspaceConfiguration

Configuration for a Workspace.

Remarks

A Workspace is a package in a repository that maps to a single Bazel workspace, where Workflows will run builds for.

There is generally only one workspace, which is considered the default workspace; however, it is not required that this workspace live at the root of a repository.

Each workspace inherits the tasks from the default workspace, but can override as required.

Table of contents

Properties

Properties

bazel

bazel: BazelConfiguration

Workspace-level bazel configuration. These properties will apply to each bazel based task. Can be overriden at the task level as required.


hooks

Optional hooks: TaskHook

List of hooks that will apply to all primary tasks by default. This list will be combined with a list provided at the workspace and task level. Hooks will be run sequentially, starting with hooks at the root level.

If an id is supplied for a hook, it can be overridden at both the workspace and task level.

A hook definition can also take a when condition to allow for applying hooks to a particular task type, or the use of other conditional expressions. If a custom when condition is supplied on a hook at the root level, the default behaviour of running only on primary task types is dropped, and must be supplied on the custom condition.

For example, to run a hook on all primary tasks on the main branch in the frontend workspace:

workspaces:
frontend:
hooks:
- type: before_task
command: docker login
when:
and:
- task:
primary: true
- branches
- main

If no custom condition is supplied, the hook will on all primary task types. A primary task is one of the following types:

  • build
  • buildifier
  • configure
  • delivery
  • format
  • gazelle
  • lint
  • test
  • warming

icon

icon: string = 'peacock'

The icon to assign the workspace (on CI hosts that support icon customization).


label

label: string = '.'

Label to give the group. Defaults to the workspace name or '.' for the default workspace.


tasks

tasks: ReadonlyMap<string, TaskConfiguration>

Map of tasks that should be enabled for this workspace. By default, the tasks inherited from the root workspace, so it is not required to list them twice. Tasks listed here will have their configuration merged with the root.