Skip to content

feat: add support for Context Exclusion in Knowledge Graph

What does this MR do and why?

Adds the ability to specify paths to exclude from the knowledge graph for a project that follow .gitignore style patterns

  • New API endpoint (/api/project/context-exclusion) that accepts exclusion patterns for a project and triggers re-indexing when patterns change
  • Project metadata enhancement to store context exclusion patterns alongside other project information
  • Indexing pipeline integration that applies exclusion patterns during both full and incremental indexing operations
  • Pattern matching using the ignore crate's override functionality to filter files based on user-defined patterns

Related Issues

Testing

  1. Exclude some content:
curl -X POST http://localhost:27495/api/project/context-exclusion \
  -H "Content-Type: application/json" \
  -d '{
    "project_path": "/path/to/your/workspace/project",
    "patterns": [
      "*.test.rb",
      "spec/**",
      "fixtures/**",
      "node_modules/**"
    ]
  }'
  1. Search for excluded content:
curl "http://localhost:27495/api/graph/search/{workspace_folder_path}/{project_path}?query=SomeClassInTestFile"

Performance Analysis

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.

Issue #200

Edited by Allen Cook

Merge request reports

Loading