Back to the room

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

Code Observatory / method

get_or_create_repository

codeintel.indexer.CodeIndexer.get_or_create_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

Called by (1)
SymbolFileResolved by
indexindexer.pysame file
Inside (1)
SymbolFileResolved by
CodeIndexerindexer.pysame file
codeintel.indexer.CodeIndexer.get_or_create_repositorybackend/app/codeintel/indexer.py, lines 163–183Open source
    def get_or_create_repository(self, ref: RepoRef, branch: str | None) -> Repository:        repo = self.db.execute(            select(Repository).where(Repository.url == ref.canonical_url)        ).scalar_one_or_none()        if repo is None:            repo = Repository(                url=ref.canonical_url,                name=ref.name,                repo_metadata={},                source_type=ref.source_type,                branch=branch,                local_path=ref.local_path,                index_status="never_indexed",            )            self.db.add(repo)            self.db.flush()        else:            repo.branch = branch            if ref.local_path:                repo.local_path = ref.local_path        return repo

What the index recorded

Signature
def get_or_create_repository(self, ref: RepoRef, branch: str | None) -> Repository:
File
backend/app/codeintel/indexer.py
Lines
163–183
Parser
python-ast
Git blob
e8fdfa7b5545e821f7649d68cfadd2aae85b89d0
Call sites
7 named, 4 resolved, 3 left unlinked
Outside this subset
4 more edges reach code outside the graph shown here

Read it on GitHub at this commit