runlist

package
v0.1.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func DescribeScope(baseDirs []string, projectFilter string) string

DescribeScope names the listed state directories, and the project when one was selected, for messages.

func LatestStart

func LatestStart(baseDirs []string, now time.Time) (latest time.Time, ok bool)

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.

func RunIDStart

func RunIDStart(runID string) (time.Time, bool)

RunIDStart is the start time a run ID records: rotari names a run by its UTC start, YYYYMMDD-HHMMSS-XXXXXXXX. ok is false for an ID in another form.

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

func ReadDetails(run Run) (Details, error)

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

func Collect(baseDirs []string, projectFilter string) ([]Run, error)

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

func CollectBetween(baseDirs []string, projectFilter string, from, to time.Time) ([]Run, error)

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

func Overlapping(runs []Run, from, to, now time.Time) []Run

Overlapping keeps the runs whose span meets the range [from, to).

func Recent

func Recent(runs []Run, cutoff time.Time) []Run

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.

func (Run) Span

func (run Run) Span(now time.Time) (start, end time.Time, ok bool)

Span is when run occupied its project: from its start to its finish, or to now while it is running. A run that is not running and recorded no finish (interrupted or incomplete) ends where it started. ok is false when the run recorded no start.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL