Commit Graph

1185 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] c7c5718f78 feat(queue): add queue monitoring dashboard and pending banner on files page
- Add /api/queue/stats endpoint with Redis queue lengths, Celery worker
  inspection, and DB processing summaries
- Add /api/queue/pending-count lightweight endpoint for the files page banner
- Add /admin/queue admin-only view with auto-refreshing queue dashboard
- Add queue pending banner on /files page showing queued/processing count
- Add Queue Monitor link to admin dropdown in navigation (desktop + mobile)
- Add comprehensive tests for all new endpoints and views

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 00:42:55 +00:00
copilot-swe-agent[bot] 6f3e1f505b Initial plan 2026-02-27 00:33:21 +00:00
github-actions[bot] dd11076694 chore(release): update build metadata files [skip ci] 2026-02-27 00:16:06 +00:00
semantic-release 14bd15aa6d 0.59.1
Automatically generated by python-semantic-release
2026-02-27 00:16:02 +00:00
Christian Krakau-Louis 0055de3c66 Merge pull request #427 from christianlouis/copilot/fix-processed-file-view-error
fix(api): use stored DB paths for file preview and download
2026-02-27 01:15:44 +01:00
copilot-swe-agent[bot] cded73481e fix(api): use stored file paths for preview and download endpoints
Both get_file_preview and download_file were ignoring the DB-stored
original_file_path and processed_file_path fields, instead relying on
local_filename (a temp path that may be gone) and guessing patterns for
the processed file. This caused "Processed file not found" and
potentially "Original file not found" in the /files/{id} view even when
the files existed at their stored paths.

- version=original: check original_file_path first, fall back to local_filename
- version=processed: check processed_file_path first, fall back to
  hash/filename guessing patterns

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 00:01:32 +00:00
github-actions[bot] 4ec270481d chore(release): update build metadata files [skip ci] 2026-02-26 23:56:40 +00:00
semantic-release fb916afbe0 0.59.0
Automatically generated by python-semantic-release
2026-02-26 23:56:36 +00:00
Christian Krakau-Louis 585b30a93e Merge pull request #426 from christianlouis/copilot/support-directory-upload
feat(upload): directory drag-and-drop, adaptive 429 throttling, full Gotenberg file type support
2026-02-27 00:56:17 +01:00
copilot-swe-agent[bot] 88701bfa0a Initial plan 2026-02-26 23:55:15 +00:00
copilot-swe-agent[bot] 4a251fd3ca fix(test): update drop overlay text assertion to match new directory-upload message
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 23:50:46 +00:00
github-actions[bot] 8dedd40ef3 chore(release): update build metadata files [skip ci] 2026-02-26 23:38:16 +00:00
semantic-release 73624e6e2d 0.58.0
Automatically generated by python-semantic-release
2026-02-26 23:38:12 +00:00
Christian Krakau-Louis 5e14b76a6a Merge pull request #424 from christianlouis/copilot/add-generic-file-view
feat(views): add document-centric view at /files/{id}
2026-02-27 00:37:54 +01:00
copilot-swe-agent[bot] a05690bd5f feat(upload): adaptive 429 backoff, full Gotenberg file types, directory traversal
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 23:24:26 +00:00
copilot-swe-agent[bot] 35d2ed05e9 feat(upload): add directory traversal, queue throttling, and upload config settings
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 23:11:44 +00:00
copilot-swe-agent[bot] c540dd4f52 feat(views): add document-centric view at /files/{id}
- Revert search.html and files.html links back to /files/{id}
- Add GET /files/{file_id} route (file_view_page) with workdir path-
  containment guards (os.path.commonpath) to prevent traversal
- Create file_view.html: document-centric page showing AI metadata,
  inline PDF preview, extracted OCR text, download actions, file info,
  status pill, and link to /files/{id}/detail for process pipeline view
