config

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_infra_appengine_rubber_stamper_config_config_proto protoreflect.FileDescriptor

Functions

func SetTestConfig

func SetTestConfig(ctx context.Context, cfg *Config) error

SetTestConfig set test configs in the cachedCfg.

func Update

func Update(c context.Context) error

Update fetches the config and puts it into the datastore.

Types

type BenignFilePattern

type BenignFilePattern struct {

	// Paths contains the information that which files are allowed and which are
	// not. The paths is parsed as lines in a .gitignore document, and therefore
	// should follows rules listed in https://git-scm.com/docs/gitignore.
	Paths []string `protobuf:"bytes,2,rep,name=paths,proto3" json:"paths,omitempty"`
	// contains filtered or unexported fields
}

BenignFilePattern describes pattern of changes to benign files.

func (*BenignFilePattern) Descriptor deprecated

func (*BenignFilePattern) Descriptor() ([]byte, []int)

Deprecated: Use BenignFilePattern.ProtoReflect.Descriptor instead.

func (*BenignFilePattern) GetPaths

func (x *BenignFilePattern) GetPaths() []string

func (*BenignFilePattern) ProtoMessage

func (*BenignFilePattern) ProtoMessage()

func (*BenignFilePattern) ProtoReflect

func (x *BenignFilePattern) ProtoReflect() protoreflect.Message

func (*BenignFilePattern) Reset

func (x *BenignFilePattern) Reset()

func (*BenignFilePattern) String

func (x *BenignFilePattern) String() string

type CleanCherryPickPattern

type CleanCherryPickPattern struct {

	// The length of time in <int><unit> form. Has the same format as the
	// `time_window` in CleanRevertPattern.
	TimeWindow string `protobuf:"bytes,1,opt,name=time_window,json=timeWindow,proto3" json:"time_window,omitempty"`
	// Paths that must have a human reviewer.
	ExcludedPaths []string `protobuf:"bytes,2,rep,name=excluded_paths,json=excludedPaths,proto3" json:"excluded_paths,omitempty"`
	// contains filtered or unexported fields
}

func (*CleanCherryPickPattern) Descriptor deprecated

func (*CleanCherryPickPattern) Descriptor() ([]byte, []int)

Deprecated: Use CleanCherryPickPattern.ProtoReflect.Descriptor instead.

func (*CleanCherryPickPattern) GetExcludedPaths

func (x *CleanCherryPickPattern) GetExcludedPaths() []string

func (*CleanCherryPickPattern) GetTimeWindow

func (x *CleanCherryPickPattern) GetTimeWindow() string

func (*CleanCherryPickPattern) ProtoMessage

func (*CleanCherryPickPattern) ProtoMessage()

func (*CleanCherryPickPattern) ProtoReflect

func (x *CleanCherryPickPattern) ProtoReflect() protoreflect.Message

func (*CleanCherryPickPattern) Reset

func (x *CleanCherryPickPattern) Reset()

func (*CleanCherryPickPattern) String

func (x *CleanCherryPickPattern) String() string

type CleanRevertPattern

type CleanRevertPattern struct {

	// The length of time in <int><unit> form. Reverts need to be within this
	// time_window to be valid.
	// Valid units are "s", "m", "h", "d", meaning "seconds", "minutes",
	// "hours", "days" respectively.
	TimeWindow string `protobuf:"bytes,1,opt,name=time_window,json=timeWindow,proto3" json:"time_window,omitempty"`
	// Paths that must have a human reviewer.
	ExcludedPaths []string `protobuf:"bytes,2,rep,name=excluded_paths,json=excludedPaths,proto3" json:"excluded_paths,omitempty"`
	// contains filtered or unexported fields
}

CleanRevertPattern describes pattern of clean reverts.

func (*CleanRevertPattern) Descriptor deprecated

func (*CleanRevertPattern) Descriptor() ([]byte, []int)

Deprecated: Use CleanRevertPattern.ProtoReflect.Descriptor instead.

func (*CleanRevertPattern) GetExcludedPaths

func (x *CleanRevertPattern) GetExcludedPaths() []string

func (*CleanRevertPattern) GetTimeWindow

func (x *CleanRevertPattern) GetTimeWindow() string

func (*CleanRevertPattern) ProtoMessage

func (*CleanRevertPattern) ProtoMessage()

func (*CleanRevertPattern) ProtoReflect

func (x *CleanRevertPattern) ProtoReflect() protoreflect.Message

func (*CleanRevertPattern) Reset

