Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
delete_repository
modules.code.router.delete_repository
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
modules.code.router.delete_repositorybackend/app/modules/code/router.py, lines 156–170Open source
@router.delete("/repositories/{repo_id}", status_code=status.HTTP_204_NO_CONTENT)def delete_repository(repo_id: uuid.UUID, db: Session = Depends(get_sync_db), _=Depends(require_admin)): """Delete a repository's index (chunks, edges, file records). Source is untouched.""" repo = _get_repo(db, repo_id) active = db.execute( select(IngestionJob.id).where(IngestionJob.repo_url == repo.url, IngestionJob.status == "running") ).first() if active: raise HTTPException(status_code=409, detail={"error": "job_running", "detail": "wait for the running job"}) db.execute(delete(CodeEdge).where(CodeEdge.repository_id == repo_id)) db.execute(delete(DocumentChunk).where(DocumentChunk.repository_id == repo_id)) db.execute(delete(Resource).where(Resource.repository_id == repo_id)) db.execute(delete(Repository).where(Repository.id == repo_id)) db.commit() return Response(status_code=status.HTTP_204_NO_CONTENT)What the index recorded
- Signature
def delete_repository(repo_id: uuid.UUID, db: Session, _):- File
backend/app/modules/code/router.py- Lines
- 156–170
- Parser
- python-ast
- Git blob
d914024790aaafe7234adda557677b76e4ad73d5- Call sites
- 9 named, 4 resolved, 5 left unlinked
- Outside this subset
- 3 more edges reach code outside the graph shown here
