muelle.protocol
Source: src/muelle/protocol.py.
Wire format shared by the client (CI runner) and the receiver (host).
The client imports this module too, so it must stay stdlib-only.
encode
def encode(payload: dict[str, Any]) -> bytes
Serializes a payload exactly as it is signed and sent.
sign
def sign(body: bytes, secret: str) -> str
Returns the X-Muelle-Signature header value for BODY.
slot_for
def slot_for(site: str, env: str, branch: str, sha: str) -> str
Directory name of an environment: prod, next, or 8 hex chars per preview commit.
is_preview_slot
def is_preview_slot(name: str) -> bool
deploy_payload
def deploy_payload(
*,
id: str,
site: str,
env: str,
branch: str,
sha: str,
sha256: str,
artifact_url: str,
token: str,
ts: int,
run_url: str = "",
) -> dict[str, Any]
teardown_payload
def teardown_payload(*, id: str, site: str, branch: str, ts: int) -> dict[str, Any]
notice_payload
def notice_payload(
*, id: str, site: str, action: Literal["announce", "abort"], env: str, branch: str, sha: str, run_url: str, ts: int
) -> dict[str, Any]
Announce (a build started in CI) and abort (it failed or was cancelled before deploying).