testselection

package
v0.44.0 Latest Latest
Warning

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

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

Documentation

Overview

Package testselection owns the conservative affected-Go-package selection policy used by the separate local feedback command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

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

Package is one selected Go package and its stable, accumulated reasons.

type Policy

type Policy struct {
	Version             int      `json:"version"`
	SmokePackages       []string `json:"smoke_packages"`
	SharedPathPatterns  []string `json:"shared_path_patterns"`
	GeneratedGoPatterns []string `json:"generated_go_patterns"`
}

Policy is the versioned repository selection policy.

func Load

func Load(path string) (Policy, error)

Load reads and validates a versioned selection policy.

type Result

type Result struct {
	Version  int       `json:"version"`
	Outcome  string    `json:"outcome"`
	Packages []Package `json:"packages"`
	Reasons  []string  `json:"reasons,omitempty"`
}

Result is machine-consumable selection evidence. Outcome is selected, empty, widened, or refused; refused is returned alongside an error to retain the diagnostic when package discovery is unavailable.

func Select

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

Select discovers repository packages then selects changed package ownership, their reverse dependents, test importers, and a small declared smoke set. Production dependency effects close transitively; test-only imports select their importing package without falsely making that package's production consumers affected. Any shared or uncertain path widens visibly; unavailable package discovery refuses rather than guessing at a partial dependency graph.

Jump to

Keyboard shortcuts

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