Commit Graph

1163 Commits

Author SHA1 Message Date
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
semantic-release 0ac0bcf40c 0.57.0
Automatically generated by python-semantic-release
2026-02-25 16:41:41 +00:00
Christian Krakau-Louis 0e43fbfabd Merge pull request #419 from christianlouis/copilot/ensure-gdpr-compliance
feat(privacy): GDPR and global privacy compliance for all supported markets
2026-02-25 17:41:23 +01:00
github-actions[bot] 69cb16c522 style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-25 15:43:40 +00:00
copilot-swe-agent[bot] e3cd687757 test(coverage): add coverage tests for app/api/onedrive.py and app/api/google_drive.py
Add targeted tests covering uncovered lines:
- OneDrive: token refresh failure, token rotation with .env update,
  DB persist failure, user info failure, exception handlers
- Google Drive: service account test-token paths, update settings
  exception handler, get-token-info outer exception

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 15:41:01 +00:00
copilot-swe-agent[bot] 759647f957 test(coverage): add tests to push coverage above 95% for 11 target files
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 15:36:46 +00:00
copilot-swe-agent[bot] d9abbc1c99 test: improve coverage for process_with_ocr, api/settings, and settings_service to 90%+
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 15:24:42 +00:00
copilot-swe-agent[bot] 0821e2f989 feat(privacy): implement GDPR and global privacy compliance
- Add dismissable cookie notice banner to base template (essential
  cookies only, ePrivacy Directive compliant, localStorage persistence)
- Expand Privacy Notice to cover all target markets: EU/GDPR,
  UK GDPR, Switzerland nFADP, Ukraine, US CCPA/CPRA, Canada PIPEDA/
  Law 25, Brazil LGPD/Latin America, and Asia-Pacific & Japan (APPI,
  Australia Privacy Act, South Korea PIPA, Singapore PDPA, India DPDP)
- Add International Data Transfers section (SCCs, IDTAs, adequacy
  decisions) and Data Minimization & Purpose Limitation section
- Update Cookie Policy with precise cookie table, ePrivacy exemption
  rationale, and localStorage notice dismissal documentation
- Create docs/PrivacyCompliance.md: full multi-market compliance guide
  covering cookie strategy, data transfer mechanisms, data subject
  rights handling matrix with response timelines, and market-specific
  notes for all supported regions
- Add docs/PrivacyCompliance.md to mkdocs.yml Compliance nav section
- Add 10 new targeted tests to test_views_general.py validating all
  key compliance content areas

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 15:15:24 +00:00
copilot-swe-agent[bot] 5eb6b794c4 Initial plan 2026-02-25 15:07:03 +00:00
copilot-swe-agent[bot] 05c99af57d Initial plan 2026-02-25 14:49:46 +00:00
copilot-swe-agent[bot] 9df80eea92 Initial plan 2026-02-25 14:49:34 +00:00
copilot-swe-agent[bot] 4449671c88 Initial plan 2026-02-25 14:49:25 +00:00
github-actions[bot] 72f36e4672 chore(release): update build metadata files [skip ci] 2026-02-25 14:47:42 +00:00
semantic-release 838607d4ec 0.56.2
Automatically generated by python-semantic-release
2026-02-25 14:47:39 +00:00
Christian Krakau-Louis b01ae44b9d Merge pull request #412 from christianlouis/copilot/fix-file-search-sql-error
fix(database): add runtime migrations for ocr_text, ai_metadata, document_title columns
2026-02-25 15:47:18 +01:00
github-actions[bot] 3dced5eba4 docs(changelog): update changelog [skip ci] 2026-02-25 14:39:06 +00:00
Christian Krakau-Louis 4f7353fb3b Merge pull request #414 from christianlouis/copilot/documentation-health-check-audit
docs: fill navigation gaps found in documentation health check
2026-02-25 15:38:43 +01:00
copilot-swe-agent[bot] db581ba355 fix(database): add runtime migrations for ocr_text, ai_metadata, document_title columns
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 14:37:56 +00:00
copilot-swe-agent[bot] 6e78e9e7cf docs: add missing docs to mkdocs nav and README index
- Add BrowserExtension to Getting Started section in mkdocs.yml nav
- Add SettingsManagement to Configuration section in mkdocs.yml nav
- Add new Security section with CredentialRotationGuide in mkdocs.yml nav
- Mirror all nav additions in docs/README.md index

Closes the documentation gaps identified in the health check audit:
all user-relevant guides (browser extension, settings management,
credential rotation) are now discoverable via ReadTheDocs/mkdocs.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-25 14:37:50 +00:00
copilot-swe-agent[bot] b5075a9090 Initial plan 2026-02-25 14:35:21 +00:00
copilot-swe-agent[bot] 8c034e6e32 Initial plan 2026-02-25 14:34:46 +00:00
github-actions[bot] da7b6b0d34 chore(release): update build metadata files [skip ci] 2026-02-25 14:19:12 +00:00
semantic-release 08e3e35994 0.56.1
Automatically generated by python-semantic-release
2026-02-25 14:19:09 +00:00