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: 20 Imported by: 0

Documentation

Overview

Package config implements interface for app-level configs for Arquebus.

Index

Constants

This section is empty.

Variables

View Source
var (
	Oncall_Position_name = map[int32]string{
		0: "UNSET",
		1: "PRIMARY",
		2: "SECONDARY",
	}
	Oncall_Position_value = map[string]int32{
		"UNSET":     0,
		"PRIMARY":   1,
		"SECONDARY": 2,
	}
)

Enum value maps for Oncall_Position.

View Source
var File_infra_appengine_arquebus_app_config_config_proto protoreflect.FileDescriptor

Functions

func GetConfigRevision

func GetConfigRevision(c context.Context) string

GetConfigRevision returns the revision of the current config.

func Middleware

func Middleware(c *router.Context, next router.Handler)

Middleware loads the service config and installs it into the context.

func SetConfig

func SetConfig(c context.Context, cfg *Config, rev string) context.Context

SetConfig installs cfg into c.

func Update

func Update(c context.Context) error

Update fetches the config and puts it into the datastore.

It is then used by all requests that go through Middleware.

Types

type Assigner

type Assigner struct {

	// The unique ID of the Assigner.
	//
	// This value will be used in URLs of UI, so keep it short. Note that
	// only lowercase alphabet letters and numbers are allowed. A hyphen may
	// be placed between letters and numbers.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// An email list of the owners of the Assigner.
	Owners []string `protobuf:"bytes,2,rep,name=owners,proto3" json:"owners,omitempty"`
	// The duration between the start of an Assigner run and the next one.
	//
	// This value should be at least a minute long.
	Interval *durationpb.Duration `protobuf:"bytes,3,opt,name=interval,proto3" json:"interval,omitempty"`
	// IssueQuery describes the search criteria to look for issues to assign.
	IssueQuery *IssueQuery `protobuf:"bytes,4,opt,name=issue_query,json=issueQuery,proto3" json:"issue_query,omitempty"`
	// If multiple values are specified in assignees, Arquebus iterates the list
	// in the order until it finds a currently available assignee. Note that
	// Monorail users are always assumed to be available.
	Assignees []*UserSource `protobuf:"bytes,6,rep,name=assignees,proto3" json:"assignees,omitempty"`
	// If multiple values are specified in ccs, all the available roations and
	// users are added to the CC of searched issues.
	Ccs []*UserSource `protobuf:"bytes,7,rep,name=ccs,proto3" json:"ccs,omitempty"`
	// If DryRun is set, Assigner doesn't update the found issues.
	DryRun bool `protobuf:"varint,8,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
	// The description shown on UI.
	Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"`
	// Comment is an additional message that is added to the body of the issue
	// comment that is posted when an issue gets updated.
	Comment string `protobuf:"bytes,10,opt,name=comment,proto3" json:"comment,omitempty"`
	// contains filtered or unexported fields
}

Assigner contains specifications for an Assigner job.

func (*Assigner) Descriptor deprecated

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

Deprecated: Use Assigner.ProtoReflect.Descriptor instead.

func (*Assigner) GetAssignees

func (x *Assigner) GetAssignees() []*UserSource

func (*Assigner) GetCcs

func (x *Assigner) GetCcs() []*UserSource

func (*Assigner) GetComment

func (x *Assigner) GetComment() string

func (*Assigner) GetDescription

func (x *Assigner) GetDescription() string

func (*Assigner) GetDryRun

func (x *Assigner) GetDryRun() bool

func (*Assigner) GetId

func (x *Assigner) GetId() string

func (*Assigner) GetInterval

func (x *Assigner) GetInterval() *durationpb.Duration

func (*Assigner) GetIssueQuery

func (x *Assigner) GetIssueQuery() *IssueQuery

func (*Assigner) GetOwners

func (x *Assigner) GetOwners() []string

func (*Assigner) ProtoMessage

func (*Assigner) ProtoMessage()

func (*Assigner) ProtoReflect

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

func (*Assigner) Reset

func (x *Assigner) Reset()

func (*Assigner) String

func (x *Assigner) String() string

type Config

