Skip to content

fix(walker): handle large directories#995

Merged
tusharmath merged 3 commits intomainfrom
walker-max-length
Jun 20, 2025
Merged

fix(walker): handle large directories#995
tusharmath merged 3 commits intomainfrom
walker-max-length

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Jun 20, 2025

Summary

This refactoring centralizes filesystem traversal configuration by moving the Walker implementation from forge_services to forge_app, streamlines workflow configuration handling with improved merging capabilities, and integrates the Walker pattern throughout the codebase for more consistent file discovery operations.

Key Changes

  • Centralized Walker Configuration: Moved Walker and WalkedFile from forge_services::infra to forge_app::walker for better organization and reusability
  • Streamlined Workflow Handling: Replaced direct workflow reading with merged configuration approach using read_merged() method
  • Improved File Discovery: Updated FileDiscoveryService to use Walker configuration instead of simple depth parameters
  • Configuration Consolidation: Moved max_walker_depth from agent-specific to global configuration in forge.default.yaml

Technical Details

Walker Refactoring

  • Created new forge_app::walker module with Walker struct providing conservative and unlimited presets
  • Updated all services to use the centralized Walker configuration
  • Maintained backward compatibility while improving configurability

Workflow Integration

  • Replaced WorkflowService::read_workflow() calls with read_merged() for better configuration handling
  • Integrated workflow-based walker depth configuration into the new Walker pattern
  • Simplified configuration passing between services

API Updates

  • Updated FileDiscoveryService::collect() to collect_files() with Walker parameter
  • Modified discovery service implementations to use unified Walker configuration
  • Updated API endpoints to use new configuration approach

Files Modified

  • crates/forge_app/src/walker.rs - New centralized Walker implementation
  • crates/forge_app/src/app.rs - Integrated Walker with workflow configuration
  • crates/forge_services/src/infra.rs - Removed duplicate Walker types
  • crates/forge_services/src/discovery.rs - Updated to use centralized Walker
  • forge.default.yaml - Moved max_walker_depth to global configuration

This refactoring improves code organization, reduces duplication, and provides a more flexible foundation for filesystem traversal operations across the application.

@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Jun 20, 2025
@tusharmath tusharmath changed the title refactor: streamline workflow retrieval in ForgeApp and update YAML configuration fix: use a merged version of the workflow config Jun 20, 2025
@tusharmath tusharmath changed the title fix: use a merged version of the workflow config refactor(walker): centralize filesystem traversal configuration and streamline workflow handling Jun 20, 2025
@tusharmath tusharmath changed the title refactor(walker): centralize filesystem traversal configuration and streamline workflow handling fix(walker): handle large directories Jun 20, 2025
@tusharmath tusharmath merged commit 353b262 into main Jun 20, 2025
8 checks passed
ssddOnTop pushed a commit that referenced this pull request Jun 21, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore Routine tasks like conversions, reorganization, and maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant