Skip to content

streamline shuttle move/copy operations#274

Merged
elfkuzco merged 1 commit into
mainfrom
simplify-move-files
May 12, 2026
Merged

streamline shuttle move/copy operations#274
elfkuzco merged 1 commit into
mainfrom
simplify-move-files

Conversation

@elfkuzco
Copy link
Copy Markdown
Contributor

@elfkuzco elfkuzco commented May 7, 2026

Rationale

This PR simplifies the file movement operation of the shuttle. It does this in the following way:

  • keep one current location as the source of truth since all the book data (file) is the same across all current locations
  • create the target locations using this first current location while simultaneously deleting any current location that isn't the original we are holding a reference to. Caveat is that book events are now showing as copies and not really as moves from one current location to another
  • delete the original location and any other current locations that are left (especially if current location is greater than target locations)

This fixes #233

@elfkuzco elfkuzco self-assigned this May 7, 2026
@elfkuzco elfkuzco requested a review from benoit74 May 7, 2026 10:10
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.28%. Comparing base (53ad7cf) to head (c03fcce).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #274      +/-   ##
==========================================
- Coverage   81.39%   81.28%   -0.11%     
==========================================
  Files          55       55              
  Lines        2354     2362       +8     
  Branches      233      236       +3     
==========================================
+ Hits         1916     1920       +4     
- Misses        378      381       +3     
- Partials       60       61       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

  • I realize it looks like we do not correctly handle the situation where a target location is same as a current one. Typical when we add a title to a second collection, we move from one current to the same target + another target. Or is this handled differently in terms of current/target locations?
  • Deleted old location => Deleted book from

@elfkuzco
Copy link
Copy Markdown
Contributor Author

I realize it looks like we do not correctly handle the situation where a target location is same as a current one. Typical when we add a title to a second collection, we move from one current to the same target + another target. Or is this handled differently in terms of current/target locations?

Nope, you are correct.

@elfkuzco elfkuzco requested a review from benoit74 May 11, 2026 12:03
Comment thread backend/src/cms_backend/shuttle/move_files.py Outdated
@elfkuzco elfkuzco requested a review from benoit74 May 11, 2026 15:15
Copy link
Copy Markdown
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

LGTM

@elfkuzco elfkuzco force-pushed the simplify-move-files branch from c03fcce to 6390c52 Compare May 12, 2026 05:11
@elfkuzco elfkuzco merged commit 6408a8e into main May 12, 2026
2 of 3 checks passed
@elfkuzco elfkuzco deleted the simplify-move-files branch May 12, 2026 06:08
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.

Since we cannot really move file, rationalize codebase

2 participants