first review workflow slice
This commit is contained in:
parent
519b7726e7
commit
8f94c38309
7 changed files with 198 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue