Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesBlob storage threshold configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/unit_test/data_source/test_config.py (1)
34-47: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a test for invalid env var values.
The two tests cover the happy paths (default and valid integer override). A test for a non-integer env var value (e.g.,
"20MB") would verify the error-handling behavior once graceful fallback is added toconfig.py. This is the most likely misconfiguration scenario for self-hosted users.🧪 Suggested test for invalid input
+def test_blob_storage_size_threshold_invalid_value_falls_back(monkeypatch): + monkeypatch.setenv("BLOB_STORAGE_SIZE_THRESHOLD", "20MB") + + config = _load_config() + + assert config.BLOB_STORAGE_SIZE_THRESHOLD == 20 * 1024 * 1024🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/unit_test/data_source/test_config.py` around lines 34 - 47, Add a test alongside test_blob_storage_size_threshold_uses_default and test_blob_storage_size_threshold_uses_environment_variable that sets BLOB_STORAGE_SIZE_THRESHOLD to a non-integer value such as "20MB", loads the configuration via _load_config(), and asserts the expected graceful fallback behavior, typically the default 20 * 1024 * 1024.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@common/data_source/config.py`:
- Line 117: Handle invalid BLOB_STORAGE_SIZE_THRESHOLD environment values
without an opaque import-time ValueError: define a default, parse the
environment value in a try/except, and fall back to the default when conversion
fails (including empty strings), or raise a clear actionable configuration
error. Update the BLOB_STORAGE_SIZE_THRESHOLD initialization accordingly.
---
Nitpick comments:
In `@test/unit_test/data_source/test_config.py`:
- Around line 34-47: Add a test alongside
test_blob_storage_size_threshold_uses_default and
test_blob_storage_size_threshold_uses_environment_variable that sets
BLOB_STORAGE_SIZE_THRESHOLD to a non-integer value such as "20MB", loads the
configuration via _load_config(), and asserts the expected graceful fallback
behavior, typically the default 20 * 1024 * 1024.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c7c27f61-d7b7-4598-b49b-d72ff6f0cfd6
📒 Files selected for processing (2)
common/data_source/config.pytest/unit_test/data_source/test_config.py
|
Updated the configuration to raise a clear, actionable error when BLOB_STORAGE_SIZE_THRESHOLD is not an integer. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16806 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
BLOB_STORAGE_SIZE_THRESHOLDconfigurable through an environment variable.Why
Blob storage, Seafile, and WebDAV connectors currently use a hardcoded 20 MiB limit. Self-hosted users
cannot raise this limit without modifying the source code inside the container.
Testing
test/unit_test/data_source/test_config.py: 2 passedruff check common/data_source/config.py test/unit_test/data_source/test_config.pyFixes #16634