Skip to content

refactor: migrate walker functionality to forge_infra with new abstractions#994

Merged
tusharmath merged 2 commits intomainfrom
refactor-walker-infra
Jun 20, 2025
Merged

refactor: migrate walker functionality to forge_infra with new abstractions#994
tusharmath merged 2 commits intomainfrom
refactor-walker-infra

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Jun 20, 2025

Summary

This refactoring migrates the filesystem walker functionality from forge_services to forge_infra, introducing new infrastructure abstractions that improve separation of concerns and enable better dependency injection patterns. The changes establish a cleaner architecture where infrastructure concerns are properly isolated from service logic.

Key Changes

Infrastructure Migration

  • Moved walker implementation from forge_services to forge_infra as
  • Added WalkerInfra trait in forge_services/infra.rs for dependency injection
  • Created WalkerConfig with conservative and unlimited preset configurations

Service Layer Improvements

  • Updated ForgeFsSearch to use WalkerInfra dependency injection instead of direct forge_walker usage
  • Enhanced file discovery service to use the new walker infrastructure
  • Improved async file operations by replacing File::open with tokio::fs::read_to_string

Testing Enhancements

  • Added comprehensive tests for ForgeWalkerService with both conservative and unlimited configurations
  • Implemented MockInfra for testing ForgeFsSearch without filesystem dependencies
  • Maintained test coverage across all modified components

Technical Impact

  • Better separation of concerns: Infrastructure logic now properly separated from service logic
  • Improved testability: Services can now be tested with mock infrastructure implementations
  • Enhanced maintainability: Clear dependency boundaries make the codebase easier to understand and modify

Files Changed

  • : Added walker service and updated dependencies
  • : Updated to use new infrastructure abstractions
  • files: Updated dependency declarations

This refactoring maintains full backward compatibility while establishing a foundation for future infrastructure improvements.

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Jun 20, 2025
@tusharmath tusharmath changed the title feat: integrate walker service into file discovery and search functionalities refactor: move walker into forge_infra Jun 20, 2025
@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: move walker into forge_infra refactor: migrate walker functionality to forge_infra with new abstractions Jun 20, 2025
@tusharmath tusharmath merged commit 694598f into main Jun 20, 2025
8 checks passed
@amitksingh1490 amitksingh1490 deleted the refactor-walker-infra branch November 14, 2025 10:02
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. type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant