eventpb

package
v0.0.0-...-51f9457 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package eventpb stores protos for event processing of RunManager.

Index

Constants

View Source
const (
	// ManageRunTaskClass is the ID of ManageRunTask Class.
	ManageRunTaskClass = "manage-run"
)

Variables

View Source
var (
	SubmissionResult_name = map[int32]string{
		0: "SUBMISSION_RESULT_UNSPECIFIED",
		1: "SUCCEEDED",
		2: "FAILED_TRANSIENT",
		3: "FAILED_PERMANENT",
	}
	SubmissionResult_value = map[string]int32{
		"SUBMISSION_RESULT_UNSPECIFIED": 0,
		"SUCCEEDED":                     1,
		"FAILED_TRANSIENT":              2,
		"FAILED_PERMANENT":              3,
	}
)

Enum value maps for SubmissionResult.

View Source
var File_go_chromium_org_luci_cv_internal_run_eventpb_events_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_cv_internal_run_eventpb_tasks_proto protoreflect.FileDescriptor

Functions

func InstallMockDispatcher

func InstallMockDispatcher(ctx context.Context, f func(runID string, eta time.Time)) context.Context

InstallMockDispatcher is used in test to run tests emitting RM events without actually dispatching RM tasks.

See runtest.MockDispatch().

Types

type CLSubmitted

type CLSubmitted struct {

	// Internal ID of a CL that was submitted successfully.
	Clid int64 `protobuf:"varint,1,opt,name=clid,proto3" json:"clid,omitempty"`
	// contains filtered or unexported fields
}

func (*CLSubmitted) Descriptor deprecated

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

Deprecated: Use CLSubmitted.ProtoReflect.Descriptor instead.

func (*CLSubmitted) GetClid

func (x *CLSubmitted) GetClid() int64

func (*CLSubmitted) ProtoMessage

func (*CLSubmitted) ProtoMessage()

func (*CLSubmitted) ProtoReflect

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

func (*CLSubmitted) Reset

func (x *CLSubmitted) Reset()

func (*CLSubmitted) String

func (x *CLSubmitted) String() string

type CQDFinished

type CQDFinished struct {
	// contains filtered or unexported fields
}

func (*CQDFinished) Descriptor deprecated

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

Deprecated: Use CQDFinished.ProtoReflect.Descriptor instead.

func (*CQDFinished) ProtoMessage

func (*CQDFinished) ProtoMessage()

func (*CQDFinished) ProtoReflect

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

func (*CQDFinished) Reset

func (x *CQDFinished) Reset()

func (*CQDFinished) String

func (x *CQDFinished) String() string

type CQDVerificationCompleted

type CQDVerificationCompleted struct {
	// contains filtered or unexported fields
}

func (*CQDVerificationCompleted) Descriptor deprecated

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

Deprecated: Use CQDVerificationCompleted.ProtoReflect.Descriptor instead.

func (*CQDVerificationCompleted) ProtoMessage

func (*CQDVerificationCompleted) ProtoMessage()

func (*CQDVerificationCompleted) ProtoReflect

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

func (*CQDVerificationCompleted) Reset

func (x *CQDVerificationCompleted) Reset()

func (*CQDVerificationCompleted) String

func (x *CQDVerificationCompleted) String() string

type Cancel

type Cancel struct {
	// contains filtered or unexported fields
}

func (*Cancel) Descriptor deprecated

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

Deprecated: Use Cancel.ProtoReflect.Descriptor instead.

func (*Cancel) ProtoMessage

func (*Cancel) ProtoMessage()

func (*Cancel) ProtoReflect

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

func (*Cancel) Reset

func (x *Cancel) Reset()

func (*Cancel) String

func (x *Cancel) String() string

type Event

