testselection

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testselection owns the conservative typed behavioral selection policy.

Index

Constants

View Source
const PolicyVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Lane added in v0.45.0

type Lane struct {
	Name    string   `json:"name"`
	Reasons []string `json:"reasons"`
}

Lane is one selected behavioral lane and its stable reasons.

type LanePolicy added in v0.45.0

type LanePolicy struct {
	Name     string   `json:"name"`
	Patterns []string `json:"patterns"`
}

LanePolicy assigns repository paths, including dynamically read inputs, to a behavioral lane.

type Package

type Package struct {
	Path    string   `json:"path"`
	Reasons []string `json:"reasons"`
}

Package is one selected Go package and its stable reasons.

type Policy

type Policy struct {
	Version             int          `json:"version"`
	Lanes               []LanePolicy `json:"lanes"`
	SharedPathPatterns  []string     `json:"shared_path_patterns"`
	GeneratedGoPatterns []string     `json:"generated_go_patterns"`
}

Policy is the versioned repository selection policy.

func Load

func Load(filename string) (Policy, error)

Load reads and validates the typed selection policy.

type Result

type Result struct {
	Version     int       `json:"version"`
	Outcome     string    `json:"outcome"`
	Lanes       []Lane    `json:"lanes"`
	Packages    []Package `json:"packages"`
	Diagnostics []string  `json:"diagnostics"`
}

Result is the stable machine-readable selection interface. Outcome is one of selected, empty, widened, or refused. Every slice is emitted, including when empty, so consumers do not need null handling.

func Select

func Select(ctx context.Context, root string, policy Policy, changedPaths []string) (Result, error)

Select discovers repository packages and selects typed behavioral lanes. Go changes close over production reverse dependencies and test importers. A shared, generated, build-tagged, deleted, or unclassified input widens visibly instead of guessing at incomplete assurance.

Jump to

Keyboard shortcuts

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