repostatus

package
v0.182.7 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package repostatus collects local Git attention without CLI dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failed

func Failed(report Index) bool

Types

type Index

type Index struct {
	SchemaVersion int `yaml:"schema_version" json:"schema_version"`
	// HiddenClean counts the clean repositories left out of Repositories, so
	// every consumer of this index can tell a filtered report from a fleet
	// where nothing was inspected.
	HiddenClean  int   `yaml:"hidden_clean,omitempty" json:"hidden_clean,omitempty"`
	Repositories []Row `yaml:"repositories" json:"repositories"`
}

func Collect

func Collect(request reposelection.Request, observer Observer) (Index, error)

Collect selects once, then inspects the selected targets in deterministic order.

func HideClean

func HideClean(report Index) Index

HideClean drops the clean rows and records how many were dropped. Errors and attention rows survive, so the exit code and the worklist stay the same whether or not the report was filtered.

type Observer

type Observer struct {
	Start    func(int)
	Complete func(reposelection.Target, Row)
}

Observer receives joined inspection callbacks; Complete may run concurrently.

type Row

type Row struct {
	Repository       string                  `yaml:"repository" json:"repository"`
	Path             string                  `yaml:"path" json:"path"`
	Status           string                  `yaml:"status" json:"status"`
	Summary          string                  `yaml:"summary,omitempty" json:"summary,omitempty"`
	Modified         []string                `yaml:"modified,omitempty" json:"modified,omitempty"`
	Untracked        []string                `yaml:"untracked,omitempty" json:"untracked,omitempty"`
	Conflicted       []string                `yaml:"conflicted,omitempty" json:"conflicted,omitempty"`
	Unpushed         []string                `yaml:"unpushed,omitempty" json:"unpushed,omitempty"`
	UnpushedBranches []gitops.UnpushedBranch `yaml:"unpushed_branches,omitempty" json:"unpushed_branches,omitempty"`
	Stashed          []string                `yaml:"stashed,omitempty" json:"stashed,omitempty"`
	Error            string                  `yaml:"error,omitempty" json:"error,omitempty"`
}

func InspectTargets

func InspectTargets(targets []reposelection.Target, parallel int,
	complete func(reposelection.Target, Row),
) []Row

InspectTargets reuses an already-selected fleet without scanning again.

Jump to

Keyboard shortcuts

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