Repository navigation
fix(sandbox): publish images to the prefix clients read - #240
Merged
Merged
Conversation
The bucket moved the sandbox images from codev-code/sandbox to codev/sandbox and #230 repointed SANDBOX_IMAGES_BASE_URL, but publish-image.ts kept its own hardcoded copy of the old prefix. Every upload therefore landed under a path that reads 403, while the manifest.json clients actually fetch was never touched: the publish printed "published sandbox image <version>" and changed nothing. Derive the destinations from the manifest's own asset URLs and SANDBOX_MANIFEST_URL instead, via sandboxStorageObjectKey — the object key is the URL path minus the bucket segment, which CODEV_STORAGE_TARGET already carries. Publishing now goes exactly where the manifest says the artifacts live, so the two sides cannot drift again; the version guard above already pins those URLs to the version being published. Verified with a synthetic out dir: the printed mc commands target codev/sandbox/<version>/<artifact> and codev/sandbox/manifest.json, artifacts before the manifest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Problem
The bucket moved the sandbox images from
codev-code/sandboxtocodev/sandbox. #230 repointedSANDBOX_IMAGES_BASE_URLso downloads worked again, butscript/publish-image.tscarried its own hardcoded copy of the prefix and was missed:So a publish uploaded everything under a prefix that reads 403 and left the
manifest.jsonclients actually fetch untouched — it printedpublished sandbox image <version>and changed nothing. Silent, and only visible by noticing that no client ever picked the new image up.Fix
Derive the destinations from the manifest's own asset URLs and
SANDBOX_MANIFEST_URL.sandboxStorageObjectKey(new, insrc/const.ts) turns a client URL into an mc object key by dropping the first path segment — the bucket, whichCODEV_STORAGE_TARGETalready carries asalias/bucket.That makes the publish destination and the client read path the same expression, so they cannot drift again. It is also strictly more correct than rebuilding the path from
--version: the upload now goes exactly where the manifest advertises the artifacts, and the existing guard above already rejects a manifest whoseimageVersionis not the version being published.No behavior change beyond the path. Artifacts still upload before
manifest.json.Verification
bun testinpackages/codev-sandbox: 122 pass, 2 skip (the bwrap integration pair, which self-skips off Linux)bun typecheck: cleansrc/const.test.tspins the invariant as a suffix check againstSANDBOX_MANIFEST_URLrather than the literal prefix, so a deliberate future bucket move stays a one-line change inconst.ts.Notes
DIVERGENCES.mdrow:packages/codev-sandboxis fork-only, and no upstream file is touched.CHANGELOG.mdentry: this is a release-tooling fix with no user-facing behavior change.publish-image.ts:41) only acceptsx.y.z, so publishing an image versioned after the desktop app (e.g.1.18.4-8) still needs--force.🤖 Generated with Claude Code