Expand description
Provider-agnostic CI run/job/log acquisition for diffler.
Adapters (providers/) implement CiProvider over each forge — CLI-only
today (gh, glab) via the CommandRunner seam — and normalize results
into [model] types. The host maps RunDetail onto a diffler_graph::Model
and drives polling; this crate does no rendering and holds no credentials.
Structs§
- Annotation
- One annotation a job emitted (a
::warning/::errorworkflow command or a check failure), tied to a file location when the provider gives one. - Artifact
- A build artifact a run produced, as listed on the run page.
- Capabilities
- What a provider can actually do, so the UI degrades honestly instead of
failing at runtime (hide the graph when
DagSource::None, the follow toggle whenLogMode::Dump, …). - CiJob
- One job within a run, with its upstream dependencies (the DAG edges).
- CiRun
- One run/pipeline as shown in the runs list.
- Detected
- Detected provider plus an optional self-hosted host override (set only when the remote isn’t a known SaaS host).
- GitHub
Provider - Talks to GitHub Actions through
gh. The runs list is scoped to the currentbranch(across all of its workflows); each run’s DAG comes from whichever of the repo’sworkflowsYAMLs matches that run’s workflow name. - GitLab
Provider - Talks to GitLab CI through
glab api.glabresolves the project from the repo via the:fullpathplaceholder; an explicithosttargets a self-hosted instance. - JobId
- A job id within a run.
- LogChunk
- An incremental slice of a job log.
next_offsetis where the next poll resumes;doneis set once the job has finished and the log is complete.stepscarries the job’s step boundaries when the provider exposes them (empty otherwise). This unifies streaming, polling, and one-shot-dump sources. - LogStep
Meta - One step of a job, for grouping the log into the same collapsible units the
forge UI shows. The public API exposes no per-step log content, so the host
buckets log lines into steps by timestamp (
start_key≤ a line’s timestamp). - Pull
Request - The pull/merge request for the checked-out branch, shown beside the runs so the section reflects “the branch and PR I’m on”, not just a workflow.
- Real
Runner - Spawns the real binary on
PATH. - RunDetail
- A run plus its jobs —
jobs+ each job’sneedsis the dependency graph. - RunExtras
- A run’s page extras: the artifacts it produced and the annotations its jobs emitted. Shown below the DAG; empty for providers that don’t expose them.
- RunId
- A run/pipeline id as the provider spells it (a GitHub run database id, a GitLab pipeline iid, …).
Enums§
- Annotation
Level - Severity of a run annotation, driving its glyph and color.
- CiError
- Failures from acquiring CI data. Adapters surface these; the host maps them to a status-bar message and degrades (no runs / no DAG / no logs) rather than crashing.
- DagSource
- Where a provider’s dependency edges come from.
- JobStatus
- Normalized job/run state, driving color and glyph. Maps 1:1 to the graph
component’s
NodeStatusat the host boundary. - LogMode
- How a provider delivers logs.
- Provider
Kind - Which forge an adapter talks to.
Traits§
- CiProvider
- Command
Runner - Runs a CLI and returns its stdout.
Functions§
- detect
- Detect from the repo on disk.
remote_hostis the host of the repo’soriginremote (e.g.github.com);forcedis a config override of the kind. - ts_
sort_ key - A coarse chronological sort key from an ISO-8601 timestamp: its first 14
digits (
YYYYMMDDHHMMSS), so a fractional-second line key compares against a second-resolution step key without parsing.0when there aren’t 14 digits.