func (x *CleanRevertPattern) Reset()

func (*CleanRevertPattern) String

func (x *CleanRevertPattern) String() string

type Config

type Config struct {

	// A map stores configs for all the Gerrit hosts, where keys are names of
	// hosts (e.g. "chromium" or "chrome-internal"), values are corresponding
	// configs.
	HostConfigs map[string]*HostConfig `` /* 182-byte string literal not displayed */
	// A global default time window for clean reverts and cherry picks. The
	// format is the same as that of CleanRevertPattern.time_window.
	DefaultTimeWindow string `protobuf:"bytes,2,opt,name=default_time_window,json=defaultTimeWindow,proto3" json:"default_time_window,omitempty"`
	// contains filtered or unexported fields
}

Config is the service-wide configuration data for rubber-stamper.

func Get

func Get(c context.Context) (*Config, error)

Get returns the config stored in the cachedCfg.

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetDefaultTimeWindow

func (x *Config) GetDefaultTimeWindow() string

func (*Config) GetHostConfigs

func (x *Config) GetHostConfigs() map[string]*HostConfig

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type HostConfig

type HostConfig struct {

	// A map stores config for repositories, where keys are names of repos (e.g.
	// "chromium/src", "infra/infra") and values are corresponding configs.
	RepoConfigs map[string]*RepoConfig `` /* 182-byte string literal not displayed */
	// The default valid time window for clean reverts. This time window is
	// applied at a host-level and the time window configured in repo-level
	// configs will override this one. The format is the same as that of
	// CleanRevertPattern.time_window.
	CleanRevertTimeWindow string `` /* 128-byte string literal not displayed */
	// The default valid time window for clean cherry-picks. This time window is
	// applied at a host-level and the time window configured in repo-level
	// configs will override this one. The format is the same as that of
	// CleanCherryPickPattern.time_window.
	CleanCherryPickTimeWindow string `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

HostConfig describes the config to be used for a Gerrit host.

func (*HostConfig) Descriptor deprecated

func (*HostConfig) Descriptor() ([]byte, []int)

Deprecated: Use HostConfig.ProtoReflect.Descriptor instead.

func (*HostConfig) GetCleanCherryPickTimeWindow

func (x *HostConfig) GetCleanCherryPickTimeWindow() string

func (*HostConfig) GetCleanRevertTimeWindow

func (x *HostConfig) GetCleanRevertTimeWindow() string

func (*HostConfig) GetRepoConfigs

func (x *HostConfig) GetRepoConfigs() map[string]*RepoConfig

func (*HostConfig) ProtoMessage

func (*HostConfig) ProtoMessage()

func (*HostConfig) ProtoReflect

func (x *HostConfig) ProtoReflect() protoreflect.Message

func (*HostConfig) Reset

func (x *HostConfig) Reset()

func (*HostConfig) String

func (x *HostConfig) String() string

type RepoConfig

type RepoConfig struct {
	BenignFilePattern      *BenignFilePattern      `protobuf:"bytes,1,opt,name=benign_file_pattern,json=benignFilePattern,proto3" json:"benign_file_pattern,omitempty"`
	CleanRevertPattern     *CleanRevertPattern     `protobuf:"bytes,2,opt,name=clean_revert_pattern,json=cleanRevertPattern,proto3" json:"clean_revert_pattern,omitempty"`
	CleanCherryPickPattern *CleanCherryPickPattern `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

RepoConfig describes the config to be used for a Gerrit repository.

func (*RepoConfig) Descriptor deprecated

func (*RepoConfig) Descriptor() ([]byte, []int)

Deprecated: Use RepoConfig.ProtoReflect.Descriptor instead.

func (*RepoConfig) GetBenignFilePattern

func (x *RepoConfig) GetBenignFilePattern() *BenignFilePattern

func (*RepoConfig) GetCleanCherryPickPattern

func (x *RepoConfig) GetCleanCherryPickPattern() *CleanCherryPickPattern

func (*RepoConfig) GetCleanRevertPattern

func (x *RepoConfig) GetCleanRevertPattern() *CleanRevertPattern

func (*RepoConfig) ProtoMessage

func (*RepoConfig) ProtoMessage()

func (*RepoConfig) ProtoReflect

func (x *RepoConfig) ProtoReflect() protoreflect.Message

func (*RepoConfig) Reset

func (x *RepoConfig) Reset()

func (*RepoConfig) String

func (x *RepoConfig) String() string

Jump to

Keyboard shortcuts

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