mothership_worker_server

package
v0.0.0-...-483e9f6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessRPMWorkflow

ProcessRPMWorkflow processes an SRPM. Usually a client worker will first initiate an upload to the storage backend, then send a request to the Server `SubmitEntry` method (or send a request then upload the resource).

func RetractEntryWorkflow

func RetractEntryWorkflow(ctx workflow.Context, name string) (*mshipadminpb.RetractEntryResponse, error)

RetractEntryWorkflow retracts an entry. Should be used when an entry debranding is not considered fully complete. (Contains upstream trademarks for example) This will forcefully remove the commit from the git repository and set the entry state to RETRACTED. The same source (for the specific entry) can be re-imported by the client, either by calling DuplicateEntry or calling SubmitEntry with the same SRPM URI.

func SealBatchWorkflow

SealBatchWorkflow seals a batch. After a worker finishing submitting their entries, they can seal the batch. Sealing the batch will wait for all entries to reach a "stop" condition. This can mean "ARCHIVED" or "ON_HOLD". If all entries are in a stop condition, a new ticket is created in the ticketing system with the status of each entry. After creating the ticket, the batch is sealed and won't accept any more entries.

Types

type Worker

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

func New

func New(db *base.DB, storage storage.Storage, gpgKeys openpgp.EntityList, forge forge.Forge, bugtracker bugtracker.Bugtracker, rolling bool, publicURI string) *Worker

New creates a new Worker todo(mustafa): This is really ugly, we should probably just use the struct above directly

func (*Worker) CreateEntry

func (w *Worker) CreateEntry(args *mothershippb.ProcessRPMArgs) (*mothershippb.Entry, error)

func (*Worker) CreateTicket

func (w *Worker) CreateTicket(ctx context.Context, batchName string) error

func (*Worker) DeleteEntry

func (w *Worker) DeleteEntry(name string) error

func (*Worker) ImportRPM

func (w *Worker) ImportRPM(uri string, checksumSha256 string, osRelease string) (*mothershippb.ImportRPMResponse, error)

ImportRPM imports an RPM into the database. This is a Temporal activity.

func (*Worker) RetractEntry

func (w *Worker) RetractEntry(name string) (*mshipadminpb.RetractEntryResponse, error)

func (*Worker) SealBatch

func (w *Worker) SealBatch(name string) (*mothershippb.Batch, error)

func (*Worker) SetEntryIDFromRPM

func (w *Worker) SetEntryIDFromRPM(entry string, uri string, checksumSha256 string) (*mothershippb.Entry, error)

SetEntryIDFromRPM sets the entry ID from the RPM. This is a Temporal activity.

func (*Worker) SetEntryState

func (w *Worker) SetEntryState(entry string, state mothershippb.Entry_State, importRpmRes *mothershippb.ImportRPMResponse) (*mothershippb.Entry, error)

func (*Worker) SetWorkerLastCheckinTime

func (w *Worker) SetWorkerLastCheckinTime(workerID string) error

func (*Worker) UpdateTicketStatus

func (w *Worker) UpdateTicketStatus(ctx context.Context, entry *mothershippb.Entry) error

func (*Worker) VerifyResourceExists

func (w *Worker) VerifyResourceExists(uri string) error

VerifyResourceExists verifies that the resource exists. This is a Temporal activity.

func (*Worker) WaitForEntriesToSettle

func (w *Worker) WaitForEntriesToSettle(ctx context.Context, req *mothershippb.SealBatchRequest) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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