bazel

package
v0.116.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleBazelFile is the name of the Bazel module file
	ModuleBazelFile string = "MODULE.bazel"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bazel

type Bazel struct {
	// contains filtered or unexported fields
}

Bazel struct holds all information needed to generate Bazel module manifests.

func New

func New(spec interface{}, rootDir, scmID, actionID string) (Bazel, error)

New returns a new valid Bazel object.

func (Bazel) DiscoverManifests

func (b Bazel) DiscoverManifests() ([][]byte, error)

DiscoverManifests discovers Bazel module dependencies and generates Updatecli manifests.

type MatchingRule

type MatchingRule struct {
	// `path` specifies a `MODULE.bazel` path pattern, the pattern requires to match all of name, not just a substring.
	Path string
	// `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"
	// “`
	Modules map[string]string
}

MatchingRule allows specifying rules to identify manifests

type MatchingRules

type MatchingRules []MatchingRule

func (MatchingRules) Validate

func (m MatchingRules) Validate() error

Validate checks that each matching rule has at least one non-empty field. Returns an error if any rule has no valid fields specified. Also validates that Modules map doesn't contain empty keys (module names).

type Spec

type Spec struct {
	// `rootdir` defines the root directory used to recursively search for `MODULE.bazel` files
	RootDir string `yaml:",omitempty"`
	// `ignore` specifies rule to ignore Bazel module updates.
	Ignore MatchingRules `yaml:",omitempty"`
	// `only` specify required rule to restrict Bazel module updates.
	Only MatchingRules `yaml:",omitempty"`
	// `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
	// “`
	VersionFilter version.Filter `yaml:",omitempty"`
}

Spec defines the Bazel autodiscovery parameters.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL