Repository Organization¶
osa_tool.operations.codebase.organization.organize
¶
Main orchestrator for repository reorganization.
RepoOrganizer
¶
Main orchestrator: detects project type, builds import maps, plans and executes reorganization.
Coordinates all aspects of repository reorganization including: - Project type detection - Import map building - Plan generation and validation - Snapshot creation and rollback - Action execution - Health checking and error fixing
__init__(config_manager, metadata=None)
¶
Initialize the repository organizer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_manager
|
ConfigManager
|
Configuration manager instance |
required |
metadata
|
Optional[RepositoryMetadata]
|
Optional repository metadata from the hosting platform |
None
|
get_repo_structure()
¶
Generate a tree representation of the repository structure.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
ASCII tree representation of the repository |
organize()
¶
Execute the complete reorganization process.
Performs the following steps: 1. Pre-reorganization health check 2. Create snapshot 3. Generate reorganization plan 4. Validate plan 5. Execute reorganization 6. Post-reorganization health check 7. Transfer changes back to original branch