type Config struct {

	// AccessGroup is the luci-auth group who has access to admin pages and
	// APIs.
	AccessGroup string `protobuf:"bytes,1,opt,name=access_group,json=accessGroup,proto3" json:"access_group,omitempty"`
	// The endpoint for Monorail APIs.
	MonorailHostname string `protobuf:"bytes,2,opt,name=monorail_hostname,json=monorailHostname,proto3" json:"monorail_hostname,omitempty"`
	// A list of Assigner config(s).
	Assigners []*Assigner `protobuf:"bytes,3,rep,name=assigners,proto3" json:"assigners,omitempty"`
	// The endpoint for Rotation Proxy APIs.
	RotationProxyHostname string `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

Config is the service-wide configuration data for Arquebus

func Get

func Get(c context.Context) *Config

Get returns the config stored in the context.

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAccessGroup

func (x *Config) GetAccessGroup() string

func (*Config) GetAssigners

func (x *Config) GetAssigners() []*Assigner

func (*Config) GetMonorailHostname

func (x *Config) GetMonorailHostname() string

func (*Config) GetRotationProxyHostname

func (x *Config) GetRotationProxyHostname() string

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 IssueQuery

type IssueQuery struct {

	// Free-form text query.
	Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"`
	// String name of the projects to search issues for, e.g. "chromium".
	ProjectNames []string `protobuf:"bytes,2,rep,name=project_names,json=projectNames,proto3" json:"project_names,omitempty"`
	// contains filtered or unexported fields
}

IssueQuery describes the issue query to be used for searching unassigned issues in Monorail.

func (*IssueQuery) Descriptor deprecated

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

Deprecated: Use IssueQuery.ProtoReflect.Descriptor instead.

func (*IssueQuery) GetProjectNames

func (x *IssueQuery) GetProjectNames() []string

func (*IssueQuery) GetQ

func (x *IssueQuery) GetQ() string

func (*IssueQuery) IsEqual

func (lhs *IssueQuery) IsEqual(rhs *IssueQuery) bool

IsEqual returns whether the IssueQuery objects are equal.

func (*IssueQuery) ProtoMessage

func (*IssueQuery) ProtoMessage()

func (*IssueQuery) ProtoReflect

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

func (*IssueQuery) Reset

func (x *IssueQuery) Reset()

func (*IssueQuery) String

func (x *IssueQuery) String() string

type Oncall

type Oncall struct {

	// Deprecated: Use Rotation.name instead.
	Rotation string `protobuf:"bytes,1,opt,name=rotation,proto3" json:"rotation,omitempty"`
	// The oncall position in the shift.
	Position Oncall_Position `protobuf:"varint,2,opt,name=position,proto3,enum=arquebus.config.Oncall_Position" json:"position,omitempty"`
	// The name of the rotation.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Oncall represents a rotation shift modelled in Rotation Proxy. Next ID: 4

func (*Oncall) Descriptor deprecated

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

Deprecated: Use Oncall.ProtoReflect.Descriptor instead.

func (*Oncall) GetName

func (x *Oncall) GetName() string

func (*Oncall) GetPosition

func (x *Oncall) GetPosition() Oncall_Position

func (*Oncall) GetRotation

func (x *Oncall) GetRotation() string

func (*Oncall) ProtoMessage

func (*Oncall) ProtoMessage()

func (*Oncall) ProtoReflect

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

func (*Oncall) Reset

func (x *Oncall) Reset()

func (*Oncall) String

func (x *Oncall) String() string

type Oncall_Position

type Oncall_Position int32
const (
	Oncall_UNSET     Oncall_Position = 0
	Oncall_PRIMARY   Oncall_Position = 1
	Oncall_SECONDARY Oncall_Position = 2
)

func (Oncall_Position) Descriptor

func (Oncall_Position) Enum

func (x Oncall_Position) Enum() *Oncall_Position

func (Oncall_Position) EnumDescriptor deprecated

func (Oncall_Position) EnumDescriptor() ([]byte, []int)

Deprecated: Use Oncall_Position.Descriptor instead.

func (Oncall_Position) Number

func (Oncall_Position) String

func (x Oncall_Position) String() string

func (Oncall_Position) Type

type UserSource

type UserSource struct {

	// Types that are assignable to From:
	//	*UserSource_Email
	//	*UserSource_Rotation
	From isUserSource_From `protobuf_oneof:"from"`
	// contains filtered or unexported fields
}

UserSource represents a single source to find a valid Monorail user to whom Arquebus will assign or cc issues found.

func (*UserSource) Descriptor deprecated

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

Deprecated: Use UserSource.ProtoReflect.Descriptor instead.

func (*UserSource) GetEmail

func (x *UserSource) GetEmail() string

func (*UserSource) GetFrom

func (m *UserSource) GetFrom() isUserSource_From

func (*UserSource) GetRotation

func (x *UserSource) GetRotation() *Oncall

func (*UserSource) ProtoMessage

func (*UserSource) ProtoMessage()

func (*UserSource) ProtoReflect

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

func (*UserSource) Reset

func (x *UserSource) Reset()

func (*UserSource) String

func (x *UserSource) String() string

type UserSource_Email

type UserSource_Email struct {
	// The email address of a Monorail user account.
	Email string `protobuf:"bytes,2,opt,name=email,proto3,oneof"` // e.g., user@chromium.org
}

type UserSource_Rotation

type UserSource_Rotation struct {
	// Represents a rotation shift modelled in rotation-proxy.
	Rotation *Oncall `protobuf:"bytes,3,opt,name=rotation,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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