Documentation ¶
Overview ¶
Package config implements app-level configs for LUCI Analysis.
Index ¶
- Constants
- Variables
- func CreateConfigWithBothBuganizerAndMonorail(defaultBugSystem configpb.BugSystem) *configpb.ProjectConfig
- func CreatePlaceholderBugManagementPolicy(id string) *configpb.BugManagementPolicy
- func CreatePlaceholderConfig() (*configpb.Config, error)
- func Get(ctx context.Context) (*configpb.Config, error)
- func IsProjectEnabledForIngestion(ctx context.Context, project string) (bool, error)
- func NewEmptyProject() *configpb.ProjectConfig
- func Project(ctx context.Context, project string) (*configpb.ProjectConfig, error)
- func ProjectWithMinimumVersion(ctx context.Context, project string, minimumVersion time.Time) (*configpb.ProjectConfig, error)
- func SetTestConfig(ctx context.Context, cfg *configpb.Config) error
- func SetTestProjectConfig(ctx context.Context, cfg map[string]*configpb.ProjectConfig) error
- func Update(ctx context.Context) error
- func ValidateProjectConfig(ctx *validation.Context, project string, cfg *configpb.ProjectConfig)
- func ValidateRunesGraphicOrNewline(value string, maxLengthInBytes int) error
- type ProjectConfigs
Constants ¶
const ProjectCacheExpiry = 1 * time.Minute
ProjectCacheExpiry defines how often project configuration stored in the in-process cache is refreshed from datastore.
const RefHashRePattern = `[0-9a-f]{16}`
RefHashRePattern is the regular expression pattern that matches validly formed Ref Hash.
const VariantHashRePattern = `[0-9a-f]{16}`
VariantHashRePattern is the regular expression pattern that matches validly formed Variant Hash.
Variables ¶
var ChromiumMilestoneProjectRe = regexp.MustCompile(`^(chrome|chromium)-m[0-9]+$`)
ChromiumMilestoneProjectRe is the chromium milestone projects, e.g. chromium-m100.
StartingEpoch is the earliest valid config version for a project. It is deliberately different from the timestamp zero value to be discernible from "timestamp not populated" programming errors.
Functions ¶
func CreateConfigWithBothBuganizerAndMonorail ¶
func CreateConfigWithBothBuganizerAndMonorail(defaultBugSystem configpb.BugSystem) *configpb.ProjectConfig
CreateConfigWithBothBuganizerAndMonorail creates a placeholder config for a project that uses both Monorail and Buganizer.
func CreatePlaceholderBugManagementPolicy ¶
func CreatePlaceholderBugManagementPolicy(id string) *configpb.BugManagementPolicy
func CreatePlaceholderConfig ¶
CreatePlaceholderConfig returns a new valid Config for testing.
func IsProjectEnabledForIngestion ¶
IsProjectEnabledForIngestion returns if the LUCI project is enabled for ingestion. By default, all LUCI projects are enabled for ingestion, but it is possible to limit ingestion to an allowlisted set in the service configuration.
func NewEmptyProject ¶
func NewEmptyProject() *configpb.ProjectConfig
NewEmptyProject returnes an empty project config.
func ProjectWithMinimumVersion ¶
func ProjectWithMinimumVersion(ctx context.Context, project string, minimumVersion time.Time) (*configpb.ProjectConfig, error)
ProjectWithMinimumVersion returns the configuration of the requested project, which has a LastUpdated time of at least minimumVersion. This bypasses the in-process cache if the cached version is older than the specified version.
func SetTestConfig ¶
SetTestConfig set test configs in the cachedCfg.
func SetTestProjectConfig ¶
SetTestProjectConfig sets test project configuration in datastore. It should be used from unit/integration tests only.
func ValidateProjectConfig ¶
func ValidateProjectConfig(ctx *validation.Context, project string, cfg *configpb.ProjectConfig)
func ValidateRunesGraphicOrNewline ¶
ValidateRunesGraphicOrNewline validates a value: - is non-empty - is a valid UTF-8 string - contains only runes matching unicode.IsGraphic or '\n', and - has a specified maximum length.
Types ¶
type ProjectConfigs ¶
type ProjectConfigs struct {
// contains filtered or unexported fields
}
ProjectConfigs represents the physcial to logical content translation of project configs.
func Projects ¶
func Projects(ctx context.Context) (ProjectConfigs, error)
Projects returns all project configurations, in a map by project name. Uses in-memory cache to avoid hitting datastore all the time.
func (*ProjectConfigs) Keys ¶
func (p *ProjectConfigs) Keys() []string
Keys returns all projects that have a record in datastore. It can be a project that currently have a config or had a config before but then deleted.
func (*ProjectConfigs) Project ¶
func (p *ProjectConfigs) Project(project string) *configpb.ProjectConfig
Project returns the logical project config.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package compiledcfg contains compiled versions of the LUCI Analysis config.
|
Package compiledcfg contains compiled versions of the LUCI Analysis config. |