Documentation
¶
Overview ¶
Package runlist collects the runs that `rotari runs` lists, across state directories: which runs are listed, their lifecycle and client status, and their order. It returns recorded values; callers format them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeScope ¶
DescribeScope names the listed state directories, and the project when one was selected, for messages.
func LatestStart ¶
LatestStart is the latest run start, by run ID, among the runs in baseDirs that started before now, read from directory names alone; ok is false when there is none.
Types ¶
type Details ¶
type Details struct {
WorkingDirectory string
Host string
// Sources are the recorded repositories' labels (model.SourceLabel).
Sources []string
// NoteCount counts the run's own notes, not its jobs'; FirstNote is the
// first line of the earliest.
NoteCount int
FirstNote string
// StartedBy is how the run was started, nil when not recorded.
StartedBy *model.StartedBy
}
Details are the facts shown beside a listed run, read from its context, sources, and notes files: where it ran, which code it ran, and what was noted about it. A file the run did not write leaves its facts empty.
func ReadDetails ¶
ReadDetails reads run's details. Callers read them only for the runs they show, so listing many old runs stays cheap.
type Run ¶
type Run struct {
BaseDir string
Project string
RunID string
RunName string
// Lifecycle is runview.RunLifecycleLabel: running, interrupted,
// incomplete, finished, or failed.
Lifecycle string
ClientStatus model.RunClientStatus
ClientLabel string
// ExitCode is nil until the run has a summary.
ExitCode *int
// StartedAt and FinishedAt are as recorded (RFC 3339), empty when
// unknown; Started and Finished are their parsed times.
StartedAt string
FinishedAt string
Started time.Time
Finished time.Time
// Order sorts runs newest first: the start time, or the run
// directory's modification time when the start is unknown.
Order int64
}
Run is one listed run.
func Collect ¶
Collect lists the runs of every project in baseDirs, or of projectFilter only, newest first. A projectFilter found in none of them is an error, unless no basedir has any project.
func CollectBetween ¶
CollectBetween is Collect for the runs whose span may meet [from, to), as Overlapping decides; callers still apply Overlapping. It skips, without reading their files, runs whose run ID says they started at or after to and runs whose directory last changed before from (a run writes its summary there when it ends), except the project's running or interrupted run. A run whose ID is not a timestamp is judged by its directory's time alone.
func Overlapping ¶
Overlapping keeps the runs whose span meets the range [from, to).
func Recent ¶
Recent keeps the runs `rotari runs` shows: running, interrupted, and incomplete runs, runs with no recorded finish, and runs that finished at or after cutoff.