Skip to content

KPMP-5807: add error msgs and rename files in place - #176

Merged
zwright merged 2 commits into
developfrom
KPMP-5807_rename_in_place
Sep 14, 2026
Merged

zwright merged 2 commits into
developfrom
KPMP-5807_rename_in_place

Conversation

@HaneenT

@HaneenT HaneenT commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • File transfers now use the intended mapped filenames, improving consistency between source and destination packages.
    • File-processing errors are handled more gracefully so individual rename issues do not prevent subsequent copy operations.
    • Filename review results now correctly identify files that have not yet received approval, improving curation workflow accuracy.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Walkthrough

The 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.

Changes

DLU processing updates

Layer / File(s) Summary
Rename source files before copying
data_management/services/dlu_filesystem.py
rename_and_move_files renames each source file to its mapped name before copying. It logs PermissionError and other exceptions without re-raising them.
Query unapproved filenames
data_management/services/dlu_management.py
find_not_approved_filenames now filters records where approve_file_name IS NULL instead of approve_file_name = 'yes'.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: 🟡 Moderate · up to e8f14

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)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KPMP-5807_rename_in_place

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ead89e84-07c6-47b0-962e-3e592171d4d8

📥 Commits

Reviewing files that changed from the base of the PR and between 98a865e and e8f14a6.

📒 Files selected for processing (2)
  • data_management/services/dlu_filesystem.py
  • data_management/services/dlu_management.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread data_management/services/dlu_filesystem.py
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]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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.

Comment thread data_management/services/dlu_filesystem.py
@zwright
zwright merged commit 6006ada into develop Sep 14, 2026
1 check failed
@zwright
zwright deleted the KPMP-5807_rename_in_place branch September 14, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants