Context:
To implement delta runs, CLI or IDE needs to know which entry methods and corresponding paths are impacted when a given file is changed. This PR caches a mapping of tainted files to entry methods that lead to paths involving these files.
By default, it creates a .sfge-cache directory on the location that executes the command and puts a fileToEntryMapData.json file with the mapping information.
Summary of changes:
New path expansion observer, TaintedFileTracker, to note down files that each ApexPath originating from an entry method traverses.
Changes to rule execution layers to return Result object instead of Set<Violations>. Result now includes FilesToEntriesMap data.
CacheCreator to handle cache file creation.
Two new environment variables to allow users to override cache directory and mapping filename.
Tests to verify Result and Cache behaviors.
File-based tests to verify that the file names and groupings are as expected. (See PathEntryCaptureTest.java)
Context: To implement delta runs, CLI or IDE needs to know which entry methods and corresponding paths are impacted when a given file is changed. This PR caches a mapping of tainted files to entry methods that lead to paths involving these files. By default, it creates a
.sfge-cache
directory on the location that executes the command and puts afileToEntryMapData.json
file with the mapping information.Summary of changes:
TaintedFileTracker
, to note down files that each ApexPath originating from an entry method traverses.Result
object instead ofSet<Violations>
.Result
now includesFilesToEntriesMap
data.PathEntryCaptureTest.java
)