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 WORKSPACE files and their http_archive or git_repository rules are not scanned.

Manifest

Parameters

NameTypeDescriptionRequired
ignorearrayignore specifies rule to ignore Bazel module updates.
    modulesobject

modules specifies a map of modules, the key is module name as seen in the MODULE.bazel, the value is an optional semver version constraint.

examples:

- modules:
  # Ignoring module updates for this module
  rules_go:
  # Ignore module updates for this version
  gazelle: "1.x"
    pathstringpath specifies a MODULE.bazel path pattern, the pattern requires to match all of name, not just a substring.
onlyarrayonly specify required rule to restrict Bazel module updates.
    modulesobject

modules specifies a map of modules, the key is module name as seen in the MODULE.bazel, the value is an optional semver version constraint.

examples:

- modules:
  # Ignoring module updates for this module
  rules_go:
  # Ignore module updates for this version
  gazelle: "1.x"
    pathstringpath specifies a MODULE.bazel path pattern, the pattern requires to match all of name, not just a substring.
rootdirstringrootdir defines the root directory used to recursively search for MODULE.bazel files
versionfilterobject

versionfilter provides parameters to specify the version pattern to use when generating manifest.

kind - semver versionfilter of kind semver uses semantic versioning as version filtering pattern accepts one of: patch - patch only update patch version minor - minor only update minor version major - major only update major versions a version constraint such as >= 1.0.0

kind - regex versionfilter of kind regex uses regular expression as version filtering pattern accepts a valid regular expression

example:

	versionfilter:
		kind: semver
		pattern: minor
    kindstringspecifies the version kind such as semver, regex, or latest
    patternstringspecifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format
    regexstringspecifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used.
    replaceallobjectreplaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction.
        patternstringPattern specifies the regex pattern to match for replacement
        replacementstringReplacement specifies the replacement string (supports $1, $2, etc. for captured groups)
    strictbooleanstrict enforce strict versioning rule. Only used for semantic versioning at this time
⚠ This table is generated from the Updatecli codebase and may contain inaccurate data. Feel free to report them on github.com/updatecli/updatecli

Example

autodiscovery:
  crawlers:
    bazel: {}