Documentation ¶
Overview ¶
Package config implements config validation for LUCI Bisection
Index ¶
- Constants
- Variables
- func CanCreateRevert(ctx context.Context, gerritCfg *configpb.GerritConfig, ...) (bool, string, error)
- func CanSubmitRevert(ctx context.Context, gerritCfg *configpb.GerritConfig) (bool, string, error)
- func CreatePlaceholderProjectConfig() *configpb.ProjectConfig
- func GetCompileBuilder(ctx context.Context, project string) (*configpb.Builder, error)
- func GetExcludedBuilderGroupsForCompile(ctx context.Context, project string) ([]string, error)
- func GetExcludedBuilderGroupsForTest(ctx context.Context, project string) ([]string, error)
- func GetGerritCfgForSuspect(ctx context.Context, suspect *model.Suspect, project string) (*configpb.GerritConfig, error)
- func GetTestBuilder(ctx context.Context, project string) (*configpb.Builder, error)
- func IsMilestoneProject(project string) bool
- func Project(ctx context.Context, project string) (*configpb.ProjectConfig, error)
- func Projects(ctx context.Context) (map[string]*configpb.ProjectConfig, error)
- func SetTestProjectConfig(ctx context.Context, cfg map[string]*configpb.ProjectConfig) error
- func SupportedProjects(ctx context.Context) ([]string, error)
- func UpdateProjects(ctx context.Context) error
Constants ¶
const ProjectCacheExpiry = 1 * time.Minute
ProjectCacheExpiry defines how often project configuration stored in the in-process cache is refreshed from datastore.
Variables ¶
var ChromiumMilestoneProjectRe = regexp.MustCompile(`^(chrome|chromium)-m[0-9]+$`)
ChromiumMilestoneProjectRe is the chromium milestone projects, e.g. chromium-m100.
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 ¶
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 GetGerritCfgForSuspect ¶
func GetTestBuilder ¶
func IsMilestoneProject ¶
func Project ¶
Project returns the configurations of the requested project. Returns an ErrNotFoundProjectConfig error if config for the given project does not exist.
func Projects ¶
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 ¶
SetTestProjectConfig sets test project configuration in datastore. It should be used from unit/integration tests only.
func SupportedProjects ¶
SupportedProjects returns the list of projects supported by LUCI Bisection.
func UpdateProjects ¶
UpdateProjects fetches fresh project-level configuration from LUCI Config service and stores it in datastore.
Types ¶
This section is empty.