generated from coulomb/repo-seed
Status drift warnings
This commit is contained in:
@@ -34,6 +34,8 @@ from repo_registry.web_api.schemas import (
|
||||
CandidateFeatureMerge,
|
||||
CandidateGraphApproval,
|
||||
CandidateGraphResponse,
|
||||
CharacteristicRebuildRequest,
|
||||
CharacteristicRebuildResponse,
|
||||
CandidateLeafRelink,
|
||||
CandidateRejection,
|
||||
CapabilityGapRequest,
|
||||
@@ -271,6 +273,33 @@ def create_analysis_run(
|
||||
return asdict(summary)
|
||||
|
||||
|
||||
@app.post(
|
||||
"/repos/{repository_id}/characteristics/rebuild",
|
||||
tags=["analysis"],
|
||||
response_model=CharacteristicRebuildResponse,
|
||||
)
|
||||
def rebuild_characteristics_from_scratch(
|
||||
repository_id: int,
|
||||
payload: CharacteristicRebuildRequest,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.rebuild_characteristics_from_scratch(
|
||||
repository_id,
|
||||
dry_run=payload.dry_run,
|
||||
confirm=payload.confirm,
|
||||
source_path=payload.source_path,
|
||||
use_cached_checkout=payload.use_cached_checkout,
|
||||
use_llm_assistance=payload.use_llm_assistance,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.get(
|
||||
"/repos/{repository_id}/analysis-runs",
|
||||
tags=["analysis"],
|
||||
|
||||
@@ -289,6 +289,25 @@ class AnalysisRunChangeApproval(BaseModel):
|
||||
}
|
||||
|
||||
|
||||
class CharacteristicRebuildRequest(BaseModel):
|
||||
dry_run: bool = True
|
||||
confirm: bool = False
|
||||
source_path: str | None = None
|
||||
use_cached_checkout: bool = False
|
||||
use_llm_assistance: bool = True
|
||||
|
||||
|
||||
class CharacteristicRebuildResponse(BaseModel):
|
||||
repository: RepositoryResponse
|
||||
analysis_run: AnalysisRunResponse
|
||||
dry_run: bool
|
||||
confirmed: bool
|
||||
cleared_approved: bool
|
||||
previous_counts: dict[str, int]
|
||||
previous_ids: dict[str, list[int]]
|
||||
candidate_counts: dict[str, int]
|
||||
|
||||
|
||||
class CandidateRejection(BaseModel):
|
||||
notes: str = ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user