automation

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) error

Run parses the command line arguments and triggers the specified command.

func RunCommand

func RunCommand(ctx context.Context, command string, projectId string, push bool, build bool) error

RunCommand triggers a command for each registered repository that supports it.

Types

type CloudBuildClient

type CloudBuildClient interface {
	RunBuildTrigger(ctx context.Context, req *cloudbuildpb.RunBuildTriggerRequest, opts ...gax.CallOption) error
	ListBuildTriggers(ctx context.Context, req *cloudbuildpb.ListBuildTriggersRequest, opts ...gax.CallOption) iter.Seq2[*cloudbuildpb.BuildTrigger, error]
}

CloudBuildClient is an interface for mocking calls to Cloud Build.

type GitHubClient

type GitHubClient interface {
	FindMergedPullRequestsWithPendingReleaseLabel(ctx context.Context, owner, repo string) ([]*github.PullRequest, error)
}

GitHubClient handles communication with the GitHub API.

type RepositoriesConfig

type RepositoriesConfig struct {
	Repositories []*RepositoryConfig `yaml:"repositories"`
}

RepositoriesConfig represents all the registered librarian GitHub repositories.

func (*RepositoriesConfig) RepositoriesForCommand

func (c *RepositoriesConfig) RepositoriesForCommand(command string) []*RepositoryConfig

RepositoriesForCommand return a subset of repositories that support the provided command.

func (*RepositoriesConfig) Validate

func (c *RepositoriesConfig) Validate() error

Validate checks the the RepositoriesConfig is valid.

type RepositoryConfig

type RepositoryConfig struct {
	Name              string   `yaml:"name"`
	FullName          string   `yaml:"full-name"`
	SecretName        string   `yaml:"github-token-secret-name"`
	SupportedCommands []string `yaml:"supported-commands"`
}

RepositoryConfig represents a single registered librarian GitHub repository.

func (*RepositoryConfig) GitURL

func (c *RepositoryConfig) GitURL() (string, error)

GitURL returns the full git url to clone.

func (*RepositoryConfig) Validate

func (c *RepositoryConfig) Validate() error

Validate checks the the RepositoryConfig is valid.

Jump to

Keyboard shortcuts

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