runner

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package runner executes VCS or shell commands across multiple repos in parallel, streaming results back through a channel as each completes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	backendName string,
	args []string,
	concurrency int64,
) (<-chan Result, error)

Dispatch runs args via backendName across the given repos, streaming one Result per repo to the returned channel. The channel is closed when all goroutines finish. The caller should drain the channel before inspecting the returned error (which reflects infrastructure failures only).

func GatherStatus

func GatherStatus(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	concurrency int64,
) <-chan StatusResult

GatherStatus fetches the VCS status for each repo concurrently, streaming one StatusResult per repo to the returned channel.

func ResultColor added in v0.3.0

func ResultColor(res Result) string

ResultColor returns the display color ("red" or "green") for a result based on whether it errored or had a non-zero exit code.

func Shell

func Shell(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	shellCmd string,
	concurrency int64,
) <-chan Result

Shell runs an arbitrary shell command across repos. It does not route through a backend; it uses sh -c directly.

func VCSSubcmd added in v0.3.0

func VCSSubcmd(
	ctx context.Context,
	repos map[string]config.Repo,
	names []string,
	op string,
	concurrency int64,
) <-chan Result

VCSSubcmd runs a VCS subcommand (status, diff, log, fetch, push, pull, etc.) across repos, resolving backend-specific arg prefixes automatically. For example, "fetch" becomes ["fetch"] for git but ["git", "fetch"] for jj.

Types

type Result

type Result struct {
	RepoName string
	RepoPath string
	VCS      string
	Output   string
	ExitCode int
	Err      error
}

Result is the outcome for a single repo, sent through the results channel.

type StatusResult

type StatusResult struct {
	RepoName string
	RepoPath string
	VCS      string
	Status   backend.RepoStatus
	Err      error
}

StatusResult carries the live status for a single repo used by `ll`.

Jump to

Keyboard shortcuts

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