Skip to content

⚡ Optimize repository discovery and fix blocking subrepo validation#18

Open
mudcube wants to merge 1 commit into
mainfrom
perf-subrepo-blocking-and-filtered-discovery-14733534268053722062
Open

⚡ Optimize repository discovery and fix blocking subrepo validation#18
mudcube wants to merge 1 commit into
mainfrom
perf-subrepo-blocking-and-filtered-discovery-14733534268053722062

Conversation

@mudcube

@mudcube mudcube commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

This PR addresses performance issues related to repository discovery.

  1. Blocking Subrepo Validation: The validate_subrepos function was synchronous and blocked the async runtime (verified by tests/subrepo_blocking_check.rs). This PR makes it asynchronous and wraps the heavy discovery logic in spawn_blocking.
  2. Optimized Filtered Discovery: The init_command (used by audit, 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 massive Vec and DashMap entries for unwanted repositories. This significantly optimizes commands like repos audit --repos my-repo.
  3. Refactoring: Updated all command handlers to support the new async/filtered discovery signature.

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

- 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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant