Handlers
Contains the Wolverine message handlers that orchestrate Git operation commands.
CloneRepositoriesHandler
The CloneRepositoriesHandler is implemented as a static class, adhering to Wolverine’s optimized handler patterns. Dependency injection resolves IGitCloneService, IMessageBus, and ILogger directly at the method level.
Business Logic Intent
The core objective is to execute the command reliably while producing comprehensive telemetry.
- Delegation: It receives the
CloneRepositoriesCommandand passes it entirely toIGitCloneService.CloneAllRepositoriesAsync. - Aggregation & Logging: Upon completion, it measures the successes versus failures. If any clones failed, it emits specific warning logs to trace exactly which repositories were problematic and why.
- Completion Event: After cloning finishes it publishes a
RepositoriesClonedMessage(identityrepositories-cloned) viaIMessageBus. The event is published even when some (or all) clones fail, so the API always re-reads its repository listing and its cached S3 directory does not go stale. - Response: It builds and returns a
CloneRepositoriesResultwhich Wolverine can automatically route back to the requesting service or use to trigger subsequent events.