Skip to content

fix(analyzer): cache resolved exclude paths#8062

Open
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/exclude-glob-cache
Open

fix(analyzer): cache resolved exclude paths#8062
omribz156 wants to merge 1 commit into
Checkmarx:masterfrom
omribz156:codex/exclude-glob-cache

Conversation

@omribz156
Copy link
Copy Markdown

Proposed Changes

  • Resolve --exclude-paths patterns once before the analyzer file walk instead of expanding globs for every candidate file.
  • Keep dynamically excluded paths from .gitignore, file-size checks, and config-file detection in the same lookup set.
  • Add coverage for a recursive glob exclude so only the non-excluded Terraform file contributes to analyzer file stats.

Related Issue

Closes #8061.

Checklist

I submit this contribution under the Apache-2.0 license.

Verification

  • go test ./pkg/analyzer
  • git diff --check

Additional local check:

  • go test ./pkg/engine/provider timed out locally on Windows after 124s.
  • go test ./pkg/engine/provider -run TestProvider_getExcludePaths -count=1 still fails on Windows path expectations unrelated to this patch (test_getExcludedPaths_with_double_start returns nil for the existing fixture glob).

Implemented with Codex assistance; I manually scoped and reviewed the analyzer-only change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Preparing Scan Assets): Bad performance, repetitive globbing

1 participant