[18.0][FIX] fs_storage: scope the warnings filter set by @deprecated #701
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 253 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #701"
general
weight: 0.35
lmignon
Problem
The
@deprecateddecorator infs_storage/models/fs_storage.pycallswarnings.simplefilter("always", DeprecationWarning)and thenwarnings.simplefilter("default", DeprecationWarning)outside ofwarnings.catch_warnings(). Each call to a deprecatedfs.storagemethod (add,get,list_files,find_files,move_files,delete) therefore inserts a globalDeprecationWarningrule at the front of the process-wide filter list.That rule takes precedence over the filters Odoo installs in
odoo/netsvc.py, for example theignorerule fordatetime.datetime.utcnow() is deprecated. Once thetest_deprecated_*tests offs_storagehave run (they areat_install, so they run early), unrelated tests later in the same build start logging warnings such as:The test helpers
_test_deprecated_setting_and_getting_dataand_test_deprecated_find_filesalso callwarnings.filterwarnings("ignore")globally, which silences every warning for the rest of the process.Fix
simplefilter("always", ...)+warn()of the decorator inwarnings.catch_warnings(), so the filter only applies to that call. TheDeprecationWarningis still emitted.warnings.filterwarnings("ignore")from the test helpers. They are already decorated withmute_logger("py.warnings").test_deprecated_decorator_restores_warning_filters, which checks thatwarnings.filtersis unchanged after calling a deprecated method and that theDeprecationWarningis still raised.Tests
-i fs_storage --test-tags /fs_storagewith demo data:1 failed ... of 20 tests(the new regression test).0 failed, 0 error(s) of 20 tests, noWARNING/ERRORlines in the log.The same decorator exists on 17.0 and 19.0; this can be forward-ported once merged.