Documentation
¶
Index ¶
- Variables
- func IsInvalidRequest(err error) bool
- func IsProjectStatusConsistency(err error) bool
- func IsProjectStatusNotFound(err error) bool
- func IsRequestHistoryNotFound(err error) bool
- type GetProjectStatusByURIController
- type IngestController
- type PingController
- type ProjectStatusConsistencyError
- type ProjectStatusNotFoundError
- type RequestHistoryByIDNotFoundError
- type RequestHistoryByURINotFoundError
- type RequestHistoryController
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidRequest = errs.NewUserError(errors.New("invalid request"))
ErrInvalidRequest is returned when a request fails validation.
Functions ¶
func IsInvalidRequest ¶
IsInvalidRequest reports whether err contains an invalid request classification.
func IsProjectStatusConsistency ¶
IsProjectStatusConsistency reports whether err represents inconsistent persisted state.
func IsProjectStatusNotFound ¶
IsProjectStatusNotFound reports whether err represents an unknown validation request.
func IsRequestHistoryNotFound ¶
IsRequestHistoryNotFound reports whether err contains a retained-history absence.
Types ¶
type GetProjectStatusByURIController ¶
type GetProjectStatusByURIController struct {
// contains filtered or unexported fields
}
GetProjectStatusByURIController reads the durable validation projections.
func NewGetProjectStatusByURIController ¶
func NewGetProjectStatusByURIController(logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory) *GetProjectStatusByURIController
NewGetProjectStatusByURIController creates a controller for validation-status lookups.
func (*GetProjectStatusByURIController) GetProjectStatusByURI ¶
func (c *GetProjectStatusByURIController) GetProjectStatusByURI(ctx context.Context, req entity.GetProjectStatusByURIRequest) (result entity.GetProjectStatusByURIResult, retErr error)
GetProjectStatusByURI returns the selected request summary and its repository validation fact, if recorded.
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 initial log entry 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 republishes it only while it remains accepted.
func NewIngestController ¶
func NewIngestController( logger *zap.SugaredLogger, scope tally.Scope, counters counter.Factory, sourceControl sourcecontrol.Factory, stores storage.Factory, materializer requestlog.Materializer, registry consumer.TopicRegistry, configuredQueues []string, ) *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 and accepted log entry exist, 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
type ProjectStatusConsistencyError ¶
type ProjectStatusConsistencyError struct {
// contains filtered or unexported fields
}
ProjectStatusConsistencyError indicates that persisted records disagree about a request.
func (*ProjectStatusConsistencyError) Error ¶
func (e *ProjectStatusConsistencyError) Error() string
type ProjectStatusNotFoundError ¶
type ProjectStatusNotFoundError struct {
// Queue is the queue in the selector.
Queue string
// ChangeURI is the commit URI in the selector.
ChangeURI string
}
ProjectStatusNotFoundError indicates that no validation request matches a lookup selector.
func (*ProjectStatusNotFoundError) Error ¶
func (e *ProjectStatusNotFoundError) Error() string
type RequestHistoryByIDNotFoundError ¶
type RequestHistoryByIDNotFoundError struct {
// RequestID is the selected request identifier.
RequestID string
}
RequestHistoryByIDNotFoundError indicates that no retained history exists for a request ID.
func (*RequestHistoryByIDNotFoundError) Error ¶
func (e *RequestHistoryByIDNotFoundError) Error() string
Error implements error.
type RequestHistoryByURINotFoundError ¶
type RequestHistoryByURINotFoundError struct {
// URI is the selected commit URI.
URI string
}
RequestHistoryByURINotFoundError indicates that no retained history exists for a URI.
func (*RequestHistoryByURINotFoundError) Error ¶
func (e *RequestHistoryByURINotFoundError) Error() string
Error implements error.
type RequestHistoryController ¶
type RequestHistoryController interface {
GetRequestHistoryByID(ctx context.Context, req entity.GetRequestHistoryByIDRequest) ([]entity.RequestLog, error)
GetRequestHistoryByURI(ctx context.Context, req entity.GetRequestHistoryByURIRequest) ([]entity.RequestHistory, error)
}
RequestHistoryController handles retained request-history lookups.
func NewRequestHistoryController ¶
func NewRequestHistoryController(logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory) RequestHistoryController
NewRequestHistoryController creates a request-history controller.
Source Files
¶
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. |
|
Package record holds the record-stage queue controller.
|
Package record holds the record-stage queue controller. |