Documentation ¶
Overview ¶
package prjinternal stores protos for event processing of ProjectManager.
Index ¶
- Constants
- Variables
- func FormatLogReasons(in []LogReason) string
- func InstallMockDispatcher(ctx context.Context, f func(luciProject string, eta time.Time)) context.Context
- func MakeCLsUpdated(cls []*changelist.CL) *changelist.CLUpdatedEvents
- func SortPRuns(pruns []*PRun)
- type Component
- func (component *Component) COWPRuns(m func(*PRun) *PRun, toAdd []*PRun) ([]*PRun, bool)
- func (c *Component) CloneShallow() *Component
- func (*Component) Descriptor() ([]byte, []int)deprecated
- func (x *Component) GetClids() []int64
- func (x *Component) GetDecisionTime() *timestamppb.Timestamp
- func (x *Component) GetPruns() []*PRun
- func (x *Component) GetTriageRequired() bool
- func (*Component) ProtoMessage()
- func (x *Component) ProtoReflect() protoreflect.Message
- func (x *Component) Reset()
- func (x *Component) String() string
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetClUpdated() *changelist.CLUpdatedEvent
- func (x *Event) GetClsUpdated() *changelist.CLUpdatedEvents
- func (m *Event) GetEvent() isEvent_Event
- func (x *Event) GetNewConfig() *NewConfig
- func (x *Event) GetPoke() *Poke
- func (x *Event) GetPurgeCompleted() *PurgeCompleted
- func (x *Event) GetRunCreated() *RunCreated
- func (x *Event) GetRunFinished() *RunFinished
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type Event_ClUpdated
- type Event_ClsUpdated
- type Event_NewConfig
- type Event_Poke
- type Event_PurgeCompleted
- type Event_RunCreated
- type Event_RunFinished
- type KickManageProjectTask
- func (*KickManageProjectTask) Descriptor() ([]byte, []int)deprecated
- func (x *KickManageProjectTask) GetEta() *timestamppb.Timestamp
- func (x *KickManageProjectTask) GetLuciProject() string
- func (*KickManageProjectTask) ProtoMessage()
- func (x *KickManageProjectTask) ProtoReflect() protoreflect.Message
- func (x *KickManageProjectTask) Reset()
- func (x *KickManageProjectTask) String() string
- type LogReason
- type LogReasons
- type ManageProjectTask
- func (*ManageProjectTask) Descriptor() ([]byte, []int)deprecated
- func (x *ManageProjectTask) GetEta() *timestamppb.Timestamp
- func (x *ManageProjectTask) GetLuciProject() string
- func (*ManageProjectTask) ProtoMessage()
- func (x *ManageProjectTask) ProtoReflect() protoreflect.Message
- func (x *ManageProjectTask) Reset()
- func (x *ManageProjectTask) String() string
- type NewConfig
- type PCL
- func (*PCL) Descriptor() ([]byte, []int)deprecated
- func (x *PCL) GetClid() int64
- func (x *PCL) GetConfigGroupIndexes() []int32
- func (x *PCL) GetDeps() []*changelist.Dep
- func (x *PCL) GetErrors() []*changelist.CLError
- func (x *PCL) GetEversion() int64
- func (x *PCL) GetStatus() PCL_Status
- func (x *PCL) GetSubmitted() bool
- func (x *PCL) GetTrigger() *run.Trigger
- func (*PCL) ProtoMessage()
- func (x *PCL) ProtoReflect() protoreflect.Message
- func (x *PCL) Reset()
- func (x *PCL) String() string
- type PCL_Status
- type PRun
- type PState
- func (p *PState) COWComponents(m func(*Component) *Component, toAdd []*Component) ([]*Component, bool)
- func (p *PState) COWCreatedRuns(m func(*PRun) *PRun, toAdd []*PRun) ([]*PRun, bool)
- func (p *PState) COWPCLs(m func(*PCL) *PCL, toAdd []*PCL) ([]*PCL, bool)
- func (p *PState) COWPurgingCLs(m func(*PurgingCL) *PurgingCL, toAdd []*PurgingCL) ([]*PurgingCL, bool)
- func (*PState) Descriptor() ([]byte, []int)deprecated
- func (x *PState) GetComponents() []*Component
- func (x *PState) GetConfigGroupNames() []string
- func (x *PState) GetConfigHash() string
- func (x *PState) GetCreatedPruns() []*PRun
- func (x *PState) GetLuciProject() string
- func (x *PState) GetNextEvalTime() *timestamppb.Timestamp
- func (x *PState) GetPcls() []*PCL
- func (x *PState) GetPurgingCls() []*PurgingCL
- func (x *PState) GetRepartitionRequired() bool
- func (x *PState) GetStatus() Status
- func (p *PState) IncompleteRuns() (ids common.RunIDs)
- func (p *PState) IterIncompleteRuns(callback func(r *PRun, c *Component) (stop bool))
- func (*PState) ProtoMessage()
- func (x *PState) ProtoReflect() protoreflect.Message
- func (x *PState) Reset()
- func (x *PState) String() string
- type Poke
- type PurgeCLTask
- func (*PurgeCLTask) Descriptor() ([]byte, []int)deprecated
- func (x *PurgeCLTask) GetLuciProject() string
- func (x *PurgeCLTask) GetPurgingCl() *PurgingCL
- func (x *PurgeCLTask) GetReasons() []*changelist.CLError
- func (x *PurgeCLTask) GetTrigger() *run.Trigger
- func (*PurgeCLTask) ProtoMessage()
- func (x *PurgeCLTask) ProtoReflect() protoreflect.Message
- func (x *PurgeCLTask) Reset()
- func (x *PurgeCLTask) String() string
- type PurgeCompleted
- type PurgingCL
- func (*PurgingCL) Descriptor() ([]byte, []int)deprecated
- func (x *PurgingCL) GetClid() int64
- func (x *PurgingCL) GetDeadline() *timestamppb.Timestamp
- func (x *PurgingCL) GetOperationId() string
- func (*PurgingCL) ProtoMessage()
- func (x *PurgingCL) ProtoReflect() protoreflect.Message
- func (x *PurgingCL) Reset()
- func (x *PurgingCL) String() string
- type RunCreated
- type RunFinished
- type Status
- type TasksBinding
Constants ¶
const ( // PMTaskInterval is target frequency of executions of ManageProjectTask. // // See Dispatch() for details. PMTaskInterval = time.Second // MaxAcceptableDelay prevents TQ tasks which arrive too late from invoking PM. // // MaxAcceptableDelay / PMTaskInterval effectively limits # concurrent // invocations of PM on the same project that may happen due to task retries, // delays, and queue throttling. // // Do not set too low, as this may prevent actual PM invoking from happening at // all if the TQ is overloaded. MaxAcceptableDelay = 60 * time.Second ManageProjectTaskClass = "manage-project" KickManageProjectTaskClass = "kick-" + ManageProjectTaskClass PurgeProjectCLTaskClass = "purge-project-cl" )
Variables ¶
var ( Status_name = map[int32]string{ 0: "STATUS_UNSPECIFIED", 1: "STARTED", 2: "STOPPING", 3: "STOPPED", } Status_value = map[string]int32{ "STATUS_UNSPECIFIED": 0, "STARTED": 1, "STOPPING": 2, "STOPPED": 3, } )
Enum value maps for Status.
var ( LogReason_name = map[int32]string{ 0: "LOG_REASON_UNSPECIFIED", 1: "FYI_PERIODIC", 2: "STATUS_CHANGED", 3: "CONFIG_CHANGED", 4: "DEBUG", } LogReason_value = map[string]int32{ "LOG_REASON_UNSPECIFIED": 0, "FYI_PERIODIC": 1, "STATUS_CHANGED": 2, "CONFIG_CHANGED": 3, "DEBUG": 4, } )
Enum value maps for LogReason.
var ( PCL_Status_name = map[int32]string{ 0: "PCL_STATUS_UNSPECIFIED", 1: "UNKNOWN", 2: "UNWATCHED", 3: "DELETED", } PCL_Status_value = map[string]int32{ "PCL_STATUS_UNSPECIFIED": 0, "OK": 0, "UNKNOWN": 1, "UNWATCHED": 2, "DELETED": 3, } )
Enum value maps for PCL_Status.
var File_go_chromium_org_luci_cv_internal_prjmanager_prjpb_events_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_cv_internal_prjmanager_prjpb_storage_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_cv_internal_prjmanager_prjpb_tasks_proto protoreflect.FileDescriptor
Functions ¶
func FormatLogReasons ¶
FormatLogReasons produces "[HUMAN, READABLE]" string for a list of statuses.
func InstallMockDispatcher ¶
func InstallMockDispatcher(ctx context.Context, f func(luciProject string, eta time.Time)) context.Context
InstallMockDispatcher is used in test to run tests emitting PM events without actually dispatching PM tasks.
See pmtest.MockDispatch().
func MakeCLsUpdated ¶
func MakeCLsUpdated(cls []*changelist.CL) *changelist.CLUpdatedEvents
MakeCLsUpdated returns CLsUpdated given the CLs.
In each given CL, .ID and .EVersion must be set.
Types ¶
type Component ¶
type Component struct { // CL IDs of the tracked CLs in this component. Sorted. // // Each referenced CL must be in PState.PCLs list. // Each referenced CL may have deps not in this list if they are either // PCL.Status.UNKNOWN or PCL.Status.UNWATCHED. // // A referenced CL is normally watched by this LUCI project. In rare cases, // referenced CL is no longer watched by this LUCI project but is still kept // in a component because the CL is still a member of an incomplete Run in // this component. In this case, the CL's deps are no longer tracked. Clids []int64 `protobuf:"varint,1,rep,packed,name=clids,proto3" json:"clids,omitempty"` // Decision time is the earliest time when this component should be // re-evaluated. // // Can be set to far future meaning no need for re-evaluation without an // external event (e.g., CLUpdated or RunFinished). DecisionTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=decision_time,json=decisionTime,proto3" json:"decision_time,omitempty"` // Incomplete Runs working on CLs from this component. // // Sorted by Run's ID. Pruns []*PRun `protobuf:"bytes,3,rep,name=pruns,proto3" json:"pruns,omitempty"` // If true, this component must be triaged as soon as possible. TriageRequired bool `protobuf:"varint,11,opt,name=triage_required,json=triageRequired,proto3" json:"triage_required,omitempty"` // contains filtered or unexported fields }
Component is a set of CLs related to each other.
func (*Component) CloneShallow ¶
CloneShallow creates a new shallow clone.
func (*Component) Descriptor
deprecated
func (*Component) GetDecisionTime ¶
func (x *Component) GetDecisionTime() *timestamppb.Timestamp
func (*Component) GetTriageRequired ¶
func (*Component) ProtoMessage ¶
func (*Component) ProtoMessage()
func (*Component) ProtoReflect ¶
func (x *Component) ProtoReflect() protoreflect.Message
type Event ¶
type Event struct { // Types that are assignable to Event: // *Event_NewConfig // *Event_Poke // *Event_ClUpdated // *Event_ClsUpdated // *Event_RunCreated // *Event_RunFinished // *Event_PurgeCompleted Event isEvent_Event `protobuf_oneof:"event"` // contains filtered or unexported fields }
Event is a container for all kinds of events a project manager can receive.
func (*Event) Descriptor
deprecated
func (*Event) GetClUpdated ¶
func (x *Event) GetClUpdated() *changelist.CLUpdatedEvent
func (*Event) GetClsUpdated ¶
func (x *Event) GetClsUpdated() *changelist.CLUpdatedEvents
func (*Event) GetNewConfig ¶
func (*Event) GetPurgeCompleted ¶
func (x *Event) GetPurgeCompleted() *PurgeCompleted
func (*Event) GetRunCreated ¶
func (x *Event) GetRunCreated() *RunCreated
func (*Event) GetRunFinished ¶
func (x *Event) GetRunFinished() *RunFinished
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type Event_ClUpdated ¶
type Event_ClUpdated struct { // Deprecated. Use batch version only. ClUpdated *changelist.CLUpdatedEvent `protobuf:"bytes,3,opt,name=cl_updated,json=clUpdated,proto3,oneof"` }
type Event_ClsUpdated ¶
type Event_ClsUpdated struct {
ClsUpdated *changelist.CLUpdatedEvents `protobuf:"bytes,7,opt,name=cls_updated,json=clsUpdated,proto3,oneof"`
}
type Event_NewConfig ¶
type Event_NewConfig struct {
NewConfig *NewConfig `protobuf:"bytes,1,opt,name=new_config,json=newConfig,proto3,oneof"`
}
type Event_Poke ¶
type Event_Poke struct {
Poke *Poke `protobuf:"bytes,2,opt,name=poke,proto3,oneof"`
}
type Event_PurgeCompleted ¶
type Event_PurgeCompleted struct {
PurgeCompleted *PurgeCompleted `protobuf:"bytes,6,opt,name=purge_completed,json=purgeCompleted,proto3,oneof"`
}
type Event_RunCreated ¶
type Event_RunCreated struct {
RunCreated *RunCreated `protobuf:"bytes,4,opt,name=run_created,json=runCreated,proto3,oneof"`
}
type Event_RunFinished ¶
type Event_RunFinished struct {
RunFinished *RunFinished `protobuf:"bytes,5,opt,name=run_finished,json=runFinished,proto3,oneof"`
}
type KickManageProjectTask ¶
type KickManageProjectTask struct { LuciProject string `protobuf:"bytes,1,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"` Eta *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=eta,proto3" json:"eta,omitempty"` // contains filtered or unexported fields }
KickManageProjectTask starts a task to actually enqueue ManageProjectTask.
It exists in order to send a deduplicatable ManageProjectTask from a transaction.
Queue: "kick-manage-project".
func (*KickManageProjectTask) Descriptor
deprecated
func (*KickManageProjectTask) Descriptor() ([]byte, []int)
Deprecated: Use KickManageProjectTask.ProtoReflect.Descriptor instead.
func (*KickManageProjectTask) GetEta ¶
func (x *KickManageProjectTask) GetEta() *timestamppb.Timestamp
func (*KickManageProjectTask) GetLuciProject ¶
func (x *KickManageProjectTask) GetLuciProject() string
func (*KickManageProjectTask) ProtoMessage ¶
func (*KickManageProjectTask) ProtoMessage()
func (*KickManageProjectTask) ProtoReflect ¶
func (x *KickManageProjectTask) ProtoReflect() protoreflect.Message
func (*KickManageProjectTask) Reset ¶
func (x *KickManageProjectTask) Reset()
func (*KickManageProjectTask) String ¶
func (x *KickManageProjectTask) String() string
type LogReason ¶
type LogReason int32
LogReason records why a change to the project state was logged.
See ProjectLog entity.
const ( LogReason_LOG_REASON_UNSPECIFIED LogReason = 0 // Due to passage of time or number of versions. LogReason_FYI_PERIODIC LogReason = 1 LogReason_STATUS_CHANGED LogReason = 2 LogReason_CONFIG_CHANGED LogReason = 3 // On-demand save for debugging reasons, e.g. on caught panic. LogReason_DEBUG LogReason = 4 )
func SortAndDedupeLogReasons ¶
SortAndDedupeLogReasons does what its name says without modifying input.
func (LogReason) Descriptor ¶
func (LogReason) Descriptor() protoreflect.EnumDescriptor
func (LogReason) EnumDescriptor
deprecated
func (LogReason) Number ¶
func (x LogReason) Number() protoreflect.EnumNumber
func (LogReason) Type ¶
func (LogReason) Type() protoreflect.EnumType
type LogReasons ¶
type LogReasons struct { Reasons []LogReason `protobuf:"varint,1,rep,packed,name=reasons,proto3,enum=cv.internal.prjmanager.prjpb.LogReason" json:"reasons,omitempty"` // contains filtered or unexported fields }
func (*LogReasons) Descriptor
deprecated
func (*LogReasons) Descriptor() ([]byte, []int)
Deprecated: Use LogReasons.ProtoReflect.Descriptor instead.
func (*LogReasons) GetReasons ¶
func (x *LogReasons) GetReasons() []LogReason
func (*LogReasons) ProtoMessage ¶
func (*LogReasons) ProtoMessage()
func (*LogReasons) ProtoReflect ¶
func (x *LogReasons) ProtoReflect() protoreflect.Message
func (*LogReasons) Reset ¶
func (x *LogReasons) Reset()
func (*LogReasons) String ¶
func (x *LogReasons) String() string
type ManageProjectTask ¶
type ManageProjectTask struct { LuciProject string `protobuf:"bytes,1,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"` Eta *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=eta,proto3" json:"eta,omitempty"` // contains filtered or unexported fields }
ManageProjectTask sends a signal to ProjectManager to process events.
Always used with de-duplication and thus can't be created from a transaction.
Queue: "manage-project".
func (*ManageProjectTask) Descriptor
deprecated
func (*ManageProjectTask) Descriptor() ([]byte, []int)
Deprecated: Use ManageProjectTask.ProtoReflect.Descriptor instead.
func (*ManageProjectTask) GetEta ¶
func (x *ManageProjectTask) GetEta() *timestamppb.Timestamp
func (*ManageProjectTask) GetLuciProject ¶
func (x *ManageProjectTask) GetLuciProject() string
func (*ManageProjectTask) ProtoMessage ¶
func (*ManageProjectTask) ProtoMessage()
func (*ManageProjectTask) ProtoReflect ¶
func (x *ManageProjectTask) ProtoReflect() protoreflect.Message
func (*ManageProjectTask) Reset ¶
func (x *ManageProjectTask) Reset()
func (*ManageProjectTask) String ¶
func (x *ManageProjectTask) String() string
type NewConfig ¶
type NewConfig struct {
// contains filtered or unexported fields
}
NewConfig is sent to PM by Project Config updater upon saving newest config in datastore.
func (*NewConfig) Descriptor
deprecated
func (*NewConfig) ProtoMessage ¶
func (*NewConfig) ProtoMessage()
func (*NewConfig) ProtoReflect ¶
func (x *NewConfig) ProtoReflect() protoreflect.Message
type PCL ¶
type PCL struct { Clid int64 `protobuf:"varint,1,opt,name=clid,proto3" json:"clid,omitempty"` Eversion int64 `protobuf:"varint,2,opt,name=eversion,proto3" json:"eversion,omitempty"` Status PCL_Status `protobuf:"varint,3,opt,name=status,proto3,enum=cv.internal.prjmanager.prjpb.PCL_Status" json:"status,omitempty"` // Indexes in PState.config_group_names identifying ConfigGroup which watches // this CL. // // Normally, contains exactly 1 index. // May have > 1 index, which means 2+ non-fallback config groups watch this // CL, which is not allowed and will be signalled to CV users. // TODO(tandrii): move >1 index case to be tracked via `errors` field. ConfigGroupIndexes []int32 `protobuf:"varint,4,rep,packed,name=config_group_indexes,json=configGroupIndexes,proto3" json:"config_group_indexes,omitempty"` // Deps refers to CLs in PState.PCLs which are dependencies of the PCL. Deps []*changelist.Dep `protobuf:"bytes,11,rep,name=deps,proto3" json:"deps,omitempty"` // Trigger is CQDaemon-compatible record of who/when triggered CQ on this CL. // // It may be nil, if CL is not triggered but nevertheless tracked as either: // * a dependency of another CL. // * previously triggered member of an incomplete Run, which is probably // being finalized right now by its Run Manager. // // TODO(tandrii): don't store potentially long user's email, // which isn't necessary for PM decision making. It should be (re)-computed // based on CL snapshots at the time only when actual Run is actually being // created. Trigger *run.Trigger `protobuf:"bytes,12,opt,name=trigger,proto3" json:"trigger,omitempty"` // Submitted means CV isn't going to work on a CL, but CL is still tracked as // a dep of another CL or as a member of an incomplete Run (though the other // Run will probably finish soon). Submitted bool `protobuf:"varint,13,opt,name=submitted,proto3" json:"submitted,omitempty"` // If set, describes one or more problems with CL. Errors []*changelist.CLError `protobuf:"bytes,15,rep,name=errors,proto3" json:"errors,omitempty"` // contains filtered or unexported fields }
PCL is a tracked CL.
func (*PCL) Descriptor
deprecated
func (*PCL) GetConfigGroupIndexes ¶
func (*PCL) GetDeps ¶
func (x *PCL) GetDeps() []*changelist.Dep
func (*PCL) GetErrors ¶
func (x *PCL) GetErrors() []*changelist.CLError
func (*PCL) GetEversion ¶
func (*PCL) GetStatus ¶
func (x *PCL) GetStatus() PCL_Status
func (*PCL) GetSubmitted ¶
func (*PCL) GetTrigger ¶
func (*PCL) ProtoMessage ¶
func (*PCL) ProtoMessage()
func (*PCL) ProtoReflect ¶
func (x *PCL) ProtoReflect() protoreflect.Message
type PCL_Status ¶
type PCL_Status int32
const ( PCL_PCL_STATUS_UNSPECIFIED PCL_Status = 0 // OK means CL metadata below is correct and CL is watched by this project. // // Value 0 is chosen such that it's not serialized, since this is the most // common state. PCL_OK PCL_Status = 0 // UNKNOWN means Datastore CL entity doesn't have the info yet. PCL_UNKNOWN PCL_Status = 1 // UNWATCHED means CL isn't watched by this LUCI project. PCL_UNWATCHED PCL_Status = 2 // DELETED means CL's Datastore entity got deleted. // // This is used to temporary mark a PCL before deleting it entirely from // PState to avoid dangling references from components. PCL_DELETED PCL_Status = 3 )
func (PCL_Status) Descriptor ¶
func (PCL_Status) Descriptor() protoreflect.EnumDescriptor
func (PCL_Status) Enum ¶
func (x PCL_Status) Enum() *PCL_Status
func (PCL_Status) EnumDescriptor
deprecated
func (PCL_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use PCL_Status.Descriptor instead.
func (PCL_Status) Number ¶
func (x PCL_Status) Number() protoreflect.EnumNumber
func (PCL_Status) String ¶
func (x PCL_Status) String() string
func (PCL_Status) Type ¶
func (PCL_Status) Type() protoreflect.EnumType
type PRun ¶
type PRun struct { // CV's Run ID. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // IDs of CLs involved. Sorted. // // Actual Run may orders its CLs in a different way. Clids []int64 `protobuf:"varint,2,rep,packed,name=clids,proto3" json:"clids,omitempty"` // contains filtered or unexported fields }
PRun is an incomplete Run on which CV is currently working.
It is referenced by at most 1 component.
func (*PRun) Descriptor
deprecated
func (*PRun) ProtoMessage ¶
func (*PRun) ProtoMessage()
func (*PRun) ProtoReflect ¶
func (x *PRun) ProtoReflect() protoreflect.Message
type PState ¶
type PState struct { // Name of LUCI project. LuciProject string `protobuf:"bytes,1,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"` // Status of the Project. Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=cv.internal.prjmanager.prjpb.Status" json:"status,omitempty"` // Config hash pins specific project config version. ConfigHash string `protobuf:"bytes,3,opt,name=config_hash,json=configHash,proto3" json:"config_hash,omitempty"` // Config group names intern the names referenced in PCL entities to reduce // memory and at-rest footprint. // // See also https://en.wikipedia.org/wiki/String_interning. ConfigGroupNames []string `protobuf:"bytes,4,rep,name=config_group_names,json=configGroupNames,proto3" json:"config_group_names,omitempty"` // PCLs are currently tracked CLs. // // Includes deps which are of not yet known kind (because CL doesn't yet have // a snapshot) or unwatched. // // Sorted by CL ID. Pcls []*PCL `protobuf:"bytes,11,rep,name=pcls,proto3" json:"pcls,omitempty"` // Components are a partition of CLs in the list above. // // An active CL (watched or used to be watched and still member of a Run) may // belong to at most 1 component, while unwatched dep may be referenced by // several. Components []*Component `protobuf:"bytes,12,rep,name=components,proto3" json:"components,omitempty"` // PurgingCLs are CLs currently being purged. // // They are tracked in PState to avoid creating Runs with such CLs. // // A CL being purged does not necessarily have a corresponding PCL. // A PurgingCL is kept in PState until purging process stops, regardless of // successful or failed. // // See more in PurgingCL doc. // // Sorted by CL ID. PurgingCls []*PurgingCL `protobuf:"bytes,13,rep,name=purging_cls,json=purgingCls,proto3" json:"purging_cls,omitempty"` // If true, components partition must be redone as soon as possible. RepartitionRequired bool `protobuf:"varint,21,opt,name=repartition_required,json=repartitionRequired,proto3" json:"repartition_required,omitempty"` // PRuns which can't yet be added to any component but should be. Sorted by // Run ID. // // In response to OnRunCreated event, PM may append to this list new Runs if // either: // * not all Run's CLs are already known to PM; // * Run's CLs are currently partitioned into different components. // // Thus, // * CLs referenced by these PRuns may not be tracked; // * If this field is not empty, re-partioning may be required. CreatedPruns []*PRun `protobuf:"bytes,22,rep,name=created_pruns,json=createdPruns,proto3" json:"created_pruns,omitempty"` // If set, establishes when components should be re-evaluated. NextEvalTime *timestamppb.Timestamp `protobuf:"bytes,23,opt,name=next_eval_time,json=nextEvalTime,proto3" json:"next_eval_time,omitempty"` // contains filtered or unexported fields }
PState is the PM state of a specific LUCI project.
Semantically, it's a collection of CLs somehow grouped into components (see Component message below), each of which may have several active (a.k.a. Incomplete) Runs valid at a specific project's config version.
Most CLs are watched by the LUCI project, but to assist with error reporting, it also tracks unwatched CLs if they are dependencies of some actually watched CLs.
func (*PState) COWComponents ¶
func (p *PState) COWComponents(m func(*Component) *Component, toAdd []*Component) ([]*Component, bool)
COWComponents copy-on-write modifies components.
func (*PState) COWCreatedRuns ¶
COWCreatedRuns copy-on-write modifies CreatedRuns.
func (*PState) COWPurgingCLs ¶
func (p *PState) COWPurgingCLs(m func(*PurgingCL) *PurgingCL, toAdd []*PurgingCL) ([]*PurgingCL, bool)
COWPurgingCLs copy-on-write modifies PurgingCLs.
func (*PState) Descriptor
deprecated
func (*PState) GetComponents ¶
func (*PState) GetConfigGroupNames ¶
func (*PState) GetConfigHash ¶
func (*PState) GetCreatedPruns ¶
func (*PState) GetLuciProject ¶
func (*PState) GetNextEvalTime ¶
func (x *PState) GetNextEvalTime() *timestamppb.Timestamp
func (*PState) GetPurgingCls ¶
func (*PState) GetRepartitionRequired ¶
func (*PState) IncompleteRuns ¶
IncompleteRuns are IDs of Runs which aren't yet completed.
func (*PState) IterIncompleteRuns ¶
IterIncompleteRuns executes callback on each tracked Run.
Callback is given a Component if Run is assigned to a component, or a nil Component if Run is part of `.CreatedRuns` not yet assigned to any component. Stops iteration if callback returns true.
func (*PState) ProtoMessage ¶
func (*PState) ProtoMessage()
func (*PState) ProtoReflect ¶
func (x *PState) ProtoReflect() protoreflect.Message
type Poke ¶
type Poke struct {
// contains filtered or unexported fields
}
Poke is sent to PM by Project Config updater.
func (*Poke) Descriptor
deprecated
func (*Poke) ProtoMessage ¶
func (*Poke) ProtoMessage()
func (*Poke) ProtoReflect ¶
func (x *Poke) ProtoReflect() protoreflect.Message
type PurgeCLTask ¶
type PurgeCLTask struct { LuciProject string `protobuf:"bytes,1,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"` PurgingCl *PurgingCL `protobuf:"bytes,2,opt,name=purging_cl,json=purgingCl,proto3" json:"purging_cl,omitempty"` Trigger *run.Trigger `protobuf:"bytes,3,opt,name=trigger,proto3" json:"trigger,omitempty"` Reasons []*changelist.CLError `protobuf:"bytes,5,rep,name=reasons,proto3" json:"reasons,omitempty"` // contains filtered or unexported fields }
PurgeCLTask starts a task to purge a CL.
Queue: "purge-project-cl".
func (*PurgeCLTask) Descriptor
deprecated
func (*PurgeCLTask) Descriptor() ([]byte, []int)
Deprecated: Use PurgeCLTask.ProtoReflect.Descriptor instead.
func (*PurgeCLTask) GetLuciProject ¶
func (x *PurgeCLTask) GetLuciProject() string
func (*PurgeCLTask) GetPurgingCl ¶
func (x *PurgeCLTask) GetPurgingCl() *PurgingCL
func (*PurgeCLTask) GetReasons ¶
func (x *PurgeCLTask) GetReasons() []*changelist.CLError
func (*PurgeCLTask) GetTrigger ¶
func (x *PurgeCLTask) GetTrigger() *run.Trigger
func (*PurgeCLTask) ProtoMessage ¶
func (*PurgeCLTask) ProtoMessage()
func (*PurgeCLTask) ProtoReflect ¶
func (x *PurgeCLTask) ProtoReflect() protoreflect.Message
func (*PurgeCLTask) Reset ¶
func (x *PurgeCLTask) Reset()
func (*PurgeCLTask) String ¶
func (x *PurgeCLTask) String() string
type PurgeCompleted ¶
type PurgeCompleted struct { // Operation ID suffices to identify a purge. OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` // contains filtered or unexported fields }
PurgingCompleted is sent to PM by TQ task purging a CL.
See storage.proto:PurgingCL doc.
There is no status of the purge because it's the CL state that matters, hence success or failure will reach PM via CLUpdatedEvent.
func (*PurgeCompleted) Descriptor
deprecated
func (*PurgeCompleted) Descriptor() ([]byte, []int)
Deprecated: Use PurgeCompleted.ProtoReflect.Descriptor instead.
func (*PurgeCompleted) GetOperationId ¶
func (x *PurgeCompleted) GetOperationId() string
func (*PurgeCompleted) ProtoMessage ¶
func (*PurgeCompleted) ProtoMessage()
func (*PurgeCompleted) ProtoReflect ¶
func (x *PurgeCompleted) ProtoReflect() protoreflect.Message
func (*PurgeCompleted) Reset ¶
func (x *PurgeCompleted) Reset()
func (*PurgeCompleted) String ¶
func (x *PurgeCompleted) String() string
type PurgingCL ¶
type PurgingCL struct { // CL ID which is being purged. Clid int64 `protobuf:"varint,1,opt,name=clid,proto3" json:"clid,omitempty"` // Operation ID is a unique within a project identifier of a purge operation // to use in PurgeCompleted events. OperationId string `protobuf:"bytes,2,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` // Deadline is obeyed by the purging TQ task. // // TQ task SHOULD not modify a CL (e.g. via Gerrit RPCs) beyond this point. // This is merely best effort, as an RPC to external system initiated before // this deadline may still complete after it. // // If PM doesn't receive PurgeCompleted event before this deadline + some grace // period, PM will consider purge operation expired and it'll be removed from // PState. Deadline *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=deadline,proto3" json:"deadline,omitempty"` // contains filtered or unexported fields }
PurgingCL represents purging of a CL due to some problem.
The purging process is initiated during PM state mutation while atomically adding a TQ task to perform the actual purge.
Purging itself constitutes removing whatever triggered CV on a CL as well as posting the reason for purging to the user.
Individual CLs are purged independently, even if CLs are related.
Upon TQ task completion, the task handler notifies PM back via an PurgeCompleted event. For fail-safe reasons, there is a deadline to perform the purge. PM keeps the PurgingCL in PState until either deadline is reached OR PurgeCompleted event is received.
func (*PurgingCL) Descriptor
deprecated
func (*PurgingCL) GetDeadline ¶
func (x *PurgingCL) GetDeadline() *timestamppb.Timestamp
func (*PurgingCL) GetOperationId ¶
func (*PurgingCL) ProtoMessage ¶
func (*PurgingCL) ProtoMessage()
func (*PurgingCL) ProtoReflect ¶
func (x *PurgingCL) ProtoReflect() protoreflect.Message
type RunCreated ¶
type RunCreated struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` // contains filtered or unexported fields }
RunCreated is sent to PM by either itself or API-based Run creation.
func (*RunCreated) Descriptor
deprecated
func (*RunCreated) Descriptor() ([]byte, []int)
Deprecated: Use RunCreated.ProtoReflect.Descriptor instead.
func (*RunCreated) GetRunId ¶
func (x *RunCreated) GetRunId() string
func (*RunCreated) ProtoMessage ¶
func (*RunCreated) ProtoMessage()
func (*RunCreated) ProtoReflect ¶
func (x *RunCreated) ProtoReflect() protoreflect.Message
func (*RunCreated) Reset ¶
func (x *RunCreated) Reset()
func (*RunCreated) String ¶
func (x *RunCreated) String() string
type RunFinished ¶
type RunFinished struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` // contains filtered or unexported fields }
RunFinished is sent to PM by Run Manager after or atomically with changing Run's status to a final status.
func (*RunFinished) Descriptor
deprecated
func (*RunFinished) Descriptor() ([]byte, []int)
Deprecated: Use RunFinished.ProtoReflect.Descriptor instead.
func (*RunFinished) GetRunId ¶
func (x *RunFinished) GetRunId() string
func (*RunFinished) ProtoMessage ¶
func (*RunFinished) ProtoMessage()
func (*RunFinished) ProtoReflect ¶
func (x *RunFinished) ProtoReflect() protoreflect.Message
func (*RunFinished) Reset ¶
func (x *RunFinished) Reset()
func (*RunFinished) String ¶
func (x *RunFinished) String() string
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type TasksBinding ¶
type TasksBinding struct { ManageProject tq.TaskClassRef KickManageProject tq.TaskClassRef PurgeProjectCL tq.TaskClassRef TQDispatcher *tq.Dispatcher }
TasksBinding binds Project Manager tasks to a TQ Dispatcher.
This struct exists to separate task creation and handling, which in turns avoids circular dependency.
func Register ¶
func Register(tqd *tq.Dispatcher) TasksBinding