Commit Graph

1207 Commits

Author SHA1 Message Date
semantic-release d1f34ee7e4 0.60.3
Automatically generated by python-semantic-release
2026-02-28 11:24:33 +00:00
Christian Krakau-Louis a33c71ff0a Merge pull request #432 from christianlouis/copilot/fix-ocr-data-extraction-issue
fix(tasks): resolve files stuck in Pending status despite completed processing
2026-02-28 12:24:16 +01:00
copilot-swe-agent[bot] 4fdb1b8d85 fix: address code review feedback - restrict terminal step check to success only, add test assertions
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 16:39:32 +00:00
copilot-swe-agent[bot] 2c55f076be fix(tasks): resolve files stuck in Pending status despite completed processing
The status calculation required ALL steps to be explicitly marked as
success/skipped before a file could be "completed". This failed for
dynamic pipelines where:

1. check_for_duplicates was logged before the file record existed (no
   file_id), so its FileProcessingStep was never updated from "pending"
2. extract_text was not marked as "skipped" for non-PDF files that go
   through PDF conversion first

Fix:
- Move check_for_duplicates success log to after initialize_file_steps()
  with the correct file_id so the step actually gets updated
- Mark extract_text as "skipped" for non-PDF files
- Add terminal-step fallback: if send_to_all_destinations is "success",
  the file is "completed" even if intermediate steps remain "pending"
  (handles any other dynamic pipeline edge cases)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 16:38:10 +00:00
github-actions[bot] b8f4151167 chore(release): update build metadata files [skip ci] 2026-02-27 16:26:36 +00:00
semantic-release 1a427018ef 0.60.2
Automatically generated by python-semantic-release
2026-02-27 16:26:33 +00:00
Christian Krakau-Louis fee80662bd Merge pull request #431 from christianlouis/copilot/fix-multi-file-upload-issue
fix(upload): multi-file drag-and-drop only uploads first file
2026-02-27 17:26:15 +01:00
copilot-swe-agent[bot] dc9aec2bab fix(upload): fix multi-file drag-and-drop only uploading one file
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 16:19:06 +00:00
copilot-swe-agent[bot] f641264dd2 Initial plan 2026-02-27 16:18:14 +00:00
copilot-swe-agent[bot] 76f36876e4 Initial plan 2026-02-27 16:16:02 +00:00
github-actions[bot] 5258b54b55 chore(release): update build metadata files [skip ci] 2026-02-27 09:23:03 +00:00
semantic-release e47f169a53 0.60.1
Automatically generated by python-semantic-release
2026-02-27 09:23:00 +00:00
Christian Krakau-Louis c0d19a5398 Merge pull request #429 from christianlouis/copilot/fix-complete-status-error
fix(tests): align "completed" test fixtures with terminal-step guard semantics
2026-02-27 10:22:39 +01:00
copilot-swe-agent[bot] aba47af30a test: add send_to_all_destinations step to test_status_filter_completed
The terminal-step guard requires send_to_all_destinations: success before
a file is considered "completed". Update test_status_filter_completed to
include this step so it matches the new semantics.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 01:08:26 +00:00
copilot-swe-agent[bot] 9795ca0d52 test: update 3 tests broken by terminal-step completed guard
The previous fix (requiring send_to_all_destinations to be present
before marking a file as completed) broke 3 tests that used only
partial step sets and expected "completed":

- test_coverage_polish.py::TestFileQueriesDeduplicationEnabled::
  test_deduplication_enabled_adds_check_for_duplicates
- test_file_listing.py::TestFileListingPagination::
  test_processing_status_included
- test_file_listing.py::TestFileDetailEndpoint::
  test_file_detail_status_determination

Add send_to_all_destinations: success to each test's dataset so
"completed" status is reached correctly under the new semantics.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 01:04:42 +00:00
github-actions[bot] c1e7783187 chore(release): update build metadata files [skip ci] 2026-02-27 00:56:50 +00:00
semantic-release 34e77aca17 0.60.0
Automatically generated by python-semantic-release
2026-02-27 00:56:47 +00:00
Christian Krakau-Louis 458ca38b1e Merge pull request #430 from christianlouis/copilot/add-queue-visualization-page
feat(queue): add queue monitoring dashboard and pending banner on files page
2026-02-27 01:56:28 +01:00
copilot-swe-agent[bot] baa412b172 fix(status): simplify terminal step guard condition in get_step_summary
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 00:52:48 +00:00
copilot-swe-agent[bot] e6dd39c27d fix(status): prevent false Completed status when mandatory pipeline steps have not run
Add a terminal-step guard (send_to_all_destinations) to all status
calculation paths so that files are only marked Completed once the
entire processing pipeline has been recorded.

- get_file_overall_status: require TERMINAL_STEP to be present
- get_files_processing_status: same guard for bulk status
- get_step_summary: count missing terminal step as queued so
  total_main_steps > main_completed when pipeline is incomplete
- apply_status_filter: SQL sub-query requires terminal step for
  completed filter
- process_document: call initialize_file_steps after creating a new
  file record so all mandatory steps are pre-created as pending

Define TERMINAL_STEP constant in step_manager.py and reference it in
file_status.py and file_queries.py to avoid magic strings.

Tests updated: add send_to_all_destinations to completed-file
fixtures; add test verifying initialize_file_steps is called for
new files.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 00:51:14 +00:00
copilot-swe-agent[bot] 4dd018f210 refactor(queue): address code review feedback — extract constants and sync refresh interval
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-27 00:47:58 +00:00
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
copilot-swe-agent[bot] 515f5b97e9 Initial plan 2026-02-27 00:31:29 +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