config

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package config implements config validation for LUCI Bisection

Index

Constants

View Source
const ProjectCacheExpiry = 1 * time.Minute

ProjectCacheExpiry defines how often project configuration stored in the in-process cache is refreshed from datastore.

Variables

View Source
var ChromiumMilestoneProjectRe = regexp.MustCompile(`^(chrome|chromium)-m[0-9]+$`)

ChromiumMilestoneProjectRe is the chromium milestone projects, e.g. chromium-m100.

View Source
var (
	// Returned if configuration for a given project does not exist.
	ErrNotFoundProjectConfig = fmt.Errorf("no project config found")
)

Functions

func CanCreateRevert

func CanCreateRevert(ctx context.Context, gerritCfg *configpb.GerritConfig, analysisType bisectionpb.AnalysisType) (bool, string, error)

CanCreateRevert returns:

  • whether a revert can be created;
  • the reason it cannot be created if applicable; and
  • the error if one occurred.

func CanSubmitRevert

func CanSubmitRevert(ctx context.Context, gerritCfg *configpb.GerritConfig) (bool, string, error)

CanSubmitRevert returns:

  • whether a revert can be submitted;
  • the reason it cannot be submitted if applicable; and
  • the error if one occurred.

func CreatePlaceholderProjectConfig

func CreatePlaceholderProjectConfig() *configpb.ProjectConfig

func GetCompileBuilder

func GetCompileBuilder(ctx context.Context, project string) (*configpb.Builder, error)

func GetExcludedBuilderGroupsForCompile

func GetExcludedBuilderGroupsForCompile(ctx context.Context, project string) ([]string, error)

func GetExcludedBuilderGroupsForTest

func GetExcludedBuilderGroupsForTest(ctx context.Context, project string) ([]string, error)

func GetGerritCfgForSuspect

func GetGerritCfgForSuspect(ctx context.Context, suspect *model.Suspect, project string) (*configpb.GerritConfig, error)

func GetTestBuilder

func GetTestBuilder(ctx context.Context, project string) (*configpb.Builder, error)

func IsMilestoneProject

func IsMilestoneProject(project string) bool

func Project

func Project(ctx context.Context, project string) (*configpb.ProjectConfig, error)

Project returns the configurations of the requested project. Returns an ErrNotFoundProjectConfig error if config for the given project does not exist.

func Projects

func Projects(ctx context.Context) (map[string]*configpb.ProjectConfig, error)

Projects returns all project configurations, in a map by project name. Uses in-memory cache to avoid hitting datastore all the time. Note that the config may be stale by up to 1 minute.

func SetTestProjectConfig

func SetTestProjectConfig(ctx context.Context, cfg map[string]*configpb.ProjectConfig) error

SetTestProjectConfig sets test project configuration in datastore. It should be used from unit/integration tests only.

func SupportedProjects

func SupportedProjects(ctx context.Context) ([]string, error)

SupportedProjects returns the list of projects supported by LUCI Bisection.

func UpdateProjects

func UpdateProjects(ctx context.Context) error

UpdateProjects fetches fresh project-level configuration from LUCI Config service and stores it in datastore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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