[18.0][IMP] fs_attachment: Move attachment when turning on storage path optimization #689
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 170 lines diff across 2 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.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #689"
general
weight: 0.35
divad1196
Context
Files stored before
optimizes_directory_pathwas enabled stay at the root of the storage.This PR adds a cron that will move the files to the subfolders safely.
Design/Caveats
Cron activation/deactivation
The cron is manually activated by an admin
and gets automatically deactivated when everything is in order.
I think this is better than enabling the cron automatically with
optimizes_directory_path.One way only
The development only moves the files when we enable the optimization.
It does not move them back to the root folder when we turn the optimization down.
Remarks
store_fname.partition vs fs_storage_code
store_fnameis stored (not computed)We use it to compute
fs_storage_id(stored) andfs_storage_codeis just a storedrelated="fs_storage_id.code"But we still often get the information directly from
store_fname.partition-> We have 2 ways of getting the information,
Changing fs.storage.code breaks the attachments
fs_storage_idandfs_storage_codeare both stored, respectivelycomputeandrelatedfields.If we change the
codefield offs.storage, it will updatefs_storage_code, but notstore_fname->
_is_file_from_a_storagewon't be able to find the correspondingfs.storage=> We should prevent update on this field.