fix: normalize paths for exclude glob matching (#67)#123
Conversation
When validate_project() is called with an absolute path, the walker produces absolute entry paths that fail to match relative exclude patterns like `target/**`. Fix by stripping the base path prefix before glob matching.
Summary of ChangesHello @avifenesh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a bug that prevented exclude glob patterns from working correctly with absolute paths. It introduces path normalization to ensure accurate glob matching and includes new tests to verify the fix. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 340c184ea1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Code Review
This pull request correctly identifies and fixes a bug where exclude glob patterns failed on absolute paths. The approach of stripping the base path prefix is sound, and the added tests are comprehensive, covering absolute, relative, and nested directory scenarios. The identified area for improvement regarding path normalization remains valid and will make the solution more robust and cross-platform compatible.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where exclude glob patterns (e.g., target/**) failed to match files when validate_project() was called with absolute paths. The fix normalizes entry paths to relative paths before glob matching by using strip_prefix() to remove the base path.
Changes:
- Added path normalization in
validate_project_with_registry()to convert absolute entry paths to relative before glob matching - Added 3 comprehensive tests covering absolute paths, relative paths, and nested directories
- Updated CHANGELOG.md to document the fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/agnix-core/src/lib.rs | Implements path normalization using strip_prefix() before glob matching and adds three comprehensive tests for exclude pattern behavior |
| CHANGELOG.md | Documents the bug fix for exclude glob pattern matching with absolute paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* fix: resolve security alerts (serialize-javascript, XP-SK-001) - Remove non-standard `version` field from SKILL.md frontmatter (fixes code scanning alert #1062, XP-SK-001) - Override serialize-javascript to ^7.0.5 in website and vscode extension to fix CPU exhaustion DoS vulnerability (fixes Dependabot alerts #122 and #123) * fix: address review feedback - add engines.node, changelog entry - Add engines.node >= 20.0.0 to website and vscode extension (serialize-javascript@7 requires Node 20+) - Add CHANGELOG.md entry for security fixes * fix: merge engines.node into existing engines block Avoid overwriting engines.vscode by merging the Node constraint into the existing engines object instead of adding a duplicate key. * fix: merge duplicate Fixed headings in changelog
Summary
target/**) failed to match whenvalidate_project()was called with absolute pathsstrip_prefix(path)to convert absolute entry paths to relative before glob matchingTest Plan
cargo clippypasses with no warningsRelated Issues
Closes #67