Documentation ¶
Index ¶
- Variables
- func Generate(sc *tricium.ServiceConfig, pc *tricium.ProjectConfig, ...) (*admin.Workflow, error)
- func UpdateAllConfigs(c context.Context) error
- func Validate(sc *tricium.ServiceConfig, pc *tricium.ProjectConfig) error
- func WithConfigService(c context.Context, iface luciConfig.Interface) context.Context
- type ProviderAPI
- type Workflow
- type WorkflowCacheAPI
Constants ¶
This section is empty.
Variables ¶
var LuciConfigServer configProvider
LuciConfigServer provides configs fetched from luci-config.
The configs are fetched in a cron job and stored in datastore.
var MockProvider mockProvider
MockProvider mocks the ProviderAPI interface.
Tests using the return values should implement their own mock.
var WorkflowCache workflowCache
WorkflowCache implements the WorkflowCacheAPI using Datastore.
Functions ¶
func Generate ¶
func Generate(sc *tricium.ServiceConfig, pc *tricium.ProjectConfig, files []*tricium.Data_File, gitRef, gitURL string) (*admin.Workflow, error)
Generate generates a Tricium workflow based on the provided configs and paths to analyze.
Previously a workflow would be a tree including isolators. Now, all functions should be recipe-based analyzers and workflows just have a list of workers, filtered based on path filters, although in practice, most path filtering will happen inside recipes.
func UpdateAllConfigs ¶
UpdateAllConfigs updates all configs.
This includes updating and removing project configs when necessary and updating the service config if necessary.
func Validate ¶
func Validate(sc *tricium.ServiceConfig, pc *tricium.ProjectConfig) error
Validate validates the provided project config using the provided service config.
They are validated together because a project config may contain a selection which is valid or invalid depending on the service config.
Returns an error if invalid, or nil if valid.
func WithConfigService ¶
WithConfigService sets a config interface in the context.
Types ¶
type ProviderAPI ¶
type ProviderAPI interface { // GetServiceConfig loads the service config from luci-config. GetServiceConfig(c context.Context) (*tricium.ServiceConfig, error) // GetProjectConfig loads one project config for the provided project. GetProjectConfig(c context.Context, project string) (*tricium.ProjectConfig, error) // GetAllProjectConfigs fetches a map of project names to project configs. GetAllProjectConfigs(c context.Context) (map[string]*tricium.ProjectConfig, error) }
ProviderAPI supplies Tricium service and project configs.