feat: improve maintainers detection [CM-1033]#3908
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR improves maintainer file detection in the git integration service by adding a multi-step discovery and analysis flow that combines static filename matching, dynamic ripgrep-based content search, and an AI fallback, while also surfacing more metadata about what was tried.
Changes:
- Added ripgrep-based repo scanning (
rg --filesand keyword search) with fallback toos.walk, plus scoring/filtering of dynamic candidates. - Refactored maintainer extraction to prioritize a previously saved maintainer file, then analyze top candidates, then use AI file suggestion as a last resort.
- Extended
MaintainerResultand service execution metrics to includecandidate_filesandai_suggested_file; addedripgrepto the Docker image.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py | New candidate discovery + fallback extraction flow; logs and metrics now include candidate/AI-suggested file metadata. |
| services/apps/git_integration/src/crowdgit/models/maintainer_info.py | Adds new result metadata fields (candidate_files, ai_suggested_file). |
| scripts/services/docker/Dockerfile.git_integration | Installs ripgrep in the runner image to support dynamic search. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
services/apps/git_integration/src/crowdgit/models/maintainer_info.py
Outdated
Show resolved
Hide resolved
services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py
Show resolved
Hide resolved
services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py
Show resolved
Hide resolved
services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py
Show resolved
Hide resolved
services/apps/git_integration/src/crowdgit/services/maintainer/maintainer_service.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
… detection Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
…rd in content Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
bc8e3df to
b4dd488
Compare
This pull request significantly improves the maintainer file detection and analysis logic for the git integration service. The main enhancements include a more robust and flexible approach to identifying maintainer-related files using both static lists and dynamic content-based search (via ripgrep), as well as improved handling and reporting of candidate files and AI-suggested files. Additionally, the changes introduce better error handling and metadata tracking throughout the maintainer extraction process.
Maintainer file detection and analysis improvements:
ripgrepto search for maintainer-related keywords across the repository, with fallback toos.walkifripgrepfails. This enables more accurate and comprehensive detection of potential maintainer files.Metadata and reporting enhancements:
MaintainerResultmodel to includecandidate_filesandai_suggested_filefields, allowing downstream consumers to see which files were considered and which file was suggested by AI.Dependency and utility updates:
ripgreptool to the Docker image to support fast and efficient content-based file search.These changes collectively make maintainer detection more reliable, transparent, and extensible, while also improving observability for debugging and future enhancements.
Note
Medium Risk
Modifies the maintainer detection/analysis flow and introduces repo-wide
rgsearches plus new fallback paths, which could affect accuracy, performance, and execution behavior across many repos.Overview
Improves maintainer extraction by prioritizing the previously saved maintainer file, then scanning the repo for likely governance files (expanded static filename list +
ripgrepkeyword search with filtering/scoring), and only falling back to AI filename selection as a last resort.Adds observability by returning/storing
candidate_filesandai_suggested_fileonMaintainerResultand persisting them inServiceExecution.metrics, and updates the git-integration Docker runner image to includeripgrep.Written by Cursor Bugbot for commit cc717d8. This will update automatically on new commits. Configure here.