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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| ensure_database | runtime.py | same file |
| job_ref | runtime.py | same file |
| run_options | runtime.py | same file |
| secret | runtime.py | same file |
| session_scope | runtime.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| git_source | git_source.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| router | router.py | through an import |
| native_server | native_server.py | through 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
