From 952b08bb638f60e52362ae2c45b4617c9a485d4d Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 21 Aug 2026 16:07:26 +0800 Subject: [PATCH] chore: update docstring --- API.md | 2 +- DEVELOP.md | 2 +- backend/tests/test_jupyter_auth_cache.py | 2 +- backend/tests/test_storage_upload_status.py | 2 +- common/src/common/scheduler/trigger.py | 2 +- schedule/src/schedule/application/service.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/API.md b/API.md index acad6a4..c6ec642 100644 --- a/API.md +++ b/API.md @@ -895,7 +895,7 @@ Base 前缀 `/api/v1/admin`。 整体替换指定平台角色的 `permission_codes`(diff-based 写入,见下文)。调用者必须是系统管理员。 -> **本端点只控制前端菜单可见性**——不修改 `system_admin_context` 的鉴权判定(`role_code == "admin"` 始终等价于"拥有所有平台菜单权限")。若需调整 API 鉴权,请改 `backend.platform.system_admin_context`,不要绕过本端点。 +> **本端点只控制前端菜单可见性**——不修改 `system_admin_context` 的鉴权判定(`role_code == "admin"` 始终等价于"拥有所有平台菜单权限")。若需调整 API 鉴权,请改 `backend.api.platform.system_admin_context`,不要绕过本端点。 - **请求体字段**: diff --git a/DEVELOP.md b/DEVELOP.md index 2781ab5..ce0e26d 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -168,7 +168,7 @@ grep -rnE 'os\.(environ\[?["\x27][A-Z_]+|getenv\(["\x27][A-Z_]+)' --include="*.p ### Service-to-service auth (P0-1 fix) - Schedule → Backend single endpoint ``POST /internal/v1/objects`` is - guarded by ``require_internal_service`` in ``backend.storage_api``. + guarded by ``require_internal_service`` in ``backend.api.storage``. - The token header is ``X-Internal-Service-Token`` (case-insensitive on the wire because FastAPI ``Header`` lowercase-matches the name ``x-internal-service-token``); the secret value comes from diff --git a/backend/tests/test_jupyter_auth_cache.py b/backend/tests/test_jupyter_auth_cache.py index 31905f2..e7e2caf 100644 --- a/backend/tests/test_jupyter_auth_cache.py +++ b/backend/tests/test_jupyter_auth_cache.py @@ -1,4 +1,4 @@ -"""Unit tests for the 5s auth-result cache in ``backend.jupyter``. +"""Unit tests for the 5s auth-result cache in ``backend.api.jupyter``. Jupyter 一次会话会触发几十次 Nginx ``auth_request``;本缓存按 ``(workspace_id, user_id)`` 缓存 membership + runtime 的查找结果,避免 diff --git a/backend/tests/test_storage_upload_status.py b/backend/tests/test_storage_upload_status.py index a5a46f1..08d234e 100644 --- a/backend/tests/test_storage_upload_status.py +++ b/backend/tests/test_storage_upload_status.py @@ -1,7 +1,7 @@ """Unit tests for ``upload_bytes_to_session`` failure-path status persistence. P0-5 / B1: the route handler wraps every request in ``session_scope`` -(``backend.dependencies.database_session``), which rolls back on +(``backend.api.dependencies.database_session``), which rolls back on exception. A naive ``upload.upload_status = "failed"; raise HTTPException(...)`` loses the status flip and leaves the row stuck in ``created``/``uploading`` forever. The fix is ``_mark_upload_failed_and_raise`` which opens a diff --git a/common/src/common/scheduler/trigger.py b/common/src/common/scheduler/trigger.py index ce14826..1b3c094 100644 --- a/common/src/common/scheduler/trigger.py +++ b/common/src/common/scheduler/trigger.py @@ -1,6 +1,6 @@ """Shared schedule-trigger logic. -Both the user-facing manual run endpoint (``backend.schedule_runs``) +Both the user-facing manual run endpoint (``backend.api.schedules.runs``) and the schedule service's cron tick handler call into this module to materialize a ``ScheduleRuns`` row plus the corresponding ``schedule.run.requested`` outbox event. The outbox is the single diff --git a/schedule/src/schedule/application/service.py b/schedule/src/schedule/application/service.py index 42768f9..61bcc00 100644 --- a/schedule/src/schedule/application/service.py +++ b/schedule/src/schedule/application/service.py @@ -191,7 +191,7 @@ def build_object_store(bucket_name: str | None = None) -> Any: Respects ``settings.storage_backend``: in ``local`` mode points at the local ``${local_storage_base_dir}/version`` directory (the same place - ``backend.storage_api`` writes to), in ``s3`` mode points at the + ``backend.api.storage`` writes to), in ``s3`` mode points at the bucket named by ``bucket_name`` (default ``settings.s3_version_bucket``). The bucket override exists because some workspaces configure a custom