Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

submit_repository

modules.code.router.submit_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 symbols

Loading

Calls (5)
SymbolFileResolved by
parse_repo_specgit_source.pythrough an import
validate_refgit_source.pythrough an import
submitjobs.pyunique name
get_notifiernotify.pythrough an import
job_outrouter.pysame file
Inside (1)
SymbolFileResolved by
routerrouter.pysame file
modules.code.router.submit_repositorybackend/app/modules/code/router.py, lines 117–135Open source
@router.post("/repositories", response_model=JobSubmitted, status_code=status.HTTP_202_ACCEPTED)def submit_repository(body: RepositorySubmit, db: Session = Depends(get_sync_db), _=Depends(require_admin)):    """Queue (or return the already-active) ingestion job for a repository."""    settings = get_settings()    try:        ref = parse_repo_spec(body.repository, allowed_hosts=settings.CODEINTEL_ALLOWED_GIT_HOSTS)        branch = validate_ref(body.branch)    except RepoSpecError as exc:        raise HTTPException(status_code=400, detail={"error": "invalid_repository", "detail": str(exc)}) from exc    try:        submission = jobs.submit(db, ref, branch, force=body.force, max_queued=settings.QUEUE_SIZE)    except jobs.QueueFull as exc:        raise HTTPException(            status_code=429,            detail={"error": "queue_full", "detail": str(exc), "queued": exc.queued, "limit": exc.limit},            headers={"Retry-After": "60"},        ) from exc    notified = get_notifier(settings).notify(str(submission.job.id)) if submission.created else False    return JobSubmitted(job=job_out(submission.job), created=submission.created, notified=notified)

What the index recorded

Signature
def submit_repository(body: RepositorySubmit, db: Session, _):
File
backend/app/modules/code/router.py
Lines
117–135
Parser
python-ast
Git blob
d914024790aaafe7234adda557677b76e4ad73d5
Call sites
11 named, 7 resolved, 4 left unlinked
Outside this subset
2 more edges reach code outside the graph shown here

Read it on GitHub at this commit