Documentation
¶
Overview ¶
Package change provides reusable logic for building PR-level change reports. Extracted from the analyze-change CLI command so the GitHub App worker can call the same pipeline programmatically.
Index ¶
- Constants
- func BuildReport(idx *db.Index, cfg Config, base, head string) (*model.ChangeReport, error)
- func BuildSummary(files []model.ChangedFile, perFileBlast map[string]*model.BlastRadius) model.ChangeSummary
- func DetectCoupling(idx *db.Index, files []string) []model.CouplingPair
- func DetectTestGaps(analyzable []string, analysis *model.AnalysisOutput) []string
- func ExtractHiddenCoupling(analysis *model.AnalysisOutput, changedFiles map[string]bool) []model.HiddenCouplingEntry
- func HasTestForFile(file string, analysis *model.AnalysisOutput) bool
- func ParseGitStatus(s string) string
- type Config
- type DiffEntry
Constants ¶
const ChangeSchemaVersion = "1.0"
ChangeSchemaVersion is the current schema version for change reports.
Variables ¶
This section is empty.
Functions ¶
func BuildReport ¶
BuildReport produces a ChangeReport by diffing base..head, analyzing each changed file, and aggregating the results.
func BuildSummary ¶
func BuildSummary(files []model.ChangedFile, perFileBlast map[string]*model.BlastRadius) model.ChangeSummary
BuildSummary creates aggregate statistics from the changed files.
func DetectCoupling ¶
func DetectCoupling(idx *db.Index, files []string) []model.CouplingPair
DetectCoupling finds structural connections between changed files.
func DetectTestGaps ¶
func DetectTestGaps(analyzable []string, analysis *model.AnalysisOutput) []string
DetectTestGaps finds changed files that have no direct test coverage.
func ExtractHiddenCoupling ¶
func ExtractHiddenCoupling(analysis *model.AnalysisOutput, changedFiles map[string]bool) []model.HiddenCouplingEntry
ExtractHiddenCoupling parses hidden_coupling signals from AnalysisOutput.Related and returns entries for partners not in the changed file set.
func HasTestForFile ¶
func HasTestForFile(file string, analysis *model.AnalysisOutput) bool
HasTestForFile checks if any test file appears to test the given file.
func ParseGitStatus ¶
ParseGitStatus converts git's single-letter status code to a human-readable string. Handles: A (added), D (deleted), M (modified), R### (renamed). Defaults to "modified".
Types ¶
type DiffEntry ¶
DiffEntry represents a file changed in a git diff.
func GitDiffFiles ¶
GitDiffFiles returns the list of changed files between two refs.