Skip to content

Extract filesystem selector matching#382

Merged
autholykos merged 1 commit intomainfrom
session/pathselector-simplification
May 1, 2026
Merged

Extract filesystem selector matching#382
autholykos merged 1 commit intomainfrom
session/pathselector-simplification

Conversation

@autholykos
Copy link
Copy Markdown
Member

Summary

  • extract shared pathselector validation and recursive matching for filesystem source selectors
  • route config validation and source selection through the same selector contract
  • move low-level selector matcher tests into the new package while keeping source integration coverage

Tests

  • go test ./...

Copilot AI review requested due to automatic review settings May 1, 2026 12:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extracts filesystem source selector validation and recursive matching into a shared internal/pathselector package, then reuses that contract from both config validation and source selection explanation, while relocating low-level matcher tests into the new package.

Changes:

  • Introduce internal/pathselector with Compile/Validate/Match and recursive ** matching.
  • Route filesystem selector validation in config through pathselector.Validate.
  • Update source explanation matching to use pathselector.Match and move relevant tests to the new package.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/source/filesystem_test.go Removes selector/matcher unit tests that are now owned by internal/pathselector.
internal/source/explain.go Switches selector matching to pathselector.Match and removes inlined matcher implementation.
internal/pathselector/pathselector.go Adds the shared selector compiler/validator and recursive matcher.
internal/pathselector/pathselector_test.go Adds unit tests for recursive matching and validation errors.
internal/config/config.go Uses pathselector.Validate for filesystem source include/exclude pattern validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/pathselector/pathselector.go Outdated
@autholykos autholykos force-pushed the session/pathselector-simplification branch from d992ddd to e0b8d4a Compare May 1, 2026 12:37
@autholykos autholykos merged commit 6777895 into main May 1, 2026
5 checks passed
@autholykos autholykos deleted the session/pathselector-simplification branch May 1, 2026 12:42
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.

2 participants