MCPcopy
hub / github.com/Agenta-AI/agenta / initialize_environments

Function initialize_environments

api/oss/src/services/db_manager.py:2330–2347  ·  view source on GitHub ↗

Initializes the environments for the app with the given database. Args: app_db (AppDB): The database for the app. Returns: List[AppEnvironmentDB]: A list of the initialized environments.

(
    session: AsyncSession, app_db: AppDB
)

Source from the content-addressed store, hash-verified

2328
2329
2330async def initialize_environments(
2331 session: AsyncSession, app_db: AppDB
2332) -> List[AppEnvironmentDB]:
2333 """
2334 Initializes the environments for the app with the given database.
2335
2336 Args:
2337 app_db (AppDB): The database for the app.
2338
2339 Returns:
2340 List[AppEnvironmentDB]: A list of the initialized environments.
2341 """
2342
2343 environments = []
2344 for env_name in ["development", "staging", "production"]:
2345 env = await create_environment(session=session, name=env_name, app_db=app_db)
2346 environments.append(env)
2347 return environments
2348
2349
2350async def create_environment(

Callers 1

create_app_and_envsFunction · 0.85

Calls 1

create_environmentFunction · 0.85

Tested by

no test coverage detected