generated from coulomb/repo-seed
first review workflow slice
This commit is contained in:
@@ -69,6 +69,10 @@ class AnalysisRunCreate(BaseModel):
|
||||
source_path: str | None = None
|
||||
|
||||
|
||||
class CandidateGraphApproval(BaseModel):
|
||||
notes: str = ""
|
||||
|
||||
|
||||
app = FastAPI(title="Repository Ability Registry", version="0.1.0")
|
||||
|
||||
|
||||
@@ -161,6 +165,25 @@ def get_candidate_graph(
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post("/repos/{repository_id}/analysis-runs/{analysis_run_id}/candidate-graph/approve")
|
||||
def approve_candidate_graph(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
payload: CandidateGraphApproval,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.approve_candidate_graph(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
notes=payload.notes,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post("/repos/{repository_id}/abilities", status_code=201)
|
||||
def create_ability(
|
||||
repository_id: int,
|
||||
|
||||
Reference in New Issue
Block a user