Documentation
¶
Overview ¶
Package record holds the record-stage queue controller. It consumes Record messages (a request id) published by buildsignal once a build reaches a terminal status, and turns that outcome into durable validation state.
The durable state is a ValidationFact per validated commit and project. Build completion owns the queue's last-green bookmark, which process reads to choose an incremental build baseline. A green commit is also promoted after its facts are persisted, moving the queue's promotion ref so downstream systems can pull the latest green commit by name.
The outcome is then announced as a hook event, so integrations outside the pipeline learn that a commit is green or broken. See doc/rfc/stovepipe/steps/record.md for the event shape and doc/rfc/hook-framework.md for the delivery promise.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller consumes Record messages, records the build's validation fact, and when that fact is green and holds the queue's last-green bookmark promotes the commit. Implements consumer.Controller.
func NewController ¶
func NewController( logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory, materializer requestlog.Materializer, projectStatusResolverFactory projectstatus.ResolverFactory, sourceControl sourcecontrol.Factory, registry consumer.TopicRegistry, topicKey consumer.TopicKey, consumerGroup string, ) *Controller
NewController creates a new record controller.
func (*Controller) ConsumerGroup ¶
func (c *Controller) ConsumerGroup() string
ConsumerGroup returns the consumer group for offset tracking.
func (*Controller) Name ¶
func (c *Controller) Name() string
Name returns the controller name for logging and metrics.
func (*Controller) Process ¶
Process loads the request referenced by the delivery, records its validation fact, applies that fact to the caches derived from it, and announces the outcome as a hook event. Returns nil to ack (success) or an error to nack (retry) / reject (DLQ).
buildsignal stamps the outcome on the request before publishing here, so a request without a build outcome is a producer invariant violation rather than a state this stage waits for.
func (*Controller) TopicKey ¶
func (c *Controller) TopicKey() consumer.TopicKey
TopicKey returns the topic key this controller subscribes to.
type DLQController ¶
type DLQController struct {
// contains filtered or unexported fields
}
DLQController retains abandoned record work and ensures failed requests have a repository fact without requiring project attribution.
func NewDLQController ¶
func NewDLQController( logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory, materializer requestlog.Materializer, registry consumer.TopicRegistry, topicKey consumer.TopicKey, consumerGroup string, ) *DLQController
NewDLQController creates a controller for abandoned record work.
func (*DLQController) ConsumerGroup ¶
func (c *DLQController) ConsumerGroup() string
ConsumerGroup returns the controller's consumer group.
func (*DLQController) Name ¶
func (c *DLQController) Name() string
Name returns the controller's name.
func (*DLQController) Process ¶
Process retains an observable abandonment occurrence for record work that the primary consumer could not finish. Deterministic poison is acknowledged; failures recording facts, retaining history, or publishing are retried.
func (*DLQController) TopicKey ¶
func (c *DLQController) TopicKey() consumer.TopicKey
TopicKey returns the controller's topic key.