longops

package
v0.0.0-...-30d1adc Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package longops implements long operations of the Run Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// Run is the Run on which the long operation is to be performed.
	Run *run.Run
	// Op defines what long operation to perform.
	Op *run.OngoingLongOps_Op
	// IsCancelRequested quickly checks whether the current long operation is
	// supposed to be be cancelled.
	IsCancelRequested func() bool
	// contains filtered or unexported fields
}

Base houses shared bits of all long operations.

Base is a single use object.

type ExecutePostActionOp

type ExecutePostActionOp struct {
	*Base
	GFactory    gerrit.Factory
	RunNotifier *run.Notifier
	QM          *quota.Manager
}

ExecutePostActionOp executes a PostAction.

func (*ExecutePostActionOp) Do

Do implements Operation interface.

type ExecuteTryjobsOp

type ExecuteTryjobsOp struct {
	*Base
	Env         *common.Env
	RunNotifier *run.Notifier
	Backend     execute.TryjobBackend
}

ExecuteTryjobsOp executes the Tryjob Requirement for the given Run.

func (*ExecuteTryjobsOp) Do

Do implements Operation interface.

type Operation

type Operation interface {
	Do(context.Context) (*eventpb.LongOpCompleted, error)
}

Operation defines the interface for long operation implementation.

type PostGerritMessageOp

type PostGerritMessageOp struct {
	// All public fields must be set.
	*Base
	GFactory gerrit.Factory
	Env      *common.Env
	// contains filtered or unexported fields
}

PostGerritMessageOp posts the given message to gerrit.

PostGerritMessageOp is a single-use object.

func (*PostGerritMessageOp) Do

Do actually posts the message.

type PostStartMessageOp

type PostStartMessageOp struct {
	*Base
	GFactory gerrit.Factory
	Env      *common.Env
	// contains filtered or unexported fields
}

PostStartMessageOp posts a start message on each of the Run CLs.

PostStartMessageOp is a single-use object.

func (*PostStartMessageOp) Do

Do actually posts the start messages.

type ResetTriggersOp

type ResetTriggersOp struct {
	*Base
	GFactory  gerrit.Factory
	CLMutator *changelist.Mutator
	// Concurrency is the number of CLs that will be reset concurrently.
	//
	// Default is 8.
	Concurrency int
	// contains filtered or unexported fields
}

ResetTriggersOp resets the triggers for the provided CLs.

ResetTriggersOp keeps retrying on lease error and transient failure for each CL till the long op deadline is exceeded or reset either succeeds or fails non-transiently.

ResetTriggersOp doesn't obey longop's cancellation request because if this long op is left half-done, for example, triggers on half of the CLs are untouched, a new Run may be created for those CLs.

ResetTriggersOp is a single-use object.

func (*ResetTriggersOp) Do

Do actually resets the triggers.

Jump to

Keyboard shortcuts

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