Documentation ¶
Index ¶
- Constants
- func IsCannotModifyCfgsOnTheFly(err error) bool
- func IsNotFound(err error) bool
- type CannotModifyCfgsOnTheFlyError
- type ConfigNotFoundError
- type ConfigReader
- type GitilesConfigReader
- func (gc *GitilesConfigReader) GetAuthorsFileContents(ctx context.Context, authorsPath string) (string, error)
- func (gc *GitilesConfigReader) GetSkCQCfg(ctx context.Context) (*SkCQCfg, error)
- func (gc *GitilesConfigReader) GetTasksCfg(ctx context.Context, tasksJSONPath string) (*specs.TasksCfg, error)
- type SkCQCfg
- type ThrottlerCfg
- type VisibilityType
Constants ¶
const (
SkCQCfgPath = "infra/skcq.json"
)
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type CannotModifyCfgsOnTheFlyError ¶
type CannotModifyCfgsOnTheFlyError struct {
// contains filtered or unexported fields
}
CannotModifyCfgsOnTheFlyError is returned when the owner of the change does not have permission to modify the cfg.
func (*CannotModifyCfgsOnTheFlyError) Error ¶
func (e *CannotModifyCfgsOnTheFlyError) Error() string
type ConfigNotFoundError ¶
type ConfigNotFoundError struct {
// contains filtered or unexported fields
}
ConfigNotFoundError is returned when a cfg is not found in the repo+branch.
func (*ConfigNotFoundError) Error ¶
func (e *ConfigNotFoundError) Error() string
type ConfigReader ¶
type ConfigReader interface { // GetSkCQCfg reads the SkCQ cfg file from CL's ref if it was modified, else // it reads it from HEAD. GetSkCQCfg(ctx context.Context) (*SkCQCfg, error) // GetTasksCfg reads the Tasks.json file from CL's ref if it was modified, else // it reads it from HEAD. GetTasksCfg(ctx context.Context, tasksJSONPath string) (*specs.TasksCfg, error) // GetAuthorsFileContents reads the AUTHORS file from CL's ref if it was modified, // else it reads it from HEAD. GetAuthorsFileContents(ctx context.Context, authorsPath string) (string, error) }
ConfigReader is an interface to read configs for SkCQ. Useful for testing.
type GitilesConfigReader ¶
type GitilesConfigReader struct {
// contains filtered or unexported fields
}
GitilesConfigReader is an implementation of ConfigReader interface.
func NewGitilesConfigReader ¶
func NewGitilesConfigReader(ctx context.Context, httpClient *http.Client, ci *gerrit.ChangeInfo, cr codereview.CodeReview, canModifyCfgsOnTheFly allowed.Allow) (*GitilesConfigReader, error)
NewGitilesConfigReader returns an instance of GitilesConfigReader.
func (*GitilesConfigReader) GetAuthorsFileContents ¶
func (gc *GitilesConfigReader) GetAuthorsFileContents(ctx context.Context, authorsPath string) (string, error)
GetAuthorsFileContents implements the ConfigReader interface.
func (*GitilesConfigReader) GetSkCQCfg ¶
func (gc *GitilesConfigReader) GetSkCQCfg(ctx context.Context) (*SkCQCfg, error)
GetSkCQCfg implements the ConfigReader interface.
func (*GitilesConfigReader) GetTasksCfg ¶
func (gc *GitilesConfigReader) GetTasksCfg(ctx context.Context, tasksJSONPath string) (*specs.TasksCfg, error)
GetTasksCfg implements the ConfigReader interface.
type SkCQCfg ¶
type SkCQCfg struct { // Determines where changes from this repo will be stored in Firestore and // which frontend instance will be used to display results. Also determines // which BuildBucket bucket will be used when triggering/querying for // try jobs. VisibilityType VisibilityType `json:"visibility_type"` // Full path to tasks.json file to get list of CQ try jobs from. TasksJSONPath string `json:"tasks_json_path,omitempty"` // Name of the go/cria group that includes the list of people allowed to // commit to this repo+branch. CommitterList string `json:"committer_list"` // Name of the go/cria group that includes the list of people allowed to // run dry-runs on this repo+branch. DryRunAccessList string `json:"dry_run_access_list"` // The URL of the tree status instance that will gate submissions to this // repo+branch when the tree is closed. TreeStatusURL string `json:"tree_status_url,omitempty"` // The throttler config that will gate the rate of submissions to this // repo+branch. ThrottlerCfg *ThrottlerCfg `json:"throttler_cfg,omitempty"` // Full path to the AUTHORS file. If this is specified then SkCQ will // run the authors_verifier on the change to validate that the author // of the change is specified in the AUTHORS file. AuthorsPath string `json:"authors_path,omitempty"` }
SkCQCfg is a struct which describes the SkCQ config for a repo+branch at a particular commit.
func ParseSkCQCfg ¶
ParseSkCQCfg is a utility function that parses the given SkCQ cfg file contents and returns the config.
type ThrottlerCfg ¶
type ThrottlerCfg struct { // How many commits are allowed within BurstDelaySecs. Default used is // throttler.MaxBurstDefault. MaxBurst int `json:"max_burst"` // The window of seconds MaxBurst commits are allowed in. Default used is // throttler.BurstDelaySecs. BurstDelaySecs int `json:"burst_delay_secs"` }
ThrottlerCfg is a struct which describes how the rate of submissions to this repo+branch will be gated.
type VisibilityType ¶
type VisibilityType string
const InternalVisibility VisibilityType = "internal"
const PublicVisibility VisibilityType = "public"
const StagingVisibility VisibilityType = "staging"