Files
curo1305 10175ee4b5 fix(05-12): close 3 UAT gaps — OAuth 400 preflight, 502 cloud fallback, upload hint
- 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>
2026-05-30 17:55:08 +02:00

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_drive with empty GOOGLE_CLIENT_ID/SECRET → 400 with env-var hint
  • GET /api/cloud/oauth/initiate/onedrive with empty ONEDRIVE_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 → 502 clause after the existing except CloudConnectionError → 503 in stream_document_content
  • Cloud backend runtime errors now return a user-friendly "Cloud backend unreachable" message instead of an opaque 500
  • Added volumes: - ./backend:/app to celery-worker in docker-compose.yml — code changes now reflected via docker compose restart celery-worker without a full rebuild
  • Added 1 new test test_stream_document_content_cloud_backend_error in backend/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_initiate
  • backend/api/documents.py — broad 502 except-clause in stream_document_content
  • docker-compose.yml — volume mount for celery-worker
  • frontend/src/views/CloudStorageView.vue — upload hint paragraph
  • backend/tests/test_cloud.py — 2 new pre-flight tests; 2 existing tests patched
  • backend/tests/test_documents.py — 1 new 502 path test

Test Results

  • pytest tests/test_cloud.py::test_oauth_initiate_google_drive_not_configured PASS
  • pytest tests/test_cloud.py::test_oauth_initiate_onedrive_not_configured PASS
  • pytest tests/test_documents.py::test_stream_document_content_cloud_backend_error PASS
  • pytest -v — 293 passed, 1 pre-existing failure (test_extract_docx / missing module), 5 skipped, 24 xfailed
  • npm run build clean exit

Self-Check: PASSED

All acceptance criteria met. Zero new test failures introduced.