10175ee4b5
- oauth_initiate: pre-flight check returns 400 with env-var hint when GOOGLE_CLIENT_ID/SECRET or ONEDRIVE_CLIENT_ID/SECRET are not configured, preventing opaque MSAL/OAuth library 500 errors on misconfigured servers - stream_document_content: broad except-clause catches non-CloudConnectionError exceptions and returns 502 with user-friendly message (was raw 500) - docker-compose.yml: add volumes: - ./backend:/app to celery-worker so code changes are picked up by docker compose restart without a rebuild - CloudStorageView: upload hint paragraph directs users to navigate into a cloud folder; no DropZone added (no folder context at overview level) - 3 new backend tests pass; 2 existing tests patched with credential monkeypatch; full suite: 293 passed, 0 new failures, 1 pre-existing (test_extract_docx) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.6 KiB
2.6 KiB
phase, plan, status, completed
| phase | plan | status | completed |
|---|---|---|---|
| 05-cloud-storage-backends | 12 | complete | 2026-05-30 |
Plan 05-12 Summary — UAT Gap Closure
What Was Built
Closed 3 UAT gaps from Phase 5 testing:
Task 1 — Pre-flight config validation in oauth_initiate (backend/api/cloud.py)
- Added config checks before entering OAuth library code for both providers
GET /api/cloud/oauth/initiate/google_drivewith emptyGOOGLE_CLIENT_ID/SECRET→ 400 with env-var hintGET /api/cloud/oauth/initiate/onedrivewith emptyONEDRIVE_CLIENT_ID/SECRET→ 400 with env-var hint- Existing MSAL / google-auth flows unchanged when credentials are present
- Added 2 new tests in
backend/tests/test_cloud.py; fixed 2 existing tests that needed credential monkeypatching
Task 2 — 502 fallback in stream_document_content + celery-worker volume mount
- Added broad
except Exception → 502clause after the existingexcept CloudConnectionError → 503instream_document_content - Cloud backend runtime errors now return a user-friendly "Cloud backend unreachable" message instead of an opaque 500
- Added
volumes: - ./backend:/appto celery-worker indocker-compose.yml— code changes now reflected viadocker compose restart celery-workerwithout a full rebuild - Added 1 new test
test_stream_document_content_cloud_backend_errorinbackend/tests/test_documents.py
Task 3 — Upload hint in CloudStorageView (frontend/src/views/CloudStorageView.vue)
- Added
<p>hint below the connections list: "To upload files, navigate into a cloud folder first." - Hint only visible when
connections.length > 0(not on empty state) - No DropZone added (no cloud folder context available at this level)
Key Files Modified
backend/api/cloud.py— pre-flight config checks in oauth_initiatebackend/api/documents.py— broad 502 except-clause in stream_document_contentdocker-compose.yml— volume mount for celery-workerfrontend/src/views/CloudStorageView.vue— upload hint paragraphbackend/tests/test_cloud.py— 2 new pre-flight tests; 2 existing tests patchedbackend/tests/test_documents.py— 1 new 502 path test
Test Results
pytest tests/test_cloud.py::test_oauth_initiate_google_drive_not_configured✅ PASSpytest tests/test_cloud.py::test_oauth_initiate_onedrive_not_configured✅ PASSpytest tests/test_documents.py::test_stream_document_content_cloud_backend_error✅ PASSpytest -v— 293 passed, 1 pre-existing failure (test_extract_docx / missing module), 5 skipped, 24 xfailednpm run build— ✅ clean exit
Self-Check: PASSED
All acceptance criteria met. Zero new test failures introduced.