Git Feature

The Git Feature module manages the definitions and producer contracts required for integrating with external Git repositories. Because MILTON follows a message-driven Vertical Slice Architecture, the actual repository cloning operations are entirely offloaded to the standalone MILTON.GitOperations worker service.

Business Logic Intent

When a user defines source repositories for a project, the MILTON API must clone and ingest these repositories to power the Document Generation and Clustering engines. To avoid blocking HTTP requests and to decouple intensive I/O operations from the primary API, this task is handled asynchronously via Wolverine.

The core intent of this feature is strictly to produce the commands that instruct the GitOperations worker to fetch code. The API does not consume the resulting output directly; rather, the code is synchronized to a shared volume (accessible by the API and Clustering service) or packaged and uploaded to the S3 claim-check store.

Architecture & Message Contracts

This module exclusively contains the API’s localized copy of the Git message contracts.

In MILTON’s microservice design, there is no shared contracts assembly. Instead, it uses Message Identity Parity. Both the API (producer) and MILTON.GitOperations (consumer) declare structurally-identical records adorned with the identical [MessageIdentity("clone-repositories")] attribute. Wolverine routes the message payload natively over RabbitMQ based on this identity.

Mermaid Sequence Diagram

sequenceDiagram
    autonumber
    participant Project API
    participant API Git Contracts
    participant RabbitMQ
    participant GitOperations Worker
    participant Shared Volume / S3

    Project API->>API Git Contracts: Instantiate CloneRepositoriesCommand
    API Git Contracts->>RabbitMQ: Publish(CloneRepositoriesCommand)
    Note over RabbitMQ: Routed via MessageIdentity("clone-repositories")
    RabbitMQ->>GitOperations Worker: Consume Command
    GitOperations Worker->>GitOperations Worker: Clone & Extract Repos
    GitOperations Worker->>Shared Volume / S3: Store Source Code Context

Modules and Components

Wolverine Contracts

  • CloneRepositoriesCommand: The primary integration message published to Wolverine. Contains the TenantId, ProjectId, and the list of repository requests.
  • CloneRepositoryRequest: Encapsulates the specific instructions for a single repository, including the RepositoryUrl, an optional GitToken (which is decrypted before sending if applicable), and a list of FileExclusions to optimize payload size.

0 items under this folder.