type Event struct {

	// Types that are assignable to Event:
	//	*Event_Start
	//	*Event_Cancel
	//	*Event_Poke
	//	*Event_NewConfig
	//	*Event_ClUpdated
	//	*Event_ReadyForSubmission
	//	*Event_ClSubmitted
	//	*Event_SubmissionCompleted
	//	*Event_CqdVerificationCompleted
	//	*Event_CqdFinished
	Event isEvent_Event `protobuf_oneof:"event"`
	// Instructs Run Manager that this event can only be processed after
	// this timestamp.
	ProcessAfter *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=process_after,json=processAfter,proto3" json:"process_after,omitempty"`
	// contains filtered or unexported fields
}

Event is a container for all kinds of events a Run Manager can receive.

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetCancel

func (x *Event) GetCancel() *Cancel

func (*Event) GetClSubmitted

func (x *Event) GetClSubmitted() *CLSubmitted

func (*Event) GetClUpdated

func (x *Event) GetClUpdated() *changelist.CLUpdatedEvent

func (*Event) GetCqdFinished

func (x *Event) GetCqdFinished() *CQDFinished

func (*Event) GetCqdVerificationCompleted

func (x *Event) GetCqdVerificationCompleted() *CQDVerificationCompleted

func (*Event) GetEvent

func (m *Event) GetEvent() isEvent_Event

func (*Event) GetNewConfig

func (x *Event) GetNewConfig() *NewConfig

func (*Event) GetPoke

func (x *Event) GetPoke() *Poke

func (*Event) GetProcessAfter

func (x *Event) GetProcessAfter() *timestamppb.Timestamp

func (*Event) GetReadyForSubmission

func (x *Event) GetReadyForSubmission() *ReadyForSubmission

func (*Event) GetStart

func (x *Event) GetStart() *Start

func (*Event) GetSubmissionCompleted

func (x *Event) GetSubmissionCompleted() *SubmissionCompleted

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type Event_Cancel

type Event_Cancel struct {
	// On Cancel event, Run Manager will cancel the Run.
	Cancel *Cancel `protobuf:"bytes,2,opt,name=cancel,proto3,oneof"`
}

type Event_ClSubmitted

type Event_ClSubmitted struct {
	// On CLSubmitted event, Run Manager will mark this CL as submitted.
	ClSubmitted *CLSubmitted `protobuf:"bytes,7,opt,name=cl_submitted,json=clSubmitted,proto3,oneof"`
}

type Event_ClUpdated

type Event_ClUpdated struct {
	// On CLUpdated event, Run Manager will decide whether to cancel the Run
	// based on the current CL state.
	//
	// Sent by Gerrit Updater if Run is inside the `IncompleteRuns` list of
	// a CL.
	// TODO(tandrii): deprecate this and transition to a batch version.
	ClUpdated *changelist.CLUpdatedEvent `protobuf:"bytes,5,opt,name=cl_updated,json=clUpdated,proto3,oneof"`
}

type Event_CqdFinished

type Event_CqdFinished struct {
	// TODO(crbug/1227523): Remove this event after migration.
	CqdFinished *CQDFinished `protobuf:"bytes,31,opt,name=cqd_finished,json=cqdFinished,proto3,oneof"`
}

type Event_CqdVerificationCompleted

type Event_CqdVerificationCompleted struct {
	// On CQDVerificationCompleted event, Run Manager will finalize the Run.
	//
	// This event is sent by migration api when CQDaemon reports a verified
	// Run back to CV.
	//
	// TODO(crbug/1141880): Remove this event after migration.
	CqdVerificationCompleted *CQDVerificationCompleted `protobuf:"bytes,30,opt,name=cqd_verification_completed,json=cqdVerificationCompleted,proto3,oneof"`
}

type Event_NewConfig

type Event_NewConfig struct {
	// On NewConfig event, Run Manager will update config the Run for the
	// given RunID.
	//
	// Sent by Project Manager, which guarantees these events are sent in order
	// of config updates. See also its `eversion` field.
	NewConfig *NewConfig `protobuf:"bytes,4,opt,name=new_config,json=newConfig,proto3,oneof"`
}

