Bazel
Description
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.
Generated manifests
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.
Limitations
Only the module system is covered. Legacy
WORKSPACEfiles and theirhttp_archiveorgit_repositoryrules are not scanned.
Manifest
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| ignore | array | “ignore” defines rules to exclude matching Bazel modules from the autodiscovery. remark:
| |
| modules | object | “modules” defines the Bazel modules to match, keyed by module name as written in “MODULE.bazel”. remark:
example: | |
| path | string | “path” defines a “MODULE.bazel” path pattern. remark:
| |
| only | array | “only” defines rules to restrict the autodiscovery to matching Bazel modules. remark:
| |
| modules | object | “modules” defines the Bazel modules to match, keyed by module name as written in “MODULE.bazel”. remark:
example: | |
| path | string | “path” defines a “MODULE.bazel” path pattern. remark:
| |
| 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:
| |
| versionfilter | object | “versionfilter” defines the version filter used by the generated manifests. default: kind “semver” with pattern “*”, any version greater than or equal to the current one. remark:
example: | |
| kind | string | “kind” defines the versioning scheme used to select a version. default: latest remark:
example:
| |
| pattern | string | “pattern” defines the version pattern, according to “kind”. default:
remark:
example:
| |
| regex | string | “regex” defines the regular expression extracting the version from each entry. remark:
example:
| |
| replaceall | object | “replaceall” applies a regular expression replacement to each version before filtering. remark:
example: turns “curl-8_15_0” into “curl-8.15.0”. | |
| pattern | string | “pattern” defines the regular expression matching the text to replace. example:
| |
| replacement | string | “replacement” defines the text replacing each match of “pattern”. remark:
example:
| |
| strict | boolean | “strict” enforces strict semantic versioning rules when parsing versions. default: false remark:
|
Example
autodiscovery:
crawlers:
bazel: {}