Cross-domain packages shared by SubmitQueue, Stovepipe, and other services in this repository. Nothing under platform/ may depend on domain folders (submitqueue/, stovepipe/).
- errs/ — Error classification (
errstypes, classifiers, MySQL/generic helpers). - metrics/ — Tally helpers with error-aware tagging via
platform/errs. - consumer/ — Queue consumer framework (
consumer.Controller, registry, DLQ wiring). - http/ — Small HTTP client helpers (e.g. base-URL
RoundTripper). Go import path:github.com/uber/submitqueue/platform/http; package name ishttp. Callers that also importnet/httpshould import this package with an alias (for examplephttp "github.com/uber/submitqueue/platform/http") and usephttp.NewClient. - git/ — Git command environment (
exec) and local bare-repo plumbing (repo) shared by change providers and mergers. - hook/ — Consumer-side hook dispatch: turn queued hook events into
hook.Hookcalls, and reconcile events that dead-letter. - lifecycle/ —
Componentstart/stop interface and orderedGroupcomposition for runnable subsystems. - pipeline/ — Typed engine that assembles a service's queue topology into one lifecycle component.
- publish/ — Topic-key publish plumbing and the message-ID convention that controls deduplication.
- conduit/ — Phabricator Conduit client: one generic
Callthat encodes JSON parameters with the API token, and decodes the result envelope into a typed*Erroror the caller's result. Typed methods stay with each caller. - buildkite/, githubactions/ — Vendor CI clients over
platform/http: the REST calls and provider-specific vocabulary (state strings, id encoding) shared by every domain'sBuildRunnerbackend. They deliberately define no interface, so they are plumbing rather than extensions — each domain keeps its ownBuildRunnercontract under{domain}/extension/buildrunnerand adapts these clients to it. - githubapi/ — Request conventions every direct GitHub API caller shares: the REST headers pinned to one API version, and the GraphQL envelope with its errors. Not a client: callers keep their own
*http.Clientand typed requests. - base/ — Shared domain entities (
change,messagequeue, and related subpackages). Root packagebaseis documentation-only. - extension/ — Shared extension interfaces and implementations reused across domains (
counter,messagequeue, and backends such asmysql). A package belongs here only if it defines a behavioral interface with itsConfigandFactoryinterface; a vendor client with no interface belongs directly underplatform/.
Domain-scoped infrastructure and extensions stay under each domain (for example submitqueue/core/, submitqueue/extension/).
GitHub and Phabricator callers split the work across the same three layers:
- Protocol:
githubapi/andconduit/hold what every caller of the API would otherwise repeat, which is request encoding and the response envelope with its errors. They have no endpoint methods. - Endpoints: each extension keeps the calls it makes, with its own typed requests and results, and takes the authenticated connection as a dependency. That dependency is the smallest type that can carry the API's auth: an
*http.Clientfor GitHub, whose token rides in a transport, and a*conduit.Clientfor Phabricator, whose token has to be inside the request body. - Wiring: the service's server reads the credentials, builds each connection once with a timeout, and hands it to the extensions that use it, as
githubClientandconduitClientdo in the orchestrator'sprofiles.go.