feat(scripts): migrate assets and content URLs to new blob store#48
Merged
Conversation
- Promise.allSettled in upload loop preserves partial successes on mid-batch failure
- verifyUrls retries (default 2x with 500ms backoff) for CDN propagation races
- HEAD requests use redirect: 'follow' explicitly
- sanitizeMessage redacts vercel_blob_rw_* tokens from error output
- parseArgs rejects unknown flags (typo detection)
- run() integration tests via vi.mock('@vercel/blob')
- mirror upload-assets: --target legacy|new (default legacy) - when --target new, also rewrite legacy-host URLs → new-host URLs - extract pure helpers (parseArgs, resolveBaseUrl, updateMarkdownContent, run) - add unit tests for parsing, host resolution, all rewrite patterns - new pnpm scripts: update-urls:new, sync-assets:migrate
103 URL replacements across 66 markdown files (42 blog/fr + 11 team + 13 tools). All URLs HEAD-verified on the new store before commit.
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36.
Summary
Full migration to the new Ocobo team blob store (
website-blob, hostipjmp3k0z0p479cb.public.blob.vercel-storage.com).Three layers:
scripts/upload-assets.jslearns--target legacy|new(strict token resolution, HEAD verification with retries, hardening).scripts/update-asset-urls.jslearns--target legacy|new, also rewrites legacy-host URLs to the new host when--target new, and now scansteam/+tools/in addition toblog/,stories/,legal/.assets/+ 13 tool icons fetched from the legacy store and seeded intoassets/tools/), 103 URL references rewritten across 66 markdown files.Verification
pnpm test→ 90 passing.grep -rln "jr0deqtyc8c5pvr8"returns 0 results — zero legacy-host references remain.Commits (atomic, in order)
refactor(scripts): extract testable helpers from upload-assets, drop dead branch modefeat(scripts): add --target flag to upload-assets for new blob storefeat(scripts): verify uploaded URLs via HEAD requestsfix(scripts): harden upload-assets per code reviewchore(scripts): load .env via node --env-file-if-exists in asset scriptsfeat(scripts): add --target flag to update-asset-urls for new blob storefeat(scripts): scan team/ and tools/ for asset URL rewriteschore(assets): seed tool icons from legacy blob store(13 icons)chore(content): migrate asset URLs to new blob store(66 markdown files, 103 rewrites)fix(scripts): tighten relative-path lookbehind in updateMarkdownContentrefactor(scripts): share sanitizeMessage helper across asset scriptsrefactor(scripts): align parseArgs signature to accept already-sliced argvNew pnpm scripts
pnpm upload-assets:migrate—--all --target newpnpm update-urls:new—--target newpnpm sync-assets:migrate—upload-assets:migrate && update-urls:newAll four asset scripts now load
.envvianode --env-file-if-exists=.envso tokens don't need to be exported manually.Test plan
pnpm testlocally (90 passing)https://ipjmp3k0z0p479cb.public.blob.vercel-storage.com/content/posts/target-setting/process_target_setting.pngandhttps://ipjmp3k0z0p479cb.public.blob.vercel-storage.com/content/tools/aircall.svgFollow-ups (not in this PR)
hyperline.md,outreach.md,vitally.md) have noiconUrlat all — pre-existing gap, not part of this migration.getChangedAssets/findAssetFileshardening notes from earlier review still apply (monorepo support, symlink handling).