- Existing /files/{id}/detail route is unchanged

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 23:02:25 +00:00
copilot-swe-agent[bot] 5626f46880 Initial plan 2026-02-26 22:56:32 +00:00
copilot-swe-agent[bot] da865b5f7a fix(search): correct file detail page URL in search results
Both the /search page and the inline search in /files were
generating links to /files/{id} which returns 404. The correct
route is /files/{id}/detail.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 22:46:41 +00:00
copilot-swe-agent[bot] 24c5a0263e Initial plan 2026-02-26 22:45:20 +00:00
github-actions[bot] 91fa38abab chore(release): update build metadata files [skip ci] 2026-02-26 14:59:48 +00:00
semantic-release 3bf00d6eae 0.57.4
Automatically generated by python-semantic-release
2026-02-26 14:59:45 +00:00
Christian Krakau-Louis babf2dc9bc Merge pull request #423 from christianlouis/copilot/fix-one-drive-tests
fix(tests): remove Docker registry dependency from OAuth integration tests
2026-02-26 15:59:25 +01:00
copilot-swe-agent[bot] 36b668020b fix(tests): fix OAuth integration tests failing due to Docker registry timeout
The mock_oauth_server session fixture tried to pull ghcr.io/navikt/mock-oauth2-server:2.1.1
from Docker, which times out in sandboxed CI, causing all 14 OAuth integration tests to ERROR.

Changes to tests/conftest_oauth.py:
- mock_oauth_server: catch container startup exceptions, attempt cleanup, yield None
  instead of propagating (static fallback config is used instead)
- oauth_config: add elif mock_oauth_server is None branch returning a static hardcoded
  config (mode="static") using module-level URL constants
- oauth_enabled_app: use authorize_url/access_token_url directly (no HTTP metadata
  discovery), clear/restore authlib _clients/_registry cache per test, add cleanup in teardown
- Extract _STATIC_OAUTH_* constants to avoid URL duplication

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 14:21:58 +00:00
copilot-swe-agent[bot] 44dcabd1f3 fix(tests): fix TestGetFullConfigException using PropertyMock on module-level settings
The test was using patch.object(type(settings), "onedrive_client_id", property(...))
to make settings.onedrive_client_id raise. Pydantic v2 Settings fields are not plain
Python descriptors so this approach raises AttributeError.

Fix: patch app.api.onedrive.settings with a MagicMock whose onedrive_client_id
is a PropertyMock(side_effect=Exception), which correctly triggers the except
branch in get_onedrive_full_config and returns {"status": "error"}.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 12:04:38 +00:00
copilot-swe-agent[bot] b4e93c00b4 fix(tests): fix test_save_settings_outer_exception in OneDrive coverage tests
The test was patching os.path.join, which is called inside an inner
try/except block in save_onedrive_settings. This meant the exception
was silently caught and logged, never reaching the outer exception
handler that returns HTTP 500.

Fix by patching notify_settings_updated instead, which is called in
the outer try block, so exceptions correctly propagate to the outer
handler.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 11:02:16 +00:00
copilot-swe-agent[bot] 28e3d1e2d5 Initial plan 2026-02-26 10:54:03 +00:00
github-actions[bot] 4b4abecee4 chore(release): update build metadata files [skip ci] 2026-02-26 10:46:22 +00:00
semantic-release 49089eb655 0.57.3
Automatically generated by python-semantic-release
2026-02-26 10:46:19 +00:00
Christian Krakau-Louis a64de0a6cb Merge pull request #420 from christianlouis/copilot/improve-code-coverage-tests
fix(tests): correct mock patch targets in google_drive coverage tests
2026-02-26 11:46:03 +01:00
semantic-release 06f125d7e6 0.57.2
Automatically generated by python-semantic-release
2026-02-26 10:46:01 +00:00
Christian Krakau-Louis 6ecf07abf9 Merge pull request #422 from christianlouis/copilot/fix-search-field-bug
fix(ui): fix search input clearing on keystroke; add dedicated /search page
2026-02-26 11:45:44 +01:00
copilot-swe-agent[bot] 483a5b71a1 fix(ui): sanitize Meilisearch HTML output, use event delegation, improve error messages
Address code review feedback:
- Sanitize highlighted HTML from Meilisearch to prevent XSS (only allow
  <mark> tags, escape everything else)
