Documentation
¶
Overview ¶
Package forgereach answers one question for forge's CI gates: can this diff change what a consumer of forge sees?
A consumer is a project generated by forge (reliant, control-plane). It sees forge in two ways:
- the Go packages under pkg/ it imports (and the module-internal packages those import), so a change there can break its build;
- the code `forge generate` writes into it, so a change to the templates or the generators can break the build after the consumer regenerates.
Everything else in the module (the CLI's commands, the linters, the docs) never reaches a consumer's build, and a gate that ran on it would spend its time on diffs that cannot matter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangedFiles ¶
ChangedFiles lists the files that differ from base in the checkout at dir — uncommitted and untracked ones included — as slash paths relative to dir, sorted.
Types ¶
type Reach ¶
type Reach struct {
// Module is the forge module path.
Module string
// All is true when the module's dependency set changed (see depsChanged):
// any consumer package that imports forge may be affected.
All bool
// Packages are the import paths of the changed Go packages a consumer can
// import, directly (pkg/...) or through a package of pkg/, sorted.
Packages []string
// Generated are the changed files whose output lands in a consumer's tree
// when it runs `forge generate`: templates, generators, scaffolding.
Generated []string
}
Reach is what a diff can change for a consumer.
func Compute ¶
Compute maps the changed files (relative to the forge module at root, as differing from base) onto what a consumer can see.