{"modulePath":"github.com/uber/submitqueue","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package messagequeue\n\nPackage 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.\n\nThe 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).\n\nOne 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.\n\n## Functions\n\n```go\nfunc Marshal(m proto.Message) ([]byte, error)\n```\nMarshal serializes any contract message to protojson bytes for the queue payload, keeping the proto field names (snake\\_case) on the wire.\n\n```go\nfunc TopicKeys(m proto.Message) []string\n```\nTopicKeys returns the stable logical topic keys bound to a message via the topic\\_keys proto option — not concrete wire names; a caller maps each key to its backend's topic name. Returns nil for a message that declares no keys.\n\n```go\nfunc Unmarshal[T proto.Message](b []byte, m T) error\n```\nUnmarshal deserializes protojson bytes into the contract message m, tolerating unknown fields so an additive contract change is ignored rather than rejected.\n\n## Types\n\n```go\ntype MergeRequest = protopb.MergeRequest\n```\nMergeRequest 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.\n\n```go\ntype MergeResult = protopb.MergeResult\n```\nMergeResult is the payload Runway publishes to the corresponding signal queue once a request completes.\n\n```go\ntype MergeStep = protopb.MergeStep\n```\nMergeStep is one step of an ordered merge: a single set of change(s) applied with a strategy.\n\n```go\ntype StepOutput = protopb.StepOutput\n```\nStepOutput is a single revision a merge step produced on the merge target.\n\n```go\ntype StepResult = protopb.StepResult\n```\nStepResult reports what happened to a single MergeStep.\n\n```go\ntype TopicKey = consumer.TopicKey\n```\nTopicKey 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.\n\n```go\nconst (\n\t// TopicKeyMergeConflictCheck carries dry-run merge-conflict check requests.\n\t// A client publishes a MergeRequest here; Runway attempts the merge without\n\t// committing and reports only whether it was mergeable.\n\tTopicKeyMergeConflictCheck TopicKey = \"merge-conflict-check\"\n\t// TopicKeyMergeConflictCheckSignal carries merge-conflict check results.\n\t// Runway publishes a MergeResult here (with no produced revisions); the\n\t// requesting client consumes it.\n\tTopicKeyMergeConflictCheckSignal TopicKey = \"merge-conflict-check-signal\"\n\t// TopicKeyMerge carries committing merge requests. A client publishes a\n\t// MergeRequest here; Runway applies the steps, commits the result, and\n\t// reports the revisions it produced.\n\tTopicKeyMerge TopicKey = \"merge\"\n\t// TopicKeyMergeSignal carries committing merge results. Runway publishes a\n\t// MergeResult here (with the produced revisions populated); the requesting\n\t// client consumes it.\n\tTopicKeyMergeSignal TopicKey = \"merge-signal\"\n)\n```\n\n","path":"github.com/uber/submitqueue/api/runway/messagequeue","name":"messagequeue","synopsis":"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/.","isRedistributable":true}
