← Back to Pull requests

[18.0][IMP] fs_attachment: Move attachment when turning on storage path optimization #689

Closed
unknown closed this pull request without merging on Dec 01, 2026 10:03 UTC
View on GitHub
unknown unknown commented on Oct 27, 2026 14:15 UTC
Author

Context

Files stored before optimizes_directory_path was 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_fname is stored (not computed)
We use it to compute fs_storage_id (stored) and fs_storage_code is just a stored related="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_id and fs_storage_code are both stored, respectively compute and related fields.
If we change the code field of fs.storage, it will update fs_storage_code, but not store_fname
-> _is_file_from_a_storage won't be able to find the corresponding fs.storage

=> We should prevent update on this field.

Diff: 170 lines (+127 / -43) across 2 files Reviewer: divad1196 Review duration: 50148m
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
0.35
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.2% (MEDIUM) · Higher = larger blast radius
35.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 13.9% · Safe to merge
13.9%
Repository