Repository navigation
fix: support .wmf file extension case-insensitively and remove duplicate avi - #15498
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughUpdated visual-extension checks in Python and Go to use lowercase ChangesFile Type Classification
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This PR makes a localized file-extension matching fix and removes a duplicate pattern entry; no actionable merge-blocking risk remains beyond normal checks and review. 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
🤖 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 `@api/utils/file_utils.py`:
- Line 76: The visual extension check in internal/utility/file.go is
case-sensitive because the filename is normalized with strings.ToLower(base) but
the visualExtensions slice contains "WMF" (uppercase); update the
visualExtensions slice so all entries are lowercase (change "WMF" to "wmf" and
ensure other entries are lowercase) so that the HasSuffix checks
(strings.HasSuffix(normalized, "."+ext)) correctly match `.wmf`; adjust the
visualExtensions declaration accordingly.
🪄 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: c010abd3-63c1-4f12-bcb6-40915205eb6f
📒 Files selected for processing (1)
api/utils/file_utils.py
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Would you please fix the format issue? |
Thanks for pointing this out. I’ve formatted |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15498 +/- ##
===========================================
- Coverage 91.34% 39.09% -52.25%
===========================================
Files 10 54 +44
Lines 716 14914 +14198
Branches 117 117
===========================================
+ Hits 654 5831 +5177
- Misses 36 9057 +9021
Partials 26 26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@JinHai-CN The failed Infinity jobs look unrelated to this PR. ragflow_tests_infinity (go) failed with a runner port conflict: address already in use. Could you please rerun the failed jobs? I don't have permission to rerun them. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Added regression coverage for
Also ran the related tests locally:
|
|
@JinHai-CN Thanks for your help. I fixed the The CI checks are passing now. Could you please take another look when you have time? |
Summary
Fix
.wmffile type detection by matching lowercased filename normalization in both Python and Go extension checks.This PR also removes a duplicate
avientry from the Python visual file type regex.Testing
filename_type("test.wmf")returnsFileType.VISUAL.ruff format --check api/utils/file_utils.py.