Back to the room

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

Code Observatory / module

runtime

codeintel.runtime

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

Contains (5)
SymbolFileResolved by
ensure_databaseruntime.pysame file
job_refruntime.pysame file
run_optionsruntime.pysame file
secretruntime.pysame file
session_scoperuntime.pysame file
Imports (1)
SymbolFileResolved by
git_sourcegit_source.pythrough an import
Imported by (2)
SymbolFileResolved by
routerrouter.pythrough an import
native_servernative_server.pythrough an import
codeintel.runtimebackend/app/codeintel/runtime.py, lines 1–40Open source
"""Process-level wiring shared by the API, the worker and the CLI."""from __future__ import annotationsfrom collections.abc import Iteratorfrom contextlib import contextmanagerfrom sqlalchemy.orm import Sessionfrom ..config.settings import get_settingsfrom ..shared import databasefrom .git_source import RepoRef, parse_repo_specdef ensure_database() -> None:    if database.SessionLocal is None:        settings = get_settings()        database.init_database(settings.get_database_url(), settings.ENV)@contextmanagerdef session_scope() -> Iterator[Session]:    ensure_database()    session = database.SessionLocal()    try:        yield session    finally:        session.close()def secret(value) -> str | None:    return value.get_secret_value() if value is not None else Nonedef job_ref(repo_url: str) -> RepoRef:    """Rebuild a RepoRef for a stored job.    Local (``file://``) jobs can only have been created by the CLI — the API    validates with ``allow_local=False`` — so allowing them here does not let    API callers reach the worker's filesystem.

Shows the first 40 of 53 lines. The rest is on GitHub at this commit.

What the index recorded

Signature
module backend.app.codeintel.runtime
File
backend/app/codeintel/runtime.py
Lines
1–53
Parser
python-ast
Git blob
fed1898d663066d415ffd4749246534627ef28d6
Outside this subset
9 more edges reach code outside the graph shown here

Read it on GitHub at this commit