Skip to content

refactor(openapi): inject file upload service - #41606

Merged
41tair merged 1 commit into
refactor/console-filesfrom
refactor/openapi-files
Sep 3, 2026
Merged

refactor(openapi): inject file upload service#41606
41tair merged 1 commit into
refactor/console-filesfrom
refactor/openapi-files

Conversation

@hjlarry

@hjlarry hjlarry commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

part of #39993

Stack: #41587
Depends on #41603.

  • inject the shared FileService through application_services() instead of constructing it from Flask database globals in the OpenAPI controller
  • preserve caller-derived tenant resolution and the existing @returns / FileResponse serialization contract
  • order typed file-service exceptions before the generic ValueError fallback so their intended HTTP errors are reachable
  • update generated OpenAPI Markdown and add focused controller coverage

Behavior changes

  • oversized files now return 413 file_too_large instead of a generic 400 bad_request
  • unsupported file types now return 415 unsupported_file_type instead of a generic 400 bad_request
  • blocked extensions still return 400, now with file_extension_blocked instead of bad_request

@hjlarry hjlarry changed the title refactor/openapi files refactor(openapi): inject file upload 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 62.10% 62.13% +0.02%
Strict coverage 61.71% 61.73% +0.02%
Typed symbols 43,469 43,494 +25
Untyped symbols 26,696 26,685 -11
Modules 3308 3309 +1

linw1995
linw1995 previously approved these changes Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.96%. Comparing base (4207d8b) to head (c62f3e8).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           refactor/console-files   #41606   +/-   ##
=======================================================
  Coverage                   86.96%   86.96%           
=======================================================
  Files                        5322     5322           
  Lines                      306772   306771    -1     
  Branches                    61453    61453           
=======================================================
+ Hits                       266775   266786   +11     
+ Misses                      34704    34691   -13     
- Partials                     5293     5294    +1     
Flag Coverage Δ
api 86.82% <100.00%> (+<0.01%) ⬆️

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.

@41tair
41tair added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit d8c3f7c Sep 3, 2026
48 checks passed
@41tair
41tair deleted the refactor/openapi-files branch September 3, 2026 05:10
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.

3 participants