- Replace inline onclick handlers with event delegation for pagination
- Improve error message to be more user-friendly with technical detail
  in smaller text

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:34:31 +00:00
copilot-swe-agent[bot] e9dd3ef1c2 docs(search): update UserGuide with search page documentation and fix import order
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:32:08 +00:00
copilot-swe-agent[bot] 09a6337c6f fix(ui): prevent search input from clearing on each keystroke and add dedicated /search page
The debounceSearch() function in files.html called clearFullTextSearch()
when the query was shorter than 2 characters. Since clearFullTextSearch()
sets input.value = '', every single keystroke was immediately erased —
users could paste text but not type.

Fix: debounceSearch now only hides the results panel for short queries
without touching the input value.

Also adds a dedicated /search page with Google-style results showing
content previews (document title, filename, type badges, tag badges,
sender, and OCR text snippets with highlighted matches).

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:18:28 +00:00
copilot-swe-agent[bot] c6ac6b50e9 fix(tests): use targeted settings mock instead of broad getattr patch
Replace module-level getattr patch with a MagicMock that has a property
raising on google_drive_use_oauth access, as suggested by code review.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:16:49 +00:00
github-actions[bot] ec6cf5ba5c chore(release): update build metadata files [skip ci] 2026-02-26 09:15:24 +00:00
semantic-release 9bc45671f8 0.57.1
Automatically generated by python-semantic-release
2026-02-26 09:15:20 +00:00
Christian Krakau-Louis 1b128dae58 Merge pull request #421 from christianlouis/copilot/fix-361235-929857522-1b5ece5a-6be3-43d3-b78e-9986cdaefd85
fix: regenerate logo PNGs from SVG to fix DocuNova → DocuElevate branding
2026-02-26 10:14:58 +01:00
copilot-swe-agent[bot] 096aedb8a0 fix(tests): correct mock patch targets in google_drive coverage tests
- Change @patch("app.api.google_drive.get_google_drive_service") to
  @patch("app.tasks.upload_to_google_drive.get_google_drive_service")
  because the function is imported locally inside the endpoint function
  body, not at module level
- Replace patch.object(type(settings), "google_drive_use_oauth", ...)
  with patch("app.api.google_drive.getattr", ...) because Pydantic v2
  models don't expose fields as regular class attributes

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:14:08 +00:00
copilot-swe-agent[bot] 04da7ae804 Initial plan 2026-02-26 09:10:43 +00:00
copilot-swe-agent[bot] d83dfb12c6 fix: regenerate logo PNGs from SVG to fix DocuNova → DocuElevate branding
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-26 09:05:38 +00:00
copilot-swe-agent[bot] bfa3df1905 Initial plan 2026-02-26 09:02:45 +00:00
copilot-swe-agent[bot] ffa0e1eb7b test(coverage): add celery_worker coverage and remove dead config_validator.py
- Rewrite tests/test_celery_worker.py to mock check_credentials.apply_async
  at import time, enabling all 35 statements to be covered without Redis
- Add tests for conditional beat schedule entries (IMAP, Uptime Kuma)
- Delete app/utils/config_validator.py — dead code shadowed by the
  config_validator/ package directory (Python gives packages precedence)
- Remove both files from coverage omit in pyproject.toml
- celery_worker.py now at 100% coverage (was 0%)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 21:08:24 +00:00
copilot-swe-agent[bot] 45e09a0ded Initial plan 2026-02-25 20:44:22 +00:00
github-actions[bot] d86dda9431 docs(changelog): update changelog [skip ci] 2026-02-25 16:43:28 +00:00
Christian Krakau-Louis e58b58537d Merge pull request #415 from christianlouis/copilot/increase-test-coverage-modules
test(coverage): add coverage tests for onedrive and google_drive API modules
2026-02-25 17:43:04 +01:00
github-actions[bot] 62e4521f3c docs(changelog): update changelog [skip ci] 2026-02-25 16:42:33 +00:00
Christian Krakau-Louis 3635e97dbd Merge pull request #416 from christianlouis/copilot/improve-test-coverage-mid-range-files
test: improve coverage for process_with_ocr, api/settings, and settings_service to 90%+
2026-02-25 17:42:03 +01:00
Christian Krakau-Louis 1bb463f719 Merge pull request #417 from christianlouis/copilot/polish-coverage-to-90-percent
test(coverage): push coverage to 95%+ for 11 target files
2026-02-25 17:41:43 +01:00