Skip to content

fix: normalize paths for exclude glob matching (#67)#123

Merged
avifenesh merged 3 commits intomainfrom
fix/exclude-glob-67
Feb 3, 2026
Merged

fix: normalize paths for exclude glob matching (#67)#123
avifenesh merged 3 commits intomainfrom
fix/exclude-glob-67

Conversation

@avifenesh
Copy link
Copy Markdown
Collaborator

Summary

  • Fixed bug where exclude glob patterns (e.g., target/**) failed to match when validate_project() was called with absolute paths
  • Added path normalization using strip_prefix(path) to convert absolute entry paths to relative before glob matching
  • Added 3 comprehensive tests for absolute paths, relative paths, and nested directories

Test Plan

  • All 663 existing tests pass
  • New tests verify fix with absolute and relative paths
  • cargo clippy passes with no warnings
  • Release build succeeds

Related Issues

Closes #67

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.
Copilot AI review requested due to automatic review settings February 3, 2026 10:42
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Bug Fix: Addresses an issue where exclude glob patterns failed to match when validate_project() was called with absolute paths.
  • Path Normalization: Implements path normalization using strip_prefix(path) to convert absolute entry paths to relative paths before glob matching.
  • Testing: Includes 3 new tests to ensure correct behavior with absolute paths, relative paths, and nested directories.
Changelog
  • CHANGELOG.md
    • Added a note about the fix for exclude glob patterns matching with absolute paths.
    • Mentioned the path normalization by stripping base path prefix before glob matching.
  • crates/agnix-core/src/lib.rs
    • Implemented path normalization using strip_prefix(path) to convert absolute entry paths to relative paths before glob matching.
Activity
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@claude
Copy link
Copy Markdown

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copy link
Copy Markdown
Contributor

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

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.

@avifenesh avifenesh merged commit a0278c9 into main Feb 3, 2026
12 checks passed
@avifenesh avifenesh deleted the fix/exclude-glob-67 branch February 3, 2026 10:56
avifenesh added a commit that referenced this pull request Mar 28, 2026
- 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)
avifenesh added a commit that referenced this pull request Mar 28, 2026
* 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
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.

Fix exclude glob matching when walker yields absolute paths

2 participants