gabriel / musehub public
feat BREAKING cdn-reads dev
AI Agent gabriel · 119 days ago · May 15, 2026 · Diff

feat(cdn-reads): Phase 5 — CDN-first bundle reads via Cloudflare

Bundle GET presigned URLs are now rewritten through the CDN base URL when BLOB_STORAGE_CDN_BASE_URL is set, so repeat clones hit the Cloudflare edge cache instead of R2/MinIO directly.

- Add blob_storage_cdn_base_url setting to config - presign_bundle_get rewrites host to CDN base URL (scheme+netloc swap, path preserved); regular object presign_get is unaffected - put_bundle writes Cache-Control: public, max-age=31536000, immutable so Cloudflare caches content-addressed bundles indefinitely at edge - CDN-1..5 TDD tests all green (23/23 across phases 1-5)

sha256:40deaf8bd39fb488ad88b0d234b553c5c3a26affe8fe864b21a8b61527f0a7f1 sha
+19 ~5 symbols
sha256:ec8bf4821171629307079f572d8f2aed7ca378ae75a0090aa134c07e6b27f0f8 snapshot
+19
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 24 symbols
~ tests/test_cdn_reads_phase5.py .py 19 symbols added
+ CDN_BASE variable variable CDN_BASE L34–34
+ _make_bundle function function _make_bundle L41–50
+ _make_commit_chain function function _make_commit_chain L94–116
+ _push_and_index function async_function _push_and_index L53–91
+ AsyncSession import import AsyncSession L27–27
+ annotations import import annotations L19–19
+ blob_id import import blob_id L29–29
+ compute_identity_id import import compute_identity_id L30–30
+ create_repo import import create_repo L31–31
+ datetime import import datetime L21–21
+ hashlib import import hashlib L22–22
+ msgpack import import msgpack L25–25
+ pytest import import pytest L26–26
+ mock import import unittest.mock L23–23
+ test_cdn1_presign_bundle_get_uses_cdn_url function async_function test_cdn1_presign_bundle_get_uses_cdn_url L124–148
+ test_cdn2_put_bundle_sets_cache_control_immutable function async_function test_cdn2_put_bundle_sets_cache_control_immutable L156–185
+ test_cdn3_regular_object_presign_not_cdn_rewritten function async_function test_cdn3_regular_object_presign_not_cdn_rewritten L193–211
+ test_cdn4_no_cdn_setting_no_regression function async_function test_cdn4_no_cdn_setting_no_regression L219–236
+ test_cdn5_wire_fetch_bundle_pack_urls_use_cdn function async_function test_cdn5_wire_fetch_bundle_pack_urls_use_cdn L244–279
~ musehub/config.py .py 1 symbol modified
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:40deaf8bd39fb488ad88b0d234b553c5c3a26affe8fe864b21a8b61527f0a7f1 --body "your comment"