Documentation
¶
Overview ¶
Package messagequeue holds Runway's external message-queue contract: the wire payloads for the merge queues Runway owns, defined by the proto files in proto/ and generated into protopb/. The proto is the language-neutral authority; the generated Go types in protopb are the binding for Go callers.
The message types are generated into protopb; this package adds only generic protojson glue (Marshal/Unmarshal) and the topic-key reflection lookup (TopicKeys), so there is no per-message serialization code. Payloads are serialized as protobuf JSON, not binary, so the MySQL-backed queue keeps storing self-describing JSON. The topic key that carries each payload is declared on the message itself via the topic_keys proto option (see api/base/messagequeue).
One contract serves two queue pairs because a merge-conflict check is a dry run of a merge: Runway applies the same ordered steps onto the same target branch, and the only difference is whether it commits the result and reports the revisions it produced. The topic key a request arrives on encodes that choice — the merge-conflict-check pair for a dry run, the merge pair for a committing merge — so MergeRequest and MergeResult are identical on both.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal serializes any contract message to protojson bytes for the queue payload, keeping the proto field names (snake_case) on the wire.
Types ¶
type MergeRequest ¶
type MergeRequest = protopb.MergeRequest
MergeRequest is the payload a client publishes to one of Runway's merge queues: the merge-conflict-check topic for a dry-run check, the merge topic for a committing merge.
type MergeResult ¶
type MergeResult = protopb.MergeResult
MergeResult is the payload Runway publishes to the corresponding signal queue once a request completes.
type MergeStep ¶
MergeStep is one step of an ordered merge: a single set of change(s) applied with a strategy.
type StepOutput ¶
type StepOutput = protopb.StepOutput
StepOutput is a single revision a merge step produced on the merge target.
type StepResult ¶
type StepResult = protopb.StepResult
StepResult reports what happened to a single MergeStep.
type TopicKey ¶
TopicKey is the typed identifier used to look up a queue backend, topic name, and subscription config in a consumer.TopicRegistry. The constants below are the wire topic names a client uses to publish to / consume from Runway's merge queues; they are the same strings each message lists in its topics option.
const ( // TopicKeyMergeConflictCheck carries dry-run merge-conflict check requests. // A client publishes a MergeRequest here; Runway attempts the merge without // committing and reports only whether it was mergeable. TopicKeyMergeConflictCheck TopicKey = "merge-conflict-check" // TopicKeyMergeConflictCheckSignal carries merge-conflict check results. // Runway publishes a MergeResult here (with no produced revisions); the // requesting client consumes it. TopicKeyMergeConflictCheckSignal TopicKey = "merge-conflict-check-signal" // TopicKeyMerge carries committing merge requests. A client publishes a // MergeRequest here; Runway applies the steps, commits the result, and // reports the revisions it produced. TopicKeyMerge TopicKey = "merge" // TopicKeyMergeSignal carries committing merge results. Runway publishes a // MergeResult here (with the produced revisions populated); the requesting // client consumes it. TopicKeyMergeSignal TopicKey = "merge-signal" )