KPMP-5807: add error msgs and rename files in place - #176
Conversation
WalkthroughThe change updates DLU file handling and curation queries. Source files are renamed before copying, with rename errors logged. Filename curation queries now select records where approval is NULL. ChangesDLU processing updates
Priority: ⬇️ Low Change: Bug fix Merge Risk: 🟡 Moderate · up to File-processing failures or name collisions can leave packages inconsistent or copy the wrong file. These risks should be corrected before merge. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: ead89e84-07c6-47b0-962e-3e592171d4d8
📒 Files selected for processing (2)
data_management/services/dlu_filesystem.pydata_management/services/dlu_management.py
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
| rename_str = os.path.join(source_package_directory, file.name) + " to " + os.path.join(source_package_directory, slide_name_map[file.name]) | ||
| try: | ||
| logger.info("Renaming file " + rename_str) | ||
| os.rename(os.path.join(source_package_directory, file.name), os.path.join(source_package_directory, slide_name_map[file.name])) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Restore renamed source files when a later operation fails.
This method changes source names before all copies complete. If a later copy or rename fails, earlier source files remain renamed. A retry then fails do_wsi_file_renames validation because it expects the original source_file_name values.
Track completed renames and reverse them in the failure path, or use temporary names and commit the source rename only after the full operation succeeds.
Summary by CodeRabbit