muelle.index
Source: src/muelle/index.py.
Listing (`muelle index`)
Regenerates the listing of deployed next/preview environments served at the
muelle domain: <stateDir>/index/{index.json,index.html}. Above them, per site,
the jobs of every env still building or deploying, and recent failures.
Entry
class Entry(TypedDict)
Job
class Job(TypedDict)
job_key
def job_key(job: dict[str, Any]) -> tuple[str, str, str]
What a job is about: a newer job with the same key supersedes it. Previews are
per branch (a new commit supersedes the last); prod and next are one slot each.
latest_jobs
def latest_jobs(jobs: Iterable[dict[str, Any]]) -> dict[tuple[str, str, str], dict[str, Any]]
The newest job of each key. Times have one-second resolution: on a tie, an
announce is older than the abort that fails it, and both are older than a deploy.
is_pending
def is_pending(job: Job) -> bool
collect_jobs
def collect_jobs(config: Config, now: datetime) -> list[Job]
Per key, the newest job if it is still pending or failed recently: grouped by site, newest first.
read_meta
def read_meta(slot_dir: Path) -> dict[str, Any]
collect
def collect(config: Config) -> list[Entry]
Deployed next/preview slots: grouped by site, next first, then newest first.
Markup
class Markup(str)
HTML that html() inserts verbatim.
html
def html(template: Template) -> Markup
Renders a t-string, escaping every interpolated value that is not Markup.
render
def render(entries: list[Entry], generated: str, jobs: list[Job] | None = None) -> str
write
def write(config: Config) -> None