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, plus the queue's last-green bookmark, which process reads to choose an incremental build baseline. A green commit is also promoted, moving the queue's promotion ref so downstream systems can pull the latest green commit by name. Downstream hooks are not implemented yet.
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 advances the queue's last-green bookmark and promotes the commit. Implements consumer.Controller.
func NewController ¶
func NewController( logger *zap.SugaredLogger, scope tally.Scope, stores storage.Factory, sourceControls sourcecontrol.Factory, 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 and, when that fact is green, advances the queue's last-green bookmark and promotes the commit. 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.