Skip to content

Conversation

@jmgilman
Copy link
Contributor

Summary

  • Add CopyStats return value to CopyTo, CopyToWithOptions, CopyDir, and CopyFile methods
  • Stats include FileCount (files copied), TotalBytes (uncompressed size), and Skipped (files skipped)
  • Breaking API change (acceptable pre-1.0)

Changes

  • Add internal ProcessStats type in core/internal/batch/stats.go
  • Update batch.Process() and helpers to return (ProcessStats, error)
  • Add public CopyStats type in core/blob_opts.go
  • Update all copy methods to return (CopyStats, error)
  • Re-export CopyStats in types.go
  • Update all tests, benchmarks, examples, and documentation

Test plan

  • All existing tests pass with updated signatures
  • New tests verify stats values: TestCopyDir_ReturnsStats, TestCopyDir_SkippedStats, TestCopyTo_ReturnsStats
  • CI passes (just ci)

🤖 Generated with Claude Code

Add CopyStats return value to CopyTo, CopyToWithOptions, CopyDir, and
CopyFile methods. The stats include FileCount (files successfully
copied), TotalBytes (sum of uncompressed sizes), and Skipped (files
skipped due to existing without overwrite).

This is a breaking API change - callers must now handle the additional
return value. Acceptable for a pre-1.0 library.

Changes:
- Add internal ProcessStats type for batch processor
- Update batch.Process() to return (ProcessStats, error)
- Add public CopyStats type in core/blob_opts.go
- Update all copy methods to return (CopyStats, error)
- Re-export CopyStats in types.go
- Update all tests, benchmarks, and examples
- Update documentation with new signatures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
blob ced74fe Commit Preview URL

Branch Preview URL
Jan 23 2026, 02:34 AM

@jmgilman jmgilman merged commit c48479d into master Jan 23, 2026
10 checks passed
@jmgilman jmgilman deleted the feat/copy-stats branch January 23, 2026 02:39
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