Documentation
¶
Overview ¶
Package plumbing provides plumbing functionality.
Index ¶
- Constants
- Variables
- func FloorTime(t time.Time, d time.Duration) time.Time
- func ReleaseSnapshotUAST(s Snapshot)
- type BlobCacheAnalyzer
- func (b *BlobCacheAnalyzer) AvgTCSize() int64
- func (b *BlobCacheAnalyzer) Configure(facts map[string]any) error
- func (b *BlobCacheAnalyzer) Consume(ctx context.Context, ac *analyze.Context) (analyze.TC, error)
- func (b *BlobCacheAnalyzer) Description() string
- func (b *BlobCacheAnalyzer) Descriptor() analyze.Descriptor
- func (b *BlobCacheAnalyzer) Flag() string
- func (b *BlobCacheAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
- func (b *BlobCacheAnalyzer) Initialize(repo *gitlib.Repository) error
- func (b *BlobCacheAnalyzer) InjectPreparedData(_ []*gitlib.Change, cache map[gitlib.Hash]*gitlib.CachedBlob, _ map[string]any)
- func (b *BlobCacheAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (b *BlobCacheAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
- func (b *BlobCacheAnalyzer) Name() string
- func (b *BlobCacheAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (b *BlobCacheAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (b *BlobCacheAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (b *BlobCacheAnalyzer) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (b *BlobCacheAnalyzer) WorkingStateSize() int64
- type ChangeRouter
- type FileDiffAnalyzer
- func (f *FileDiffAnalyzer) AvgTCSize() int64
- func (f *FileDiffAnalyzer) Configure(facts map[string]any) error
- func (f *FileDiffAnalyzer) Consume(_ context.Context, ac *analyze.Context) (analyze.TC, error)
- func (f *FileDiffAnalyzer) Description() string
- func (f *FileDiffAnalyzer) Descriptor() analyze.Descriptor
- func (f *FileDiffAnalyzer) Flag() string
- func (f *FileDiffAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
- func (f *FileDiffAnalyzer) Initialize(repo *gitlib.Repository) error
- func (f *FileDiffAnalyzer) InjectPreparedData(_ []*gitlib.Change, _ map[gitlib.Hash]*gitlib.CachedBlob, fileDiffs any)
- func (f *FileDiffAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (f *FileDiffAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
- func (f *FileDiffAnalyzer) Name() string
- func (f *FileDiffAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (f *FileDiffAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (f *FileDiffAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (f *FileDiffAnalyzer) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (f *FileDiffAnalyzer) WorkingStateSize() int64
- type IdentityDetector
- func (d *IdentityDetector) AvgTCSize() int64
- func (d *IdentityDetector) Configure(facts map[string]any) error
- func (d *IdentityDetector) Consume(_ context.Context, ac *analyze.Context) (analyze.TC, error)
- func (d *IdentityDetector) Description() string
- func (d *IdentityDetector) Descriptor() analyze.Descriptor
- func (d *IdentityDetector) FinalizeDict()
- func (d *IdentityDetector) Flag() string
- func (d *IdentityDetector) Fork(n int) []analyze.HistoryAnalyzer
- func (d *IdentityDetector) GeneratePeopleDict(commits []*gitlib.Commit)
- func (d *IdentityDetector) GetAuthorID() int
- func (d *IdentityDetector) Initialize(_ *gitlib.Repository) error
- func (d *IdentityDetector) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (d *IdentityDetector) LoadPeopleDict(path string) error
- func (d *IdentityDetector) Merge(_ []analyze.HistoryAnalyzer)
- func (d *IdentityDetector) Name() string
- func (d *IdentityDetector) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (d *IdentityDetector) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (d *IdentityDetector) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (d *IdentityDetector) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (d *IdentityDetector) WorkingStateSize() int64
- type LanguagesDetectionAnalyzer
- func (l *LanguagesDetectionAnalyzer) AvgTCSize() int64
- func (l *LanguagesDetectionAnalyzer) Configure(_ map[string]any) error
- func (l *LanguagesDetectionAnalyzer) Consume(_ context.Context, _ *analyze.Context) (analyze.TC, error)
- func (l *LanguagesDetectionAnalyzer) Description() string
- func (l *LanguagesDetectionAnalyzer) Descriptor() analyze.Descriptor
- func (l *LanguagesDetectionAnalyzer) Flag() string
- func (l *LanguagesDetectionAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
- func (l *LanguagesDetectionAnalyzer) Initialize(_ *gitlib.Repository) error
- func (l *LanguagesDetectionAnalyzer) Languages() map[gitlib.Hash]string
- func (l *LanguagesDetectionAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (l *LanguagesDetectionAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
- func (l *LanguagesDetectionAnalyzer) Name() string
- func (l *LanguagesDetectionAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (l *LanguagesDetectionAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (l *LanguagesDetectionAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (l *LanguagesDetectionAnalyzer) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (l *LanguagesDetectionAnalyzer) SetLanguages(languages map[gitlib.Hash]string)
- func (l *LanguagesDetectionAnalyzer) SetLanguagesForTest(languages map[gitlib.Hash]string)
- func (l *LanguagesDetectionAnalyzer) WorkingStateSize() int64
- type LinesStatsCalculator
- func (l *LinesStatsCalculator) AvgTCSize() int64
- func (l *LinesStatsCalculator) Configure(_ map[string]any) error
- func (l *LinesStatsCalculator) Consume(_ context.Context, ac *analyze.Context) (analyze.TC, error)
- func (l *LinesStatsCalculator) Description() string
- func (l *LinesStatsCalculator) Descriptor() analyze.Descriptor
- func (l *LinesStatsCalculator) Flag() string
- func (l *LinesStatsCalculator) Fork(n int) []analyze.HistoryAnalyzer
- func (l *LinesStatsCalculator) Initialize(_ *gitlib.Repository) error
- func (l *LinesStatsCalculator) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (l *LinesStatsCalculator) Merge(_ []analyze.HistoryAnalyzer)
- func (l *LinesStatsCalculator) Name() string
- func (l *LinesStatsCalculator) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (l *LinesStatsCalculator) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (l *LinesStatsCalculator) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (l *LinesStatsCalculator) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (l *LinesStatsCalculator) WorkingStateSize() int64
- type Snapshot
- type TicksSinceStart
- func (t *TicksSinceStart) AvgTCSize() int64
- func (t *TicksSinceStart) Configure(facts map[string]any) error
- func (t *TicksSinceStart) Consume(_ context.Context, ac *analyze.Context) (analyze.TC, error)
- func (t *TicksSinceStart) CurrentTick() int
- func (t *TicksSinceStart) Description() string
- func (t *TicksSinceStart) Descriptor() analyze.Descriptor
- func (t *TicksSinceStart) Flag() string
- func (t *TicksSinceStart) Fork(n int) []analyze.HistoryAnalyzer
- func (t *TicksSinceStart) Initialize(_ *gitlib.Repository) error
- func (t *TicksSinceStart) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (t *TicksSinceStart) Merge(_ []analyze.HistoryAnalyzer)
- func (t *TicksSinceStart) Name() string
- func (t *TicksSinceStart) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (t *TicksSinceStart) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (t *TicksSinceStart) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (t *TicksSinceStart) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (t *TicksSinceStart) WorkingStateSize() int64
- type TreeDiffAnalyzer
- func (t *TreeDiffAnalyzer) AvgTCSize() int64
- func (t *TreeDiffAnalyzer) Configure(facts map[string]any) error
- func (t *TreeDiffAnalyzer) Consume(ctx context.Context, ac *analyze.Context) (analyze.TC, error)
- func (t *TreeDiffAnalyzer) Description() string
- func (t *TreeDiffAnalyzer) Descriptor() analyze.Descriptor
- func (t *TreeDiffAnalyzer) Flag() string
- func (t *TreeDiffAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
- func (t *TreeDiffAnalyzer) Initialize(repository *gitlib.Repository) error
- func (t *TreeDiffAnalyzer) InjectPreparedData(changes []*gitlib.Change, _ map[gitlib.Hash]*gitlib.CachedBlob, _ any)
- func (t *TreeDiffAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (t *TreeDiffAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
- func (t *TreeDiffAnalyzer) Name() string
- func (t *TreeDiffAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (t *TreeDiffAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (t *TreeDiffAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (t *TreeDiffAnalyzer) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (t *TreeDiffAnalyzer) WorkingStateSize() int64
- type UASTChangesAnalyzer
- func (c *UASTChangesAnalyzer) AvgTCSize() int64
- func (c *UASTChangesAnalyzer) Changes(ctx context.Context) []uast.Change
- func (c *UASTChangesAnalyzer) Configure(facts map[string]any) error
- func (c *UASTChangesAnalyzer) Consume(_ context.Context, ac *analyze.Context) (analyze.TC, error)
- func (c *UASTChangesAnalyzer) Description() string
- func (c *UASTChangesAnalyzer) Descriptor() analyze.Descriptor
- func (c *UASTChangesAnalyzer) Flag() string
- func (c *UASTChangesAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
- func (c *UASTChangesAnalyzer) Initialize(_ *gitlib.Repository) error
- func (c *UASTChangesAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
- func (c *UASTChangesAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
- func (c *UASTChangesAnalyzer) Name() string
- func (c *UASTChangesAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
- func (c *UASTChangesAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
- func (c *UASTChangesAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
- func (c *UASTChangesAnalyzer) SerializeTICKs(_ []analyze.TICK, _ string, _ io.Writer) error
- func (c *UASTChangesAnalyzer) SetChanges(changes []uast.Change)
- func (c *UASTChangesAnalyzer) SetChangesForTest(changes []uast.Change)
- func (c *UASTChangesAnalyzer) TransferChanges() []uast.Change
- func (c *UASTChangesAnalyzer) WorkingStateSize() int64
Constants ¶
const ( // ConfigBlobCacheFailOnMissingSubmodules is the configuration key for failing on missing submodules. ConfigBlobCacheFailOnMissingSubmodules = "BlobCache.FailOnMissingSubmodules" // ConfigBlobCacheGoroutines is the configuration key for parallel blob loading. ConfigBlobCacheGoroutines = "BlobCache.Goroutines" )
const ( // ConfigFileDiffDisableCleanup is the configuration key for disabling diff cleanup. ConfigFileDiffDisableCleanup = "FileDiff.NoCleanup" // ConfigFileWhitespaceIgnore is the configuration key for ignoring whitespace in diffs. ConfigFileWhitespaceIgnore = "FileDiff.WhitespaceIgnore" // ConfigFileDiffTimeout is the configuration key for the diff computation timeout. ConfigFileDiffTimeout = "FileDiff.Timeout" // ConfigFileDiffGoroutines is the configuration key for the number of parallel diff goroutines. ConfigFileDiffGoroutines = "FileDiff.Goroutines" )
const ( // ConfigIdentityDetectorPeopleDictPath is the configuration key for the people dictionary file path. ConfigIdentityDetectorPeopleDictPath = "IdentityDetector.PeopleDictPath" // ConfigIdentityDetectorExactSignatures is the configuration key for requiring exact author signatures. ConfigIdentityDetectorExactSignatures = "IdentityDetector.ExactSignatures" )
const ( // ConfigTicksSinceStartTickSize is the configuration key for the tick size in hours. ConfigTicksSinceStartTickSize = "TicksSinceStart.TickSize" // DefaultTicksSinceStartTickSize is the default tick size in hours. DefaultTicksSinceStartTickSize = 24 )
const ( // ConfigTreeDiffEnableBlacklist is the configuration key for enabling path blacklisting. ConfigTreeDiffEnableBlacklist = "TreeDiff.EnableBlacklist" // ConfigTreeDiffBlacklistedPrefixes is the configuration key for path prefixes to exclude from diffs. ConfigTreeDiffBlacklistedPrefixes = "TreeDiff.BlacklistedPrefixes" // ConfigTreeDiffLanguages is the configuration key for filtering by programming language. ConfigTreeDiffLanguages = "TreeDiff.LanguagesDetection" // ConfigTreeDiffFilterRegexp is the configuration key for the file path filter regular expression. ConfigTreeDiffFilterRegexp = "TreeDiff.FilteredRegexes" )
const ( // FeatureUast is the feature flag for UAST-based analysis. FeatureUast = "uast" // ConfigUASTChangesGoroutines is the configuration key for parallel UAST parsing. ConfigUASTChangesGoroutines = "UASTChanges.Goroutines" )
const (
// ConfigLanguagesDetection is the configuration key for language detection settings.
ConfigLanguagesDetection = "LanguagesDetection"
)
const (
DefaultValue = 1000
)
DefaultValue is the default timeout in milliseconds for file diff operations.
Variables ¶
var ErrInvalidSkipFiles = errors.New("expected []string for SkipFiles")
ErrInvalidSkipFiles indicates a type assertion failure for SkipFiles configuration.
Functions ¶
func ReleaseSnapshotUAST ¶
func ReleaseSnapshotUAST(s Snapshot)
ReleaseSnapshotUAST releases UAST trees owned by the snapshot.
Types ¶
type BlobCacheAnalyzer ¶
type BlobCacheAnalyzer struct {
TreeDiff *TreeDiffAnalyzer
Repository *gitlib.Repository
Cache map[gitlib.Hash]*gitlib.CachedBlob
FailOnMissingSubmodules bool
Goroutines int
// contains filtered or unexported fields
}
BlobCacheAnalyzer loads and caches file blobs for each commit.
func (*BlobCacheAnalyzer) AvgTCSize ¶
func (b *BlobCacheAnalyzer) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*BlobCacheAnalyzer) Configure ¶
func (b *BlobCacheAnalyzer) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*BlobCacheAnalyzer) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*BlobCacheAnalyzer) Description ¶
func (b *BlobCacheAnalyzer) Description() string
Description returns a human-readable description of the analyzer.
func (*BlobCacheAnalyzer) Descriptor ¶
func (b *BlobCacheAnalyzer) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*BlobCacheAnalyzer) Flag ¶
func (b *BlobCacheAnalyzer) Flag() string
Flag returns the CLI flag for the analyzer.
func (*BlobCacheAnalyzer) Fork ¶
func (b *BlobCacheAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*BlobCacheAnalyzer) Initialize ¶
func (b *BlobCacheAnalyzer) Initialize(repo *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*BlobCacheAnalyzer) InjectPreparedData ¶
func (b *BlobCacheAnalyzer) InjectPreparedData( _ []*gitlib.Change, cache map[gitlib.Hash]*gitlib.CachedBlob, _ map[string]any, )
InjectPreparedData sets pre-computed cache from parallel preparation.
func (*BlobCacheAnalyzer) ListConfigurationOptions ¶
func (b *BlobCacheAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*BlobCacheAnalyzer) Merge ¶
func (b *BlobCacheAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*BlobCacheAnalyzer) Name ¶
func (b *BlobCacheAnalyzer) Name() string
Name returns the name of the analyzer.
func (*BlobCacheAnalyzer) NewAggregator ¶
func (b *BlobCacheAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*BlobCacheAnalyzer) ReportFromTICKs ¶
func (b *BlobCacheAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*BlobCacheAnalyzer) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*BlobCacheAnalyzer) WorkingStateSize ¶
func (b *BlobCacheAnalyzer) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type ChangeRouter ¶
type ChangeRouter struct {
OnInsert func(change *gitlib.Change) error
OnDelete func(change *gitlib.Change) error
OnModify func(change *gitlib.Change) error
OnRename func(from, to string, change *gitlib.Change) error
}
ChangeRouter routes tree-diff changes to appropriate handlers.
type FileDiffAnalyzer ¶
type FileDiffAnalyzer struct {
TreeDiff *TreeDiffAnalyzer
BlobCache *BlobCacheAnalyzer
FileDiffs map[string]pkgplumbing.FileDiffData
Timeout time.Duration
Goroutines int
CleanupDisabled bool
WhitespaceIgnore bool
// contains filtered or unexported fields
}
FileDiffAnalyzer computes file-level diffs for each commit.
func (*FileDiffAnalyzer) AvgTCSize ¶
func (f *FileDiffAnalyzer) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*FileDiffAnalyzer) Configure ¶
func (f *FileDiffAnalyzer) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*FileDiffAnalyzer) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*FileDiffAnalyzer) Description ¶
func (f *FileDiffAnalyzer) Description() string
Description returns a human-readable description of the analyzer.
func (*FileDiffAnalyzer) Descriptor ¶
func (f *FileDiffAnalyzer) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*FileDiffAnalyzer) Flag ¶
func (f *FileDiffAnalyzer) Flag() string
Flag returns the CLI flag for the analyzer.
func (*FileDiffAnalyzer) Fork ¶
func (f *FileDiffAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*FileDiffAnalyzer) Initialize ¶
func (f *FileDiffAnalyzer) Initialize(repo *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*FileDiffAnalyzer) InjectPreparedData ¶
func (f *FileDiffAnalyzer) InjectPreparedData( _ []*gitlib.Change, _ map[gitlib.Hash]*gitlib.CachedBlob, fileDiffs any, )
InjectPreparedData sets pre-computed file diffs from parallel preparation.
func (*FileDiffAnalyzer) ListConfigurationOptions ¶
func (f *FileDiffAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*FileDiffAnalyzer) Merge ¶
func (f *FileDiffAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*FileDiffAnalyzer) Name ¶
func (f *FileDiffAnalyzer) Name() string
Name returns the name of the analyzer.
func (*FileDiffAnalyzer) NewAggregator ¶
func (f *FileDiffAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*FileDiffAnalyzer) ReportFromTICKs ¶
func (f *FileDiffAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*FileDiffAnalyzer) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*FileDiffAnalyzer) WorkingStateSize ¶
func (f *FileDiffAnalyzer) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type IdentityDetector ¶
type IdentityDetector struct {
PeopleDict map[string]int
PeopleDictPath string
ReversedPeopleDict []string
AuthorID int
ExactSignatures bool
// contains filtered or unexported fields
}
IdentityDetector maps commit authors to canonical developer identities.
func (*IdentityDetector) AvgTCSize ¶
func (d *IdentityDetector) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*IdentityDetector) Configure ¶
func (d *IdentityDetector) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*IdentityDetector) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*IdentityDetector) Description ¶
func (d *IdentityDetector) Description() string
Description returns a human-readable description of the analyzer.
func (*IdentityDetector) Descriptor ¶
func (d *IdentityDetector) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*IdentityDetector) FinalizeDict ¶
func (d *IdentityDetector) FinalizeDict()
FinalizeDict builds ReversedPeopleDict if it was collected incrementally.
func (*IdentityDetector) Flag ¶
func (d *IdentityDetector) Flag() string
Flag returns the CLI flag for the analyzer.
func (*IdentityDetector) Fork ¶
func (d *IdentityDetector) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*IdentityDetector) GeneratePeopleDict ¶
func (d *IdentityDetector) GeneratePeopleDict(commits []*gitlib.Commit)
GeneratePeopleDict builds the author identity mapping.
func (*IdentityDetector) GetAuthorID ¶
func (d *IdentityDetector) GetAuthorID() int
GetAuthorID returns the author ID of the last processed commit.
func (*IdentityDetector) Initialize ¶
func (d *IdentityDetector) Initialize(_ *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*IdentityDetector) ListConfigurationOptions ¶
func (d *IdentityDetector) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*IdentityDetector) LoadPeopleDict ¶
func (d *IdentityDetector) LoadPeopleDict(path string) error
LoadPeopleDict loads the author identity mapping from a file.
func (*IdentityDetector) Merge ¶
func (d *IdentityDetector) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*IdentityDetector) Name ¶
func (d *IdentityDetector) Name() string
Name returns the name of the analyzer.
func (*IdentityDetector) NewAggregator ¶
func (d *IdentityDetector) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*IdentityDetector) ReportFromTICKs ¶
func (d *IdentityDetector) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*IdentityDetector) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*IdentityDetector) WorkingStateSize ¶
func (d *IdentityDetector) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type LanguagesDetectionAnalyzer ¶
type LanguagesDetectionAnalyzer struct {
// Dependencies.
TreeDiff *TreeDiffAnalyzer
BlobCache *BlobCacheAnalyzer
// contains filtered or unexported fields
}
LanguagesDetectionAnalyzer detects programming languages of changed files. It uses lazy detection - languages are only computed when Languages() is called.
func (*LanguagesDetectionAnalyzer) AvgTCSize ¶
func (l *LanguagesDetectionAnalyzer) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*LanguagesDetectionAnalyzer) Configure ¶
func (l *LanguagesDetectionAnalyzer) Configure(_ map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*LanguagesDetectionAnalyzer) Consume ¶
func (l *LanguagesDetectionAnalyzer) Consume(_ context.Context, _ *analyze.Context) (analyze.TC, error)
Consume resets state for the new commit. Detection is deferred until Languages() is called.
func (*LanguagesDetectionAnalyzer) Description ¶
func (l *LanguagesDetectionAnalyzer) Description() string
Description returns a human-readable description of the analyzer.
func (*LanguagesDetectionAnalyzer) Descriptor ¶
func (l *LanguagesDetectionAnalyzer) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*LanguagesDetectionAnalyzer) Flag ¶
func (l *LanguagesDetectionAnalyzer) Flag() string
Flag returns the CLI flag for the analyzer.
func (*LanguagesDetectionAnalyzer) Fork ¶
func (l *LanguagesDetectionAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*LanguagesDetectionAnalyzer) Initialize ¶
func (l *LanguagesDetectionAnalyzer) Initialize(_ *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*LanguagesDetectionAnalyzer) Languages ¶
func (l *LanguagesDetectionAnalyzer) Languages() map[gitlib.Hash]string
Languages returns detected languages, computing lazily on first call per commit. This avoids expensive language detection when downstream analyzers don't need it.
func (*LanguagesDetectionAnalyzer) ListConfigurationOptions ¶
func (l *LanguagesDetectionAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*LanguagesDetectionAnalyzer) Merge ¶
func (l *LanguagesDetectionAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*LanguagesDetectionAnalyzer) Name ¶
func (l *LanguagesDetectionAnalyzer) Name() string
Name returns the name of the analyzer.
func (*LanguagesDetectionAnalyzer) NewAggregator ¶
func (l *LanguagesDetectionAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*LanguagesDetectionAnalyzer) ReportFromTICKs ¶
func (l *LanguagesDetectionAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*LanguagesDetectionAnalyzer) Serialize ¶
func (l *LanguagesDetectionAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
Serialize writes the analysis result to the given writer.
func (*LanguagesDetectionAnalyzer) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*LanguagesDetectionAnalyzer) SetLanguages ¶
func (l *LanguagesDetectionAnalyzer) SetLanguages(languages map[gitlib.Hash]string)
SetLanguages sets the languages directly, marking them as parsed.
func (*LanguagesDetectionAnalyzer) SetLanguagesForTest ¶
func (l *LanguagesDetectionAnalyzer) SetLanguagesForTest(languages map[gitlib.Hash]string)
SetLanguagesForTest sets the languages directly (for testing only).
func (*LanguagesDetectionAnalyzer) WorkingStateSize ¶
func (l *LanguagesDetectionAnalyzer) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type LinesStatsCalculator ¶
type LinesStatsCalculator struct {
// Dependencies.
TreeDiff *TreeDiffAnalyzer
BlobCache *BlobCacheAnalyzer
FileDiff *FileDiffAnalyzer
// Output.
LineStats map[gitlib.ChangeEntry]pkgplumbing.LineStats
}
LinesStatsCalculator computes line-level statistics for file diffs.
func (*LinesStatsCalculator) AvgTCSize ¶
func (l *LinesStatsCalculator) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*LinesStatsCalculator) Configure ¶
func (l *LinesStatsCalculator) Configure(_ map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*LinesStatsCalculator) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*LinesStatsCalculator) Description ¶
func (l *LinesStatsCalculator) Description() string
Description returns a human-readable description of the analyzer.
func (*LinesStatsCalculator) Descriptor ¶
func (l *LinesStatsCalculator) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*LinesStatsCalculator) Flag ¶
func (l *LinesStatsCalculator) Flag() string
Flag returns the CLI flag for the analyzer.
func (*LinesStatsCalculator) Fork ¶
func (l *LinesStatsCalculator) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*LinesStatsCalculator) Initialize ¶
func (l *LinesStatsCalculator) Initialize(_ *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*LinesStatsCalculator) ListConfigurationOptions ¶
func (l *LinesStatsCalculator) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*LinesStatsCalculator) Merge ¶
func (l *LinesStatsCalculator) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*LinesStatsCalculator) Name ¶
func (l *LinesStatsCalculator) Name() string
Name returns the name of the analyzer.
func (*LinesStatsCalculator) NewAggregator ¶
func (l *LinesStatsCalculator) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*LinesStatsCalculator) ReportFromTICKs ¶
func (l *LinesStatsCalculator) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*LinesStatsCalculator) Serialize ¶
func (l *LinesStatsCalculator) Serialize(report analyze.Report, format string, writer io.Writer) error
Serialize writes the analysis result to the given writer.
func (*LinesStatsCalculator) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*LinesStatsCalculator) WorkingStateSize ¶
func (l *LinesStatsCalculator) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type Snapshot ¶
type Snapshot struct {
Changes gitlib.Changes
BlobCache map[gitlib.Hash]*gitlib.CachedBlob
FileDiffs map[string]pkgplumbing.FileDiffData
LineStats map[gitlib.ChangeEntry]pkgplumbing.LineStats
Languages map[gitlib.Hash]string
Tick int
AuthorID int
// UASTChanges ownership is transferred to the snapshot.
// The consumer must call ReleaseSnapshotUAST to free UAST trees.
UASTChanges []uast.Change
}
Snapshot captures the output state of all plumbing analyzers for one commit. Leaf analyzers use this to implement analyze.Parallelizable, keeping the framework agnostic of concrete plumbing types.
type TicksSinceStart ¶
type TicksSinceStart struct {
TickSize time.Duration
Tick int
// contains filtered or unexported fields
}
TicksSinceStart computes relative time ticks for each commit since the start.
func (*TicksSinceStart) AvgTCSize ¶
func (t *TicksSinceStart) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*TicksSinceStart) Configure ¶
func (t *TicksSinceStart) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*TicksSinceStart) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*TicksSinceStart) CurrentTick ¶
func (t *TicksSinceStart) CurrentTick() int
CurrentTick returns the tick value of the last processed commit.
func (*TicksSinceStart) Description ¶
func (t *TicksSinceStart) Description() string
Description returns a human-readable description of the analyzer.
func (*TicksSinceStart) Descriptor ¶
func (t *TicksSinceStart) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*TicksSinceStart) Flag ¶
func (t *TicksSinceStart) Flag() string
Flag returns the CLI flag for the analyzer.
func (*TicksSinceStart) Fork ¶
func (t *TicksSinceStart) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*TicksSinceStart) Initialize ¶
func (t *TicksSinceStart) Initialize(_ *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*TicksSinceStart) ListConfigurationOptions ¶
func (t *TicksSinceStart) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*TicksSinceStart) Merge ¶
func (t *TicksSinceStart) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*TicksSinceStart) Name ¶
func (t *TicksSinceStart) Name() string
Name returns the name of the analyzer.
func (*TicksSinceStart) NewAggregator ¶
func (t *TicksSinceStart) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*TicksSinceStart) ReportFromTICKs ¶
func (t *TicksSinceStart) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*TicksSinceStart) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*TicksSinceStart) WorkingStateSize ¶
func (t *TicksSinceStart) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type TreeDiffAnalyzer ¶
type TreeDiffAnalyzer struct {
NameFilter *regexp.Regexp
Languages map[string]bool
Repository *gitlib.Repository
SkipFiles []string
Changes gitlib.Changes
// contains filtered or unexported fields
}
TreeDiffAnalyzer computes tree-level diffs between commits.
func (*TreeDiffAnalyzer) AvgTCSize ¶
func (t *TreeDiffAnalyzer) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*TreeDiffAnalyzer) Configure ¶
func (t *TreeDiffAnalyzer) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*TreeDiffAnalyzer) Consume ¶
Consume processes a single commit with the provided dependency results.
func (*TreeDiffAnalyzer) Description ¶
func (t *TreeDiffAnalyzer) Description() string
Description returns a human-readable description of the analyzer.
func (*TreeDiffAnalyzer) Descriptor ¶
func (t *TreeDiffAnalyzer) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*TreeDiffAnalyzer) Flag ¶
func (t *TreeDiffAnalyzer) Flag() string
Flag returns the CLI flag for the analyzer.
func (*TreeDiffAnalyzer) Fork ¶
func (t *TreeDiffAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*TreeDiffAnalyzer) Initialize ¶
func (t *TreeDiffAnalyzer) Initialize(repository *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*TreeDiffAnalyzer) InjectPreparedData ¶
func (t *TreeDiffAnalyzer) InjectPreparedData( changes []*gitlib.Change, _ map[gitlib.Hash]*gitlib.CachedBlob, _ any, )
InjectPreparedData sets pre-computed changes from parallel preparation.
func (*TreeDiffAnalyzer) ListConfigurationOptions ¶
func (t *TreeDiffAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*TreeDiffAnalyzer) Merge ¶
func (t *TreeDiffAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*TreeDiffAnalyzer) Name ¶
func (t *TreeDiffAnalyzer) Name() string
Name returns the name of the analyzer.
func (*TreeDiffAnalyzer) NewAggregator ¶
func (t *TreeDiffAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*TreeDiffAnalyzer) ReportFromTICKs ¶
func (t *TreeDiffAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*TreeDiffAnalyzer) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*TreeDiffAnalyzer) WorkingStateSize ¶
func (t *TreeDiffAnalyzer) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.
type UASTChangesAnalyzer ¶
type UASTChangesAnalyzer struct {
TreeDiff *TreeDiffAnalyzer
BlobCache *BlobCacheAnalyzer
Goroutines int
// contains filtered or unexported fields
}
UASTChangesAnalyzer extracts UAST-level changes between commits. It uses lazy parsing - changes are only parsed when Changes() is called.
func (*UASTChangesAnalyzer) AvgTCSize ¶
func (c *UASTChangesAnalyzer) AvgTCSize() int64
AvgTCSize returns 0 — plumbing analyzers do not emit meaningful TC payloads.
func (*UASTChangesAnalyzer) Changes ¶
func (c *UASTChangesAnalyzer) Changes(ctx context.Context) []uast.Change
Changes returns parsed UAST changes, parsing lazily on first call per commit. This avoids expensive UAST parsing when downstream analyzers don't need it.
func (*UASTChangesAnalyzer) Configure ¶
func (c *UASTChangesAnalyzer) Configure(facts map[string]any) error
Configure sets up the analyzer with the provided facts.
func (*UASTChangesAnalyzer) Consume ¶
Consume resets state for the new commit. Parsing is deferred until Changes() is called. Releases previous commit's UAST trees back to the node/positions pools. If the context contains pre-computed UAST changes from the pipeline, they are used directly.
func (*UASTChangesAnalyzer) Description ¶
func (c *UASTChangesAnalyzer) Description() string
Description returns a human-readable description of the analyzer.
func (*UASTChangesAnalyzer) Descriptor ¶
func (c *UASTChangesAnalyzer) Descriptor() analyze.Descriptor
Descriptor returns stable analyzer metadata.
func (*UASTChangesAnalyzer) Flag ¶
func (c *UASTChangesAnalyzer) Flag() string
Flag returns the CLI flag for the analyzer.
func (*UASTChangesAnalyzer) Fork ¶
func (c *UASTChangesAnalyzer) Fork(n int) []analyze.HistoryAnalyzer
Fork creates a copy of the analyzer for parallel processing.
func (*UASTChangesAnalyzer) Initialize ¶
func (c *UASTChangesAnalyzer) Initialize(_ *gitlib.Repository) error
Initialize prepares the analyzer for processing commits.
func (*UASTChangesAnalyzer) ListConfigurationOptions ¶
func (c *UASTChangesAnalyzer) ListConfigurationOptions() []pipeline.ConfigurationOption
ListConfigurationOptions returns the configuration options for the analyzer.
func (*UASTChangesAnalyzer) Merge ¶
func (c *UASTChangesAnalyzer) Merge(_ []analyze.HistoryAnalyzer)
Merge combines results from forked analyzer branches.
func (*UASTChangesAnalyzer) Name ¶
func (c *UASTChangesAnalyzer) Name() string
Name returns the name of the analyzer.
func (*UASTChangesAnalyzer) NewAggregator ¶
func (c *UASTChangesAnalyzer) NewAggregator(_ analyze.AggregatorOptions) analyze.Aggregator
NewAggregator returns nil — plumbing analyzers do not aggregate.
func (*UASTChangesAnalyzer) ReportFromTICKs ¶
func (c *UASTChangesAnalyzer) ReportFromTICKs(_ context.Context, _ []analyze.TICK) (analyze.Report, error)
ReportFromTICKs returns ErrNotImplemented — plumbing analyzers do not produce reports.
func (*UASTChangesAnalyzer) Serialize ¶
func (c *UASTChangesAnalyzer) Serialize(report analyze.Report, format string, writer io.Writer) error
Serialize writes the analysis result to the given writer.
func (*UASTChangesAnalyzer) SerializeTICKs ¶
SerializeTICKs returns ErrNotImplemented — plumbing analyzers do not produce TICKs.
func (*UASTChangesAnalyzer) SetChanges ¶
func (c *UASTChangesAnalyzer) SetChanges(changes []uast.Change)
SetChanges sets the changes directly, marking them as parsed.
func (*UASTChangesAnalyzer) SetChangesForTest ¶
func (c *UASTChangesAnalyzer) SetChangesForTest(changes []uast.Change)
SetChangesForTest sets the changes directly (for testing only).
func (*UASTChangesAnalyzer) TransferChanges ¶
func (c *UASTChangesAnalyzer) TransferChanges() []uast.Change
TransferChanges returns the current changes and clears the internal reference without releasing the UAST trees. The caller takes ownership of the returned changes and is responsible for releasing them.
func (*UASTChangesAnalyzer) WorkingStateSize ¶
func (c *UASTChangesAnalyzer) WorkingStateSize() int64
WorkingStateSize returns 0 — plumbing analyzers are excluded from budget planning.