Skip to content

[Buckets] Send mtime when copying files - #4920

Merged
Wauplin merged 1 commit into
mainfrom
fix-bucket-copy-mtime
Sep 17, 2026
Merged

Wauplin merged 1 commit into
mainfrom
fix-bucket-copy-mtime

Conversation

@Wauplin

@Wauplin Wauplin commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Bug original reported in #4752 (comment). Let's address it separately in this PR

Summary

  • Send the existing mtime on copyFile operations; regular uploads already send it.
  • Extend existing copy/upload tests to check exact timestamps on staging. The copy test fails with mtime=None without the fix; both pass with it.
2 passed in 13.76s

make style passes. make quality hits an existing type error in serialization/_torch.py:788, also reproduced on unchanged HEAD.


Note

Low Risk
Single-field addition to bucket sync JSON for copy operations, with staging integration tests only; no auth or data-model changes.

Overview
Bucket copy operations now include mtime in the batch sync payload, matching what add/upload operations already send. Without this field, copied bucket entries could end up with missing or incorrect modification times on the Hub.

Integration tests on staging assert exact timestamps: the same-bucket copy test patches time.time during copy_files, and the bucket XET upload test sets os.utime on a file uploaded from disk.

Reviewed by Cursor Bugbot for commit b43abb9. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@Wauplin
Wauplin merged commit f94ea55 into main Sep 17, 2026
21 of 25 checks passed
@Wauplin
Wauplin deleted the fix-bucket-copy-mtime branch September 17, 2026 07:54
@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.32.0 release.

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