feat: port batch of modules from Bridge#10
Conversation
Codecov Report❌ Patch coverage is
|
8212430 to
c715b9d
Compare
c715b9d to
849331e
Compare
|
Claude encountered an error —— View job PR Review Complete ✅Todos
SummaryThis PR successfully ports four modules ( ✅ Strengths
📋 SuggestionsCoverage Improvement Needed (log.py)Location: The missing coverage is likely in error handling paths:
Recommendation: Add tests for these edge cases to meet the 85% coverage requirement: @pytest.mark.unit
def test_validate_file_name_rejects_non_writable_file(tmp_path):
"""File validation fails when file exists but is not writable."""
# Test readonly file rejection
@pytest.mark.unit
def test_intercept_handler_handles_unknown_log_level():
"""InterceptHandler falls back to DEBUG for unknown log levels."""
# Test ValueError handling
@pytest.mark.unit
def test_intercept_handler_patches_process_thread_info():
"""InterceptHandler preserves process/thread/task metadata."""
# Test patcher function branchesCode Clarity Improvements1. Document RuntimeError Suppression # Suppress RuntimeError from Loguru re-entrancy in async contexts.
# This can occur when:
# 1. An async task logs while holding the Loguru lock
# 2. The logging triggers another log (e.g., from psycopg during connection)
# 3. Loguru attempts to acquire the already-held lock
# Silently dropping is safe - the message will be logged when the lock releases.
with contextlib.suppress(RuntimeError):2. Type Hint for Patcher Function 3. SUBPROCESS_CREATION_FLAGS Usage SUBPROCESS_CREATION_FLAGS = getattr(subprocess, "CREATE_NO_WINDOW", 0)
"""Creation flags for subprocess calls (suppresses console window on Windows).
Usage:
subprocess.run(cmd, creationflags=SUBPROCESS_CREATION_FLAGS)
"""🔍 Review Detailsmodels.py ✅
process.py ✅
api/exceptions.py ✅
log.py
|
849331e to
f8acdc2
Compare
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
f8acdc2 to
5cbae2d
Compare
|



models,process,api,logmodules from Bridge.