Skip to content

Commit 64a4ca7

Browse files
committed
Rename app_kernel references to app
Updated Dockerfiles, app.py, and tests to reference 'app' instead of 'app_kernel'. This change standardizes the application entry point and module imports, improving consistency across the backend codebase.
1 parent f2994a4 commit 64a4ca7

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ ENV PATH="/app/.venv/bin:$PATH"
3131
# Install dependencies
3232

3333
EXPOSE 8000
34-
CMD ["uv", "run", "uvicorn", "app_kernel:app", "--host", "0.0.0.0", "--port", "8000"]
34+
CMD ["uv", "run", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

src/backend/Dockerfile.NoCache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ ENV PATH="/app/.venv/bin:$PATH"
3131
# Install dependencies
3232

3333
EXPOSE 8000
34-
CMD ["uv", "run", "uvicorn", "app_kernel:app", "--host", "0.0.0.0", "--port", "8000"]
34+
CMD ["uv", "run", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

src/backend/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# app_kernel.py
1+
# app.py
22
import logging
33

44
from contextlib import asynccontextmanager
@@ -132,7 +132,7 @@ async def user_browser_language_endpoint(user_language: UserLanguage, request: R
132132
import uvicorn
133133

134134
uvicorn.run(
135-
"app_kernel:app",
135+
"app:app",
136136
host="127.0.0.1",
137137
port=8000,
138138
reload=True,

src/backend/tests/test_app.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
try:
4242
from src.backend.app import app # preferred if file exists
4343
except ModuleNotFoundError:
44-
# fallback to app_kernel which exists in this repo
44+
# fallback to app which exists in this repo
4545
import importlib
46-
mod = importlib.import_module("src.backend.app_kernel")
46+
mod = importlib.import_module("src.backend.app")
4747
app = getattr(mod, "app", None)
4848
if app is None:
4949
create_app = getattr(mod, "create_app", None)
@@ -95,9 +95,9 @@ def test_process_request_endpoint_success():
9595
headers = {"Authorization": "Bearer mock-token"}
9696

9797
# Mock the RAI success function
98-
with patch("app_kernel.rai_success", return_value=True), \
99-
patch("app_kernel.initialize_runtime_and_context") as mock_init, \
100-
patch("app_kernel.track_event_if_configured") as mock_track:
98+
with patch("app.rai_success", return_value=True), \
99+
patch("app.initialize_runtime_and_context") as mock_init, \
100+
patch("app.track_event_if_configured") as mock_track:
101101

102102
# Mock memory store
103103
mock_memory_store = MagicMock()
@@ -132,8 +132,8 @@ def test_process_request_endpoint_rai_failure():
132132
headers = {"Authorization": "Bearer mock-token"}
133133

134134
# Mock the RAI failure
135-
with patch("app_kernel.rai_success", return_value=False), \
136-
patch("app_kernel.track_event_if_configured") as mock_track:
135+
with patch("app.rai_success", return_value=False), \
136+
patch("app.track_event_if_configured") as mock_track:
137137

138138
test_input = {
139139
"session_id": "test-session-123",
@@ -154,8 +154,8 @@ def test_process_request_endpoint_harmful_content():
154154
headers = {"Authorization": "Bearer mock-token"}
155155

156156
# Mock the RAI failure for harmful content
157-
with patch("app_kernel.rai_success", return_value=False), \
158-
patch("app_kernel.track_event_if_configured") as mock_track:
157+
with patch("app.rai_success", return_value=False), \
158+
patch("app.track_event_if_configured") as mock_track:
159159

160160
test_input = {
161161
"session_id": "test-session-456",
@@ -180,8 +180,8 @@ def test_process_request_endpoint_real_rai_check():
180180
headers = {"Authorization": "Bearer mock-token"}
181181

182182
# Don't mock RAI - let it run the real check
183-
with patch("app_kernel.initialize_runtime_and_context") as mock_init, \
184-
patch("app_kernel.track_event_if_configured") as mock_track:
183+
with patch("app.initialize_runtime_and_context") as mock_init, \
184+
patch("app.track_event_if_configured") as mock_track:
185185

186186
# Mock memory store
187187
mock_memory_store = MagicMock()

0 commit comments

Comments
 (0)