Documentation ¶
Index ¶
- Constants
- func VisitEachNode(root nodes.Node, payload func(nodes.Node))
- type Change
- type Changes
- func (uc *Changes) Configure(facts map[string]interface{}) error
- func (uc *Changes) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (uc *Changes) Features() []string
- func (uc *Changes) Fork(n int) []core.PipelineItem
- func (uc *Changes) Initialize(repository *git.Repository) error
- func (uc *Changes) ListConfigurationOptions() []core.ConfigurationOption
- func (uc *Changes) Name() string
- func (uc *Changes) Provides() []string
- func (uc *Changes) Requires() []string
- type ChangesSaver
- func (saver *ChangesSaver) Configure(facts map[string]interface{}) error
- func (saver *ChangesSaver) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (saver *ChangesSaver) Description() string
- func (saver *ChangesSaver) Features() []string
- func (saver *ChangesSaver) Finalize() interface{}
- func (saver *ChangesSaver) Flag() string
- func (saver *ChangesSaver) Fork(n int) []core.PipelineItem
- func (saver *ChangesSaver) Initialize(repository *git.Repository) error
- func (saver *ChangesSaver) ListConfigurationOptions() []core.ConfigurationOption
- func (saver *ChangesSaver) Name() string
- func (saver *ChangesSaver) Provides() []string
- func (saver *ChangesSaver) Requires() []string
- func (saver *ChangesSaver) Serialize(result interface{}, binary bool, writer io.Writer) error
- type ChangesXPather
- type Extractor
- func (exr *Extractor) Configure(facts map[string]interface{}) error
- func (exr *Extractor) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (exr *Extractor) Features() []string
- func (exr *Extractor) Fork(n int) []core.PipelineItem
- func (exr *Extractor) Initialize(repository *git.Repository) error
- func (exr *Extractor) ListConfigurationOptions() []core.ConfigurationOption
- func (exr *Extractor) Name() string
- func (exr *Extractor) Provides() []string
- func (exr *Extractor) Requires() []string
- type FileDiffRefiner
- func (ref *FileDiffRefiner) Configure(facts map[string]interface{}) error
- func (ref *FileDiffRefiner) Consume(deps map[string]interface{}) (map[string]interface{}, error)
- func (ref *FileDiffRefiner) Features() []string
- func (ref *FileDiffRefiner) Fork(n int) []core.PipelineItem
- func (ref *FileDiffRefiner) Initialize(repository *git.Repository) error
- func (ref *FileDiffRefiner) ListConfigurationOptions() []core.ConfigurationOption
- func (ref *FileDiffRefiner) Name() string
- func (ref *FileDiffRefiner) Provides() []string
- func (ref *FileDiffRefiner) Requires() []string
Constants ¶
const ( // ConfigUASTEndpoint is the name of the configuration option (Extractor.Configure()) // which sets the Babelfish server address. ConfigUASTEndpoint = "ConfigUASTEndpoint" // ConfigUASTTimeout is the name of the configuration option (Extractor.Configure()) // which sets the maximum amount of time to wait for a Babelfish server response. ConfigUASTTimeout = "ConfigUASTTimeout" // ConfigUASTPoolSize is the name of the configuration option (Extractor.Configure()) // which sets the number of goroutines to run for UAST parse queries. ConfigUASTPoolSize = "ConfigUASTPoolSize" // ConfigUASTFailOnErrors is the name of the configuration option (Extractor.Configure()) // which enables early exit in case of any Babelfish UAST parsing errors. ConfigUASTFailOnErrors = "ConfigUASTFailOnErrors" // FeatureUast is the name of the Pipeline feature which activates all the items related to UAST. FeatureUast = "uast" // DependencyUasts is the name of the dependency provided by Extractor. DependencyUasts = "uasts" )
const ( // ConfigUASTChangesSaverOutputPath is the name of the configuration option // (ChangesSaver.Configure()) which sets the target directory where to save the files. ConfigUASTChangesSaverOutputPath = "ChangesSaver.OutputPath" )
const (
// DependencyUastChanges is the name of the dependency provided by Changes.
DependencyUastChanges = "changed_uasts"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶
Change is the type of the items in the list of changes which is provided by Changes.
type Changes ¶
type Changes struct { core.NoopMerger // contains filtered or unexported fields }
Changes is a structured analog of TreeDiff: it provides UASTs for every logical change in a commit. It is a PipelineItem.
func (*Changes) Configure ¶
Configure sets the properties previously published by ListConfigurationOptions().
func (*Changes) Consume ¶
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*Changes) Features ¶
Features which must be enabled for this PipelineItem to be automatically inserted into the DAG.
func (*Changes) Fork ¶
func (uc *Changes) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*Changes) Initialize ¶
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*Changes) ListConfigurationOptions ¶
func (uc *Changes) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*Changes) Name ¶
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*Changes) Provides ¶
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.
type ChangesSaver ¶
type ChangesSaver struct { core.NoopMerger core.OneShotMergeProcessor // OutputPath points to the target directory with UASTs OutputPath string // contains filtered or unexported fields }
ChangesSaver dumps changed files and corresponding UASTs for every commit. it is a LeafPipelineItem.
func (*ChangesSaver) Configure ¶
func (saver *ChangesSaver) Configure(facts map[string]interface{}) error
Configure sets the properties previously published by ListConfigurationOptions().
func (*ChangesSaver) Consume ¶
func (saver *ChangesSaver) Consume(deps map[string]interface{}) (map[string]interface{}, error)
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*ChangesSaver) Description ¶
func (saver *ChangesSaver) Description() string
Description returns the text which explains what the analysis is doing.
func (*ChangesSaver) Features ¶
func (saver *ChangesSaver) Features() []string
Features which must be enabled for this PipelineItem to be automatically inserted into the DAG.
func (*ChangesSaver) Finalize ¶
func (saver *ChangesSaver) Finalize() interface{}
Finalize returns the result of the analysis. Further Consume() calls are not expected.
func (*ChangesSaver) Flag ¶
func (saver *ChangesSaver) Flag() string
Flag for the command line switch which enables this analysis.
func (*ChangesSaver) Fork ¶
func (saver *ChangesSaver) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*ChangesSaver) Initialize ¶
func (saver *ChangesSaver) Initialize(repository *git.Repository) error
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*ChangesSaver) ListConfigurationOptions ¶
func (saver *ChangesSaver) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*ChangesSaver) Name ¶
func (saver *ChangesSaver) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*ChangesSaver) Provides ¶
func (saver *ChangesSaver) Provides() []string
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.
func (*ChangesSaver) Requires ¶
func (saver *ChangesSaver) Requires() []string
Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.
type ChangesXPather ¶
type ChangesXPather struct {
XPath string
}
ChangesXPather extracts changed UAST nodes from files changed in the current commit.
func (ChangesXPather) Extract ¶
func (xpather ChangesXPather) Extract(changes []Change) []nodes.Node
Extract returns the list of new or changed UAST nodes filtered by XPath.
type Extractor ¶
type Extractor struct { core.NoopMerger Endpoint string Context func() (context.Context, context.CancelFunc) PoolSize int FailOnErrors bool ProcessedFiles map[string]int // contains filtered or unexported fields }
Extractor retrieves UASTs from Babelfish server which correspond to changed files in a commit. It is a PipelineItem.
func (*Extractor) Configure ¶
Configure sets the properties previously published by ListConfigurationOptions().
func (*Extractor) Consume ¶
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*Extractor) Features ¶
Features which must be enabled for this PipelineItem to be automatically inserted into the DAG.
func (*Extractor) Fork ¶
func (exr *Extractor) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*Extractor) Initialize ¶
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*Extractor) ListConfigurationOptions ¶
func (exr *Extractor) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*Extractor) Name ¶
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*Extractor) Provides ¶
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.
type FileDiffRefiner ¶
type FileDiffRefiner struct {
core.NoopMerger
}
FileDiffRefiner uses UASTs to improve the human interpretability of diffs. It is a PipelineItem. The idea behind this algorithm is simple: in case of multiple choices which are equally optimal, choose the one which touches less AST nodes.
func (*FileDiffRefiner) Configure ¶
func (ref *FileDiffRefiner) Configure(facts map[string]interface{}) error
Configure sets the properties previously published by ListConfigurationOptions().
func (*FileDiffRefiner) Consume ¶
func (ref *FileDiffRefiner) Consume(deps map[string]interface{}) (map[string]interface{}, error)
Consume runs this PipelineItem on the next commit data. `deps` contain all the results from upstream PipelineItem-s as requested by Requires(). Additionally, DependencyCommit is always present there and represents the analysed *object.Commit. This function returns the mapping with analysis results. The keys must be the same as in Provides(). If there was an error, nil is returned.
func (*FileDiffRefiner) Features ¶
func (ref *FileDiffRefiner) Features() []string
Features which must be enabled for this PipelineItem to be automatically inserted into the DAG.
func (*FileDiffRefiner) Fork ¶
func (ref *FileDiffRefiner) Fork(n int) []core.PipelineItem
Fork clones this PipelineItem.
func (*FileDiffRefiner) Initialize ¶
func (ref *FileDiffRefiner) Initialize(repository *git.Repository) error
Initialize resets the temporary caches and prepares this PipelineItem for a series of Consume() calls. The repository which is going to be analysed is supplied as an argument.
func (*FileDiffRefiner) ListConfigurationOptions ¶
func (ref *FileDiffRefiner) ListConfigurationOptions() []core.ConfigurationOption
ListConfigurationOptions returns the list of changeable public properties of this PipelineItem.
func (*FileDiffRefiner) Name ¶
func (ref *FileDiffRefiner) Name() string
Name of this PipelineItem. Uniquely identifies the type, used for mapping keys, etc.
func (*FileDiffRefiner) Provides ¶
func (ref *FileDiffRefiner) Provides() []string
Provides returns the list of names of entities which are produced by this PipelineItem. Each produced entity will be inserted into `deps` of dependent Consume()-s according to this list. Also used by core.Registry to build the global map of providers.
func (*FileDiffRefiner) Requires ¶
func (ref *FileDiffRefiner) Requires() []string
Requires returns the list of names of entities which are needed by this PipelineItem. Each requested entity will be inserted into `deps` of Consume(). In turn, those entities are Provides() upstream.