Skip to content

refactor(console): inject file service - #41603

Open
hjlarry wants to merge 4 commits into
refactor/web-app-filefrom
refactor/console-files
Open

refactor(console): inject file service#41603
hjlarry wants to merge 4 commits into
refactor/web-app-filefrom
refactor/console-files

Conversation

@hjlarry

@hjlarry hjlarry commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolve Console file upload and preview through the injected ApplicationServices.files instance instead of constructing FileService from db.engine.
  • Register file response models in serialization mode and use dump_response as the response serialization boundary.
  • Preserve the shared Trial upload helper, resource-tenant override, and existing multipart behavior.

@hjlarry hjlarry changed the title refactor/console files refactor(console): inject file service Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 61.96% 61.97% +0.01%
Strict coverage 61.56% 61.58% +0.01%
Typed symbols 43,251 43,266 +15
Untyped symbols 26,725 26,719 -6
Modules 3303 3303 0

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.92%. Comparing base (af3bd48) to head (727e1c0).

Additional details and impacted files
@@                    Coverage Diff                    @@
##           refactor/web-app-file   #41603      +/-   ##
=========================================================
- Coverage                  86.97%   86.92%   -0.05%     
=========================================================
  Files                       5473     5310     -163     
  Lines                     310536   306058    -4478     
  Branches                   62504    61299    -1205     
=========================================================
- Hits                      270075   266053    -4022     
+ Misses                     35174    34719     -455     
+ Partials                    5287     5286       -1     
Flag Coverage Δ
api 86.80% <100.00%> (-0.01%) ⬇️
cli ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-09-02 08:57:36.407760402 +0000
+++ /tmp/pyrefly_pr.txt	2026-09-02 08:57:27.163726497 +0000
@@ -434,6 +434,8 @@
   --> providers/vdb/vdb-vikingdb/tests/unit_tests/test_vikingdb_vector.py:76:5
 ERROR Object of class `ModuleType` has no attribute `VikingDBService` [missing-attribute]
   --> providers/vdb/vdb-vikingdb/tests/unit_tests/test_vikingdb_vector.py:77:5
+ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `services.file_service.FileService.get_file_preview` [bad-argument-type]
+   --> controllers/console/files.py:149:93
 ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
   --> tests/helpers/legacy_model_type_migration.py:64:16
 ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
@@ -3583,7 +3585,7 @@
 ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
    --> tests/unit_tests/controllers/files/test_upload.py:414:26
 ERROR Object of class `FunctionType` has no attribute `__apidoc__` [missing-attribute]
-   --> tests/unit_tests/controllers/inner_api/app/test_dsl.py:261:18
+   --> tests/unit_tests/controllers/inner_api/app/test_dsl.py:259:18
 ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
    --> tests/unit_tests/controllers/inner_api/plugin/test_plugin_wraps.py:257:40
 ERROR Missing argument `user_model` in function `protected_view` [missing-argument]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant