Skip to main content

Crate diffler_ci

Crate diffler_ci 

Source
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/::error workflow 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 when LogMode::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).
GitHubProvider
Talks to GitHub Actions through gh. The runs list is scoped to the current branch (across all of its workflows); each run’s DAG comes from whichever of the repo’s workflows YAMLs matches that run’s workflow name.
GitLabProvider
Talks to GitLab CI through glab api. glab resolves the project from the repo via the :fullpath placeholder; an explicit host targets a self-hosted instance.
JobId
A job id within a run.
LogChunk
An incremental slice of a job log. next_offset is where the next poll resumes; done is set once the job has finished and the log is complete. steps carries the job’s step boundaries when the provider exposes them (empty otherwise). This unifies streaming, polling, and one-shot-dump sources.
LogStepMeta
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).
PullRequest
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.
RealRunner
Spawns the real binary on PATH.
RunDetail
A run plus its jobs — jobs + each job’s needs is 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§

AnnotationLevel
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 NodeStatus at the host boundary.
LogMode
How a provider delivers logs.
ProviderKind
Which forge an adapter talks to.

Traits§

CiProvider
CommandRunner
Runs a CLI and returns its stdout.

Functions§

detect
Detect from the repo on disk. remote_host is the host of the repo’s origin remote (e.g. github.com); forced is 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. 0 when there aren’t 14 digits.

Type Aliases§

Result