fix: log session scope errors at appropriate error - #10546
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdded import of HTTPException from fastapi and enhanced exception handling in session_scope to log HTTP 4xx errors at info level and 5xx or other errors at error level, while maintaining existing rollback and re-raise behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ 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 |
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (39.35%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #10546 +/- ##
==========================================
- Coverage 38.90% 31.41% -7.50%
==========================================
Files 1477 1325 -152
Lines 85270 60001 -25269
Branches 10240 8983 -1257
==========================================
- Hits 33175 18848 -14327
+ Misses 51048 40246 -10802
+ Partials 1047 907 -140
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/backend/base/langflow/services/deps.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
{src/backend/**/*.py,tests/**/*.py,Makefile}
📄 CodeRabbit inference engine (.cursor/rules/backend_development.mdc)
{src/backend/**/*.py,tests/**/*.py,Makefile}: Run make format_backend to format Python code before linting or committing changes
Run make lint to perform linting checks on backend Python code
Files:
src/backend/base/langflow/services/deps.py
🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/services/deps.py
[error] 187-187: Ruff: PLR2004 Magic value used in comparison. Consider replacing '400' with a named constant. Command: uv run --only-dev ruff check --output-format=github .
🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/services/deps.py
[failure] 187-187: Ruff (PLR2004)
src/backend/base/langflow/services/deps.py:187:43: PLR2004 Magic value used in comparison, consider replacing 500 with a constant variable
[failure] 187-187: Ruff (PLR2004)
src/backend/base/langflow/services/deps.py:187:20: PLR2004 Magic value used in comparison, consider replacing 400 with a constant variable
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: Test Docker Images / Test docker images
- GitHub Check: Lint Backend / Run Mypy (3.13)
- GitHub Check: Run Frontend Tests / Determine Test Suites and Shard Distribution
- GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
- GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
- GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
- GitHub Check: Test Starter Templates
- GitHub Check: Update Starter Projects
- GitHub Check: Update Component Index
- GitHub Check: Run Ruff Check and Format
- GitHub Check: Optimize new Python code in this PR
🔇 Additional comments (1)
src/backend/base/langflow/services/deps.py (1)
6-6: LGTM: Import added for enhanced exception handling.The HTTPException import is correctly added to support the differentiated logging logic in the session_scope context manager.
* Log db session scope errors at appropriate error * [autofix.ci] apply automated fixes * uses http status codes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Fixes log level of session scope errors. e.g. don't log 404s as errors.
Summary by CodeRabbit