type Event_Poke

type Event_Poke struct {
	// On Poke event, Run Manager will check the state of the Run and perform
	// any action if necessary.
	//
	// Sent periodically by Project Manager.
	Poke *Poke `protobuf:"bytes,3,opt,name=poke,proto3,oneof"`
}

type Event_ReadyForSubmission

type Event_ReadyForSubmission struct {
	// On ReadyForSubmission event, Run Manager will try to submit CLs in
	// this Run.
	ReadyForSubmission *ReadyForSubmission `protobuf:"bytes,6,opt,name=ready_for_submission,json=readyForSubmission,proto3,oneof"`
}

type Event_Start

type Event_Start struct {
	// On Start event, Run Manager will start the Run.
	//
	// The Run entity must already exist.
	Start *Start `protobuf:"bytes,1,opt,name=start,proto3,oneof"`
}

type Event_SubmissionCompleted

type Event_SubmissionCompleted struct {
	// On SubmissionCompleted event, Run Manager will look at the submission
	// result and decide whether to retry this submission or succeed or fail
	// the Run.
	SubmissionCompleted *SubmissionCompleted `protobuf:"bytes,8,opt,name=submission_completed,json=submissionCompleted,proto3,oneof"`
}

type KickManageRunTask

type KickManageRunTask struct {
	RunId string                 `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	Eta   *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=eta,proto3" json:"eta,omitempty"`
	// contains filtered or unexported fields
}

KickManageRunTask starts a task to actually enqueue ManageRunTask. It exists in order to send a deduplicatable ManageRunTask from a transaction.

Queue: "kick-manage-run".

func (*KickManageRunTask) Descriptor deprecated

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

Deprecated: Use KickManageRunTask.ProtoReflect.Descriptor instead.

func (*KickManageRunTask) GetEta

func (*KickManageRunTask) GetRunId

func (x *KickManageRunTask) GetRunId() string

func (*KickManageRunTask) ProtoMessage

func (*KickManageRunTask) ProtoMessage()

func (*KickManageRunTask) ProtoReflect

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

func (*KickManageRunTask) Reset

func (x *KickManageRunTask) Reset()

func (*KickManageRunTask) String

func (x *KickManageRunTask) String() string

type ManageRunTask

type ManageRunTask struct {
	RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	// contains filtered or unexported fields
}

ManageRunTask sends a signal to RunManager to process events.

Always used with de-duplication and thus can't be created from a transaction.

Queue: "manage-run".

func (*ManageRunTask) Descriptor deprecated

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

Deprecated: Use ManageRunTask.ProtoReflect.Descriptor instead.

func (*ManageRunTask) GetRunId

func (x *ManageRunTask) GetRunId() string

func (*ManageRunTask) ProtoMessage

func (*ManageRunTask) ProtoMessage()

func (*ManageRunTask) ProtoReflect

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

func (*ManageRunTask) Reset

func (x *ManageRunTask) Reset()

func (*ManageRunTask) String

func (x *ManageRunTask) String() string

type NewConfig

type NewConfig struct {

	// Hash identifying project config version to update to.
	Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// Eversion of the project config version identify by hash.
	//
	// Provided for identifying the latest NewConfig message
	// if there are more than one outstanding NewConfig event.
	Eversion int64 `protobuf:"varint,2,opt,name=eversion,proto3" json:"eversion,omitempty"`
	// contains filtered or unexported fields
}

func (*NewConfig) Descriptor deprecated

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

Deprecated: Use NewConfig.ProtoReflect.Descriptor instead.

func (*NewConfig) GetEversion

func (x *NewConfig) GetEversion() int64

func (*NewConfig) GetHash

func (x *NewConfig) GetHash() string

func (*NewConfig) ProtoMessage

func (*NewConfig) ProtoMessage()

func (*NewConfig) ProtoReflect

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

func (*NewConfig) Reset

func (x *NewConfig) Reset()

func (*NewConfig) String

