Skip to content

Conversation

@mikolalysenko
Copy link
Contributor

@mikolalysenko mikolalysenko commented Dec 17, 2025

This change significantly reduces disk space usage by:

  • Optionally downloading missing afterHash blobs during download/apply/repair
  • Downloading beforeHash blobs on-demand during rollback operations
  • Removing beforeHash blobs during cleanup since they're fetched on-demand

Changes:

  • Add getAfterHashBlobs() and getBeforeHashBlobs() to manifest/operations.ts
  • Update getMissingBlobs() to only check for afterHash blobs
  • Update savePatch() to skip saving beforeBlobContent
  • Update cleanupUnusedBlobs() to use getAfterHashBlobs()
  • Rename gc command to repair (with gc alias for backwards compatibility)
  • Add --offline flag to apply, rollback, and repair commands
  • Add blob-fetcher utility for on-demand blob downloading
  • Add fetchBlob() method to API client for downloading blobs by SHA256 hash
  • Add comprehensive tests for new functionality

…ollback

This change significantly reduces disk space usage by:
- Only downloading afterHash blobs during download/apply/repair
- Downloading beforeHash blobs on-demand during rollback operations
- Removing beforeHash blobs during cleanup since they're fetched on-demand

Changes:
- Add getAfterHashBlobs() and getBeforeHashBlobs() to manifest/operations.ts
- Update getMissingBlobs() to only check for afterHash blobs
- Update savePatch() to skip saving beforeBlobContent
- Update cleanupUnusedBlobs() to use getAfterHashBlobs()
- Rename gc command to repair (with gc alias for backwards compatibility)
- Add --offline flag to apply, rollback, and repair commands
- Add blob-fetcher utility for on-demand blob downloading
- Add fetchBlob() method to API client for downloading blobs by SHA256 hash
- Add comprehensive tests for new functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mikolalysenko mikolalysenko changed the title Only download afterHash blobs, download beforeHash on-demand during r… On demand blob downloads for patches Dec 17, 2025
mikolalysenko and others added 2 commits December 16, 2025 20:36
- Add orgSlug option to APIClient for authenticated blob downloads
- Use authenticated /v0/orgs/{org}/patches/blob/{hash} endpoint when token
  and orgSlug are available, fall back to public proxy otherwise
- Add SOCKET_ORG_SLUG environment variable support

This enables blob downloads during rollback to work in CI environments where
the public proxy is not accessible.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The rollback command now correctly uses fetchBlobsByHash to download
the specific beforeHash blobs it needs, rather than fetchMissingBlobs
which only downloads afterHash blobs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mikolalysenko mikolalysenko merged commit b50556c into main Dec 17, 2025
4 checks passed
@mikolalysenko mikolalysenko deleted the mik-afterhash-only-blobs branch December 17, 2025 14:24
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