The bazel crawler looks recursively for every MODULE.bazel file from a root directory, and updates each bazel_dep() declaration it contains.
# MODULE.bazel
bazel_dep(name = "rules_go", version = "0.46.0")
bazel_dep(name = "gazelle", version = "0.35.0", dev_dependency = True)
Both regular and dev_dependency declarations are updated.
This crawler is enabled by default, so it can be used either automatically by running updatecli diff from a directory containing the files to update, or by providing a manifest.
The automatic discovery behavior can be tuned by providing a YAML manifest with a bazel crawler in top-level directive autodiscovery as explained in the "Autodiscovery" page.
Each dependency produces a bazelregistry source resolving the latest module version from the Bazel Central Registry, and a bazelmod target writing it back into MODULE.bazel.
“groups” defines dependencies updated together, in one pipeline per group.
default:
empty, every dependency follows “groupby”.
remark:
“only” uses the same rules as the crawler “only” setting, and narrows it:
a group dependency must match both the crawler “only” and the group “only”.
A group rule combined with a crawler rule setting the same field to another value matches nothing.
a dependency belongs to the first group it matches.
dependencies matching no group follow “groupby”.
the group name is added to the generated pipeline IDs and action titles,
and set as the “updatecli.io/group” label, so “–labels updatecli.io/group:aws” selects them.
the name “default” is reserved for the dependencies matching no group.
“name” identifies the group in the generated pipelines.
remark:
it must be unique, start with a letter or a digit, and only contain letters, digits, “.” and “-”.
only
array
“only” defines the rules matching the dependencies of the group.
remark:
it accepts the same rules as the crawler “only” setting.
ignore
array
“ignore” defines rules to exclude matching Bazel modules from the autodiscovery.
remark:
a Bazel module is ignored when it matches at least one rule.
modules
object
“modules” defines the Bazel modules to match, keyed by module name as written in “MODULE.bazel”.
remark:
an empty value matches any version.
otherwise the value is a semantic version constraint, such as “>=1.0.0”.
when the version or the constraint cannot be parsed, the value must equal the version.
a module name cannot be empty.
example:
-modules:# match any version of this modulerules_go:# match only the versions of this module satisfying the constraintgazelle:"1.x"
path
string
“path” defines a “MODULE.bazel” path pattern.
remark:
the pattern must match the whole path, not just a substring.
the pattern follows the Go filepath.Match syntax, such as “*” or “?”.
only
array
“only” defines rules to restrict the autodiscovery to matching Bazel modules.
remark:
a Bazel module is kept only when it matches at least one rule.
modules
object
“modules” defines the Bazel modules to match, keyed by module name as written in “MODULE.bazel”.
remark:
an empty value matches any version.
otherwise the value is a semantic version constraint, such as “>=1.0.0”.
when the version or the constraint cannot be parsed, the value must equal the version.
a module name cannot be empty.
example:
-modules:# match any version of this modulerules_go:# match only the versions of this module satisfying the constraintgazelle:"1.x"
path
string
“path” defines a “MODULE.bazel” path pattern.
remark:
the pattern must match the whole path, not just a substring.
the pattern follows the Go filepath.Match syntax, such as “*” or “?”.
rootdir
string
“rootdir” defines the directory where the crawler starts searching for “MODULE.bazel” files.
default:
the scm directory when “scmid” is set, otherwise the directory relative paths resolve from, by default the working directory.
remark:
a relative path is resolved from the default directory.
an absolute path is used as is, instead of the scm directory.
tracks
array
“tracks” defines an ordered list of tracks, each one choosing versions its own way.
The crawler runs once per track, and each track gets its own pipelines.
default:
empty, the crawler runs once with its own settings.
remark:
each track requires a “name”, and sets “versionfilter”, “age” or both.
a setting used by a track can’t also be set on the crawler,
so a track without it uses the crawler default.
“age” is only accepted by crawlers supporting it.
the name is added to the generated pipeline IDs and action titles,
and set as the “updatecli.io/track” label, so “–labels updatecli.io/track:major” selects them.
a track waits while an earlier track still has a pending update,
so a major update is proposed once no minor update is pending.
With “groupby: individual”, it waits for the same dependency.
With “groupby: all”, or in a group, the dependencies share one pull request per crawler,
so it waits for the whole pull request: one pending minor update holds back every major update of that crawler.
An update is pending while its pull request is open or, without an action, while its working branch exists.
Tracks are run in the order they are listed.
a track with “wait: false” never waits, but later tracks still wait for it.
the version filters of the tracks should not overlap, for example “minor” then “majoronly”.
Tracks setting only “age” share the crawler version filter, so they overlap:
with “allowdowngrade”, one track may undo the updates of another.
it isn’t supported by WASM plugins.
example:
tracks:
- name: minor
versionfilter:
kind: semver
pattern: minor
age:
minimum: 3d
- name: major
versionfilter:
kind: semver
pattern: majoronly
age:
minimum: 14d
- name: lts
wait: false
versionfilter:
kind: regex
pattern: '^1\.'
name
string
“name” identifies the track in the generated pipelines.
remark:
it must be unique, start with a letter or a digit, and only contain letters, digits, “.” and “-”.
versionfilter
object
“versionfilter” defines the version filter used by the track, as the crawler “versionfilter” does.
default:
the crawler default version filter.
kind
string
“kind” defines the versioning scheme used to select a version.
default:
latest
remark:
accepted values are “latest”, “semver”, “regex”, “regex/semver”, “time”, “regex/time”, “lex” and “pep440”.
“latest” returns the last version of the list.
“lex” sorts the versions lexicographically and returns the last one.