controller

package
v0.3.0-20260730171007-... Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRequest = errs.NewUserError(errors.New("invalid request"))

ErrInvalidRequest is returned when the request fails validation. This error should be mapped to codes.InvalidArgument at the gRPC layer.

Functions

func IsInvalidRequest

func IsInvalidRequest(err error) bool

IsInvalidRequest returns true if any error in the error chain is ErrInvalidRequest.

Types

type IngestController

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

IngestController handles ingest business logic for stovepipe: it admits a queue's newly observed commit into the validation pipeline.

It resolves the queue's head commit URI via the SourceControl extension, dedups on the (queue, URI) pair, persists the Request and its URI mapping via storage, and publishes the request ID onto the process stage. Ingestion is idempotent: a re-reported head resolves to the already-minted request and no new work is published.

func NewIngestController

func NewIngestController(
	logger *zap.SugaredLogger,
	scope tally.Scope,
	counter counter.Counter,
	sourceControl sourcecontrol.Factory,
	store storage.Storage,
	registry consumer.TopicRegistry,
) *IngestController

NewIngestController creates a new instance of the stovepipe ingest controller. It publishes accepted requests to the topic registered under messagequeue.TopicKeyProcess in the registry.

func (*IngestController) Ingest

func (c *IngestController) Ingest(ctx context.Context, req entity.IngestRequest) (result entity.IngestResult, retErr error)

Ingest admits a queue's newly observed commit into the validation pipeline and returns the request ID validating it.

It is idempotent and runs to completion on every call, each step tolerant of having already run: it resolves (or claims) the (queue, URI) mapping, ensures the Request row exists, and publishes the request to the process stage. A retry after a partial failure — for example the URI mapping committed but the request write failed — completes the missing steps instead of returning a dangling reference. The (queue, URI) mapping is the dedup gate, so concurrent ingests of the same head converge on one request.

type PingController

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

PingController handles ping business logic for the stovepipe

func NewPingController

func NewPingController(logger *zap.Logger, scope tally.Scope) *PingController

NewPingController creates a new instance of the stovepipe ping controller

func (*PingController) Ping

func (c *PingController) Ping(ctx context.Context, req *pb.PingRequest) (resp *pb.PingResponse, retErr error)

Ping handles the ping request and returns a response

Directories

Path Synopsis
Package build holds the build-stage queue controller.
Package build holds the build-stage queue controller.
Package buildsignal holds the buildsignal-stage queue controller.
Package buildsignal holds the buildsignal-stage queue controller.
Package dlq contains controllers that consume messages from a pipeline stage's dead-letter topic and reconcile the affected request into a terminal state.
Package dlq contains controllers that consume messages from a pipeline stage's dead-letter topic and reconcile the affected request into a terminal state.
Package process holds the process-stage queue controller.
Package process holds the process-stage queue controller.

Jump to

Keyboard shortcuts

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