⚡ Optimize repository discovery and fix blocking subrepo validation#18
⚡ Optimize repository discovery and fix blocking subrepo validation#18mudcube wants to merge 1 commit into
Conversation
- Fix blocking `find_repos` call in `src/subrepo/validation.rs` by wrapping it in `tokio::task::spawn_blocking` and making `validate_subrepos` async. - Propagate async/await changes to `subrepo` module and `main`. - Optimize `init_command` and `find_repos` to accept an optional repository filter, preventing unnecessary allocation and processing of non-target repositories during discovery. - Update `src/audit/scanner.rs` to leverage filtered discovery, improving performance when auditing specific repositories. - Add regression test `tests/subrepo_blocking_check.rs`. Co-authored-by: mudcube <101564+mudcube@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses performance issues related to repository discovery.
validate_subreposfunction was synchronous and blocked the async runtime (verified bytests/subrepo_blocking_check.rs). This PR makes it asynchronous and wraps the heavy discovery logic inspawn_blocking.init_command(used byaudit,push,pull, etc.) now accepts an optional list of target repositories. If provided, filtering happens during the directory walk (inside the blocking task), avoiding the creation of a massiveVecandDashMapentries for unwanted repositories. This significantly optimizes commands likerepos audit --repos my-repo.This fulfills the requirement to optimize repository discovery blocking issues and improves targeted command performance.
PR created automatically by Jules for task 14733534268053722062 started by @mudcube