Documentation
¶
Overview ¶
Package ci computes provider-agnostic fan-out plans for CI systems from a magus workspace. CI system wrappers translate the output into their own matrix/pipeline format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidMaxShards = errors.New("ci: max shards must be -1 (unlimited) or a positive integer")
ErrInvalidMaxShards is returned when WithMaxShards receives a value of 0 or any negative integer other than -1 (the sentinel for "unlimited").
Functions ¶
This section is empty.
Types ¶
type DedupEntry ¶
DedupEntry is one (project, target, hash) that was built redundantly across shards, with how many extra builds it caused and the wasted time.
type DedupResult ¶
type DedupResult struct {
TotalMisses int
UniqueKeys int
RedundantBuilds int
RedundantMs int64
// Approx is set when some events lack a Hash (older reports), so grouping is
// by (project, target) only and the count is an approximation.
Approx bool
// Top lists redundant keys sorted by wasted time descending.
Top []DedupEntry
}
DedupResult is the cross-shard redundant-build analysis.
func Dedup ¶
func Dedup(misses []MissBuild) DedupResult
Dedup measures cross-shard redundant builds: when the same (project, target, hash) is a cache miss on more than one shard, those extra builds are waste a shared remote cache would eliminate. Within a single shard's File a key counts once; the longest of the duplicated builds is treated as the necessary one, so the wasted time is total minus max.
type Forecaster ¶
Forecaster is the optional adaptive partitioner that replaces ceil-division when supplied to Build. Defined by interface to avoid an import cycle with magus/ci/forecast.
type MissBuild ¶
MissBuild is one cache-miss event, tagged with the shard report File it came from so the same key seen on two shards counts as two builds (and the same key twice within one shard counts once).
type Option ¶
type Option func(*config)
Option mutates the Build configuration.
func WithForecaster ¶
func WithForecaster(f Forecaster) Option
WithForecaster enables adaptive sharding; nil clears it (falls back to ceil-division).
func WithMaxShards ¶
WithMaxShards sets the shard limit; -1 = unlimited (capped at 256); 0 or other negatives return ErrInvalidMaxShards.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package annotate emits CI job-log structure: the fold markers and the warning/error notices a CI provider recognizes.
|
Package annotate emits CI job-log structure: the fold markers and the warning/error notices a CI provider recognizes. |
|
Package forecast picks an adaptive CI shard count using a USL model (N* = sqrt(W/α)) and packs projects via LPT bin-packing.
|
Package forecast picks an adaptive CI shard count using a USL model (N* = sqrt(W/α)) and packs projects via LPT bin-packing. |
|
Package volatility provides Wilson-score volatility prediction and auto-retry for magus test runs.
|
Package volatility provides Wilson-score volatility prediction and auto-retry for magus test runs. |