-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Summary
Add tracking of skipped entries to InventoryPart so that the system can report how many entries were excluded during inventory building and why.
Background
Currently, InventoryPart tracks:
FileDescriptions— files included in inventoryDirectoryDescriptions— directories included in inventoryIsIncompleteDueToAccess— flag for access errors
There is no tracking of entries that were intentionally skipped (hidden files, noise files, symlinks, etc.).
Proposed Changes
Add to InventoryPart
public class InventoryPart
{
// Existing properties...
/// <summary>
/// Entries that were skipped during inventory building.
/// </summary>
public List<SkippedEntry> SkippedEntries { get; } = new();
/// <summary>
/// Total count of skipped entries.
/// </summary>
public int SkippedCount => SkippedEntries.Count;
/// <summary>
/// Count of entries skipped for a specific reason.
/// </summary>
public int GetSkippedCountByReason(SkipReason reason)
=> SkippedEntries.Count(e => e.Reason == reason);
}Integration in InventoryBuilder
Add a helper method to record skipped entries:
private void RecordSkippedEntry(InventoryPart part, FileSystemInfo fsi, SkipReason reason, FileSystemEntryKind? kind = null)
{
var skipped = new SkippedEntry
{
FullPath = fsi.FullName,
RelativePath = BuildRelativePath(part, fsi),
Name = fsi.Name,
Reason = reason,
DetectedKind = kind
};
part.SkippedEntries.Add(skipped);
}Update Skip Points
Modify all skip points in InventoryBuilder to call RecordSkippedEntry:
ShouldIgnoreHiddenFile()→SkipReason.HiddenShouldIgnoreHiddenDirectory()→SkipReason.HiddenShouldIgnoreSystemFile()→SkipReason.NoiseFileorSkipReason.SystemAttributeIsReparsePoint()→SkipReason.Symlink- POSIX special file detection →
SkipReason.SpecialPosixFile IsOffline()/IsRecallOnDataAccess()→SkipReason.Offline- Access exceptions →
SkipReason.Inaccessible
Acceptance Criteria
- Add
SkippedEntrieslist toInventoryPart - Add
SkippedCountproperty - Add
GetSkippedCountByReason()method - Create
RecordSkippedEntry()helper inInventoryBuilder - Update all skip points to record entries
- Integration tests verifying skipped entries are tracked
- Verify no performance regression with large directories
Technical Notes
SkippedEntriesis NOT serialized to inventory files (runtime only)- Consider memory impact for directories with many excluded files
- May want to add a cap or sampling for extreme cases (future enhancement)
Dependencies
- Requires:
SkippedEntrymodel andSkipReasonenum (issue #X)
Priority
Standard — Foundation for UI reporting of skipped entries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels