generated from coulomb/repo-seed
Git ingestion part of Milestone 2
This commit is contained in:
@@ -7,11 +7,13 @@ from fastapi import Depends, FastAPI, HTTPException
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from repo_registry.core.service import RegistryService
|
||||
from repo_registry.repo_ingestion.git import GitIngestionService
|
||||
from repo_registry.storage.sqlite import NotFoundError, RegistryStore
|
||||
|
||||
|
||||
class Settings(BaseModel):
|
||||
database_path: str = Field(default="var/repo-registry.sqlite3")
|
||||
checkout_root: str = Field(default="var/checkouts")
|
||||
|
||||
|
||||
def get_settings() -> Settings:
|
||||
@@ -23,7 +25,7 @@ def get_service(settings: Settings = Depends(get_settings)) -> RegistryService:
|
||||
database_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
store = RegistryStore(database_path)
|
||||
store.initialize()
|
||||
return RegistryService(store)
|
||||
return RegistryService(store, ingestion=GitIngestionService(settings.checkout_root))
|
||||
|
||||
|
||||
class RepositoryCreate(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user