func (x *NewConfig) String() string

type Poke

type Poke struct {
	// contains filtered or unexported fields
}

func (*Poke) Descriptor deprecated

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

Deprecated: Use Poke.ProtoReflect.Descriptor instead.

func (*Poke) ProtoMessage

func (*Poke) ProtoMessage()

func (*Poke) ProtoReflect

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

func (*Poke) Reset

func (x *Poke) Reset()

func (*Poke) String

func (x *Poke) String() string

type ReadyForSubmission

type ReadyForSubmission struct {
	// contains filtered or unexported fields
}

func (*ReadyForSubmission) Descriptor deprecated

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

Deprecated: Use ReadyForSubmission.ProtoReflect.Descriptor instead.

func (*ReadyForSubmission) ProtoMessage

func (*ReadyForSubmission) ProtoMessage()

func (*ReadyForSubmission) ProtoReflect

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

func (*ReadyForSubmission) Reset

func (x *ReadyForSubmission) Reset()

func (*ReadyForSubmission) String

func (x *ReadyForSubmission) String() string

type Start

type Start struct {
	// contains filtered or unexported fields
}

func (*Start) Descriptor deprecated

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

Deprecated: Use Start.ProtoReflect.Descriptor instead.

func (*Start) ProtoMessage

func (*Start) ProtoMessage()

func (*Start) ProtoReflect

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

func (*Start) Reset

func (x *Start) Reset()

func (*Start) String

func (x *Start) String() string

type SubmissionCompleted

type SubmissionCompleted struct {

	// Result of this submission.
	Result SubmissionResult `protobuf:"varint,1,opt,name=result,proto3,enum=cv.internal.run.eventpb.SubmissionResult" json:"result,omitempty"`
	// Types that are assignable to FailureReason:
	//	*SubmissionCompleted_ClFailure
	//	*SubmissionCompleted_Timeout
	//	*SubmissionCompleted_ClFailures
	FailureReason isSubmissionCompleted_FailureReason `protobuf_oneof:"failure_reason"`
	// contains filtered or unexported fields
}

func (*SubmissionCompleted) Descriptor deprecated

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

Deprecated: Use SubmissionCompleted.ProtoReflect.Descriptor instead.

func (*SubmissionCompleted) GetClFailure deprecated

Deprecated: Do not use.

func (*SubmissionCompleted) GetClFailures

func (*SubmissionCompleted) GetFailureReason

func (m *SubmissionCompleted) GetFailureReason() isSubmissionCompleted_FailureReason

func (*SubmissionCompleted) GetResult

func (x *SubmissionCompleted) GetResult() SubmissionResult

func (*SubmissionCompleted) GetTimeout

func (x *SubmissionCompleted) GetTimeout() bool

func (*SubmissionCompleted) ProtoMessage

func (*SubmissionCompleted) ProtoMessage()

func (*SubmissionCompleted) ProtoReflect

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

func (*SubmissionCompleted) Reset

func (x *SubmissionCompleted) Reset()

func (*SubmissionCompleted) String

func (x *SubmissionCompleted) String() string

type SubmissionCompleted_CLSubmissionFailure

type SubmissionCompleted_CLSubmissionFailure struct {
	Clid    int64  `protobuf:"varint,1,opt,name=clid,proto3" json:"clid,omitempty"`      // Required
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // Required
	// contains filtered or unexported fields
}

func (*SubmissionCompleted_CLSubmissionFailure) Descriptor deprecated

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

Deprecated: Use SubmissionCompleted_CLSubmissionFailure.ProtoReflect.Descriptor instead.

func (*SubmissionCompleted_CLSubmissionFailure) GetClid

func (*SubmissionCompleted_CLSubmissionFailure) GetMessage

func (*SubmissionCompleted_CLSubmissionFailure) ProtoMessage

func (*SubmissionCompleted_CLSubmissionFailure) ProtoReflect

func (*SubmissionCompleted_CLSubmissionFailure) Reset

func (*SubmissionCompleted_CLSubmissionFailure) String

type SubmissionCompleted_CLSubmissionFailures

type SubmissionCompleted_CLSubmissionFailures struct {
	Failures []*SubmissionCompleted_CLSubmissionFailure `protobuf:"bytes,1,rep,name=failures,proto3" json:"failures,omitempty"`
	// contains filtered or unexported fields
}

func (*SubmissionCompleted_CLSubmissionFailures) Descriptor deprecated

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

Deprecated: Use SubmissionCompleted_CLSubmissionFailures.ProtoReflect.Descriptor instead.

func (*SubmissionCompleted_CLSubmissionFailures) GetFailures

func (*SubmissionCompleted_CLSubmissionFailures) ProtoMessage

func (*SubmissionCompleted_CLSubmissionFailures) ProtoReflect

func (*SubmissionCompleted_CLSubmissionFailures) Reset

func (*SubmissionCompleted_CLSubmissionFailures) String

type SubmissionCompleted_ClFailure

type SubmissionCompleted_ClFailure struct {
	// Deprecated. Use `cl_failures` instead.
	//
	// TODO(yiwzhang): delete after no event has this field set.
	//
	// Deprecated: Do not use.
	ClFailure *SubmissionCompleted_CLSubmissionFailure `protobuf:"bytes,2,opt,name=cl_failure,json=clFailure,proto3,oneof"`
}

type SubmissionCompleted_ClFailures

type SubmissionCompleted_ClFailures struct {
	// CLs that fail to submit. Could be transient or permanent.
	//
	// As of June 2021, CLs are submitted serially and submitter returns
	// immediately upon failure so `cl_failures` will have only one entry.
	// However, submitter may report multiple CL submission failures in the
	// future (e.g. CV supports parallel CL submission or CV submits a CL
	// stack in one RPC).
	ClFailures *SubmissionCompleted_CLSubmissionFailures `protobuf:"bytes,4,opt,name=cl_failures,json=clFailures,proto3,oneof"`
}

type SubmissionCompleted_Timeout

type SubmissionCompleted_Timeout struct {
	// Submission deadline is exceeded. Must be permanet failure.
	Timeout bool `protobuf:"varint,3,opt,name=timeout,proto3,oneof"`
}

type SubmissionResult

type SubmissionResult int32
const (
	SubmissionResult_SUBMISSION_RESULT_UNSPECIFIED SubmissionResult = 0
	// All CLs have been submitted successfully.
	SubmissionResult_SUCCEEDED SubmissionResult = 1
	// Encountered transient failure.
	//
	// RM should retry if the deadline hasn't been exceeded.
	SubmissionResult_FAILED_TRANSIENT SubmissionResult = 2
	// Encountered permanent failure.
	//
	// For example, lack of submit permission or experienced merge conflict.
	SubmissionResult_FAILED_PERMANENT SubmissionResult = 3
)

func (SubmissionResult) Descriptor

func (SubmissionResult) Enum

func (SubmissionResult) EnumDescriptor deprecated

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

Deprecated: Use SubmissionResult.Descriptor instead.

func (SubmissionResult) Number

func (SubmissionResult) String

func (x SubmissionResult) String() string

func (SubmissionResult) Type

type TasksBinding

type TasksBinding struct {
	ManageRun    tq.TaskClassRef
	KickManage   tq.TaskClassRef
	TQDispatcher *tq.Dispatcher
}

TasksBinding binds Run 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

Register registers tasks with the given TQ Dispatcher.

func (TasksBinding) Dispatch

func (tr TasksBinding) Dispatch(ctx context.Context, runID string, eta time.Time) error

Dispatch ensures invocation of RunManager via ManageRunTask.

RunManager will be invoked at approximately no earlier than both:

  • eta time (if given)
  • next possible.

To avoid actually dispatching TQ tasks in tests, use runtest.MockDispatch().

Jump to

Keyboard shortcuts

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