From 0edc51d17f8e799971bb9bba71bf05d414d7de11 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:24:22 +0000 Subject: [PATCH] fix: expose helper functions at module level for test patching - Move get_all_settings_from_db import to module level in app/views/settings.py - Move get_provider_status and get_settings_for_display imports to module level in app/views/status.py - Fix CI workflow: replace deprecated 'file' parameter with 'files' in codecov-action - Fix CI workflow: update test results upload to use codecov-action@v5 with report_type instead of deprecated test-results-action@v1 Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- .github/workflows/ci.yml | 7 +++++-- app/views/settings.py | 8 +++++--- app/views/status.py | 5 +---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e6f180b..f8ec6396 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,14 +99,17 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml + files: ./coverage.xml fail_ci_if_error: false - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + files: ./junit.xml + report_type: test_results + fail_ci_if_error: false - name: Upload test artifacts if: ${{ !cancelled() }} diff --git a/app/views/settings.py b/app/views/settings.py index 74fa73c9..309a0124 100644 --- a/app/views/settings.py +++ b/app/views/settings.py @@ -12,7 +12,11 @@ from fastapi.responses import RedirectResponse from sqlalchemy.orm import Session from app.utils.config_validator.masking import mask_sensitive_value -from app.utils.settings_service import get_setting_metadata, get_settings_by_category +from app.utils.settings_service import ( + get_all_settings_from_db, + get_setting_metadata, + get_settings_by_category, +) from app.views.base import APIRouter, get_db, require_login, settings, templates logger = logging.getLogger(__name__) @@ -57,8 +61,6 @@ async def settings_page(request: Request, db: Session = Depends(get_db)): try: # Get settings from database - from app.utils.settings_service import get_all_settings_from_db - db_settings = get_all_settings_from_db(db) # Get settings organized by category diff --git a/app/views/status.py b/app/views/status.py index 6c5fbe52..9eed0b38 100644 --- a/app/views/status.py +++ b/app/views/status.py @@ -8,6 +8,7 @@ from datetime import datetime from fastapi import Request +from app.utils.config_validator import get_provider_status, get_settings_for_display from app.views.base import APIRouter, require_login, settings, templates logger = logging.getLogger(__name__) @@ -20,8 +21,6 @@ async def status_dashboard(request: Request): """ Status dashboard showing all configured integration targets """ - from app.utils.config_validator import get_provider_status - # Get provider status providers = get_provider_status() @@ -100,8 +99,6 @@ async def env_debug(request: Request): debug_enabled = settings.debug # Get settings data - from app.utils.config_validator import get_settings_for_display - settings_data = get_settings_for_display(show_values=debug_enabled) return templates.TemplateResponse(