Repository navigation
fix(sandbox): migrate to S3 special remote, add --verbose - #378
Merged
neuromechanist merged 2 commits intoApr 28, 2026
Merged
Conversation
The sandbox command used a fragile presigned-URL upload + git-annex registerurl flow. Errors from git annex add and registerurl were silently swallowed, leaving WSL/HPC users stuck with no actionable diagnostic. The same flow was migrated everywhere else in #182; sandbox was the last holdout. Replace with the validated path: requestUploadCredentials + configureS3Remote + gitAnnexAdd + copyToAnnexRemote + clearAnnexCredentials. Also add a --verbose / -v flag that prints every git/git-annex subprocess invocation, stdout, stderr, and exit code so the next stuck user has something to report. Removes now-unused helpers: uploadFileWithPresignedUrl, uploadFilesWithPresignedUrls, registerUrlWithGitAnnex, registerUrlsWithGitAnnex, configureWebRemote, PresignedUploadProgress. Closes #377
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR378Version: 🤖 Updated on each push. |
- Drop the dataFileCount gate that decided whether to run the S3 setup based on the backend's upload_urls response. The new flow does not need upload_urls, so gating on it is a future-fragile coupling. Always run the S3 setup; copyToAnnexRemote is a no-op when there are no annexed files. Removes the now-unused uploadUrls local. - Trim sandbox.ts comments that restated WHAT instead of explaining WHY. Keep the clearAnnexCredentials WHY comment, drop the rest. - Trim verbose.ts docstrings. - Add test/verbose.test.ts: state round-trip + vlog gating. Findings #2 and #3 (orphan repo+S3 cleanup, copy-line regex) tracked separately as #379.
Contributor
Author
/review-pr summaryRan code-reviewer, silent-failure-hunter, comment-analyzer, and pr-test-analyzer in parallel. Addressed in 13b8d35
Tracked separately
Confirmations from the reviewers
|
5 of 7 tasks
This branch was previously deployed
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 #377
Why
WSL user reported
nemar sandboxaborting at Step 5/6 with:…and no actionable detail. The error path swallows stderr from
git annex addandgit annex registerurl, so the user can't diagnose. This is the same fragile presigned-URL +registerurlflow that #182 migrated everywhere else; sandbox was the last consumer.What
dataset upload/dataset update):requestUploadCredentials(STS, scoped toxx*/objects/)configureS3Remotewithprotocol=https,publicurl,autoenable=truegitAnnexAdd(respectsannex.largefiles)copyToAnnexRemote(git annex copy --to nemar-s3 -J4)clearAnnexCredentials(so subsequentgit annex getfalls back to publicurl)--verbose/-vflag onnemar sandbox— prints every git/git-annex subprocess (cmd, cwd, stdout, stderr, exit code). Module-levelsetVerbose()insrc/lib/verbose.tssorunCommandingit-annex.tscan pick it up.uploadFileWithPresignedUrluploadFilesWithPresignedUrlsregisterUrlWithGitAnnexregisterUrlsWithGitAnnexconfigureWebRemotePresignedUploadProgressNet diff: 3 files changed, 118 insertions(+), 364 deletions(-).
Verified
bun run build— cleanbunx tsc --noEmit— cleanbun test— all sandbox/git-annex tests pass; pre-existing unrelated failure indatalad-commands.test.ts:191(live API check fornm999999) reproduces ondevwithout these changesbunx biome check src/commands/sandbox.ts src/lib/git-annex.ts src/lib/verbose.ts— clean (one pre-existingnoNonNullAssertionwarning at line 120, untouched)generateUploadPolicyinbackend/src/services/sts.ts:96emits unconditionals3:ListBucketfor bothxx*andnm*, so HeadBucket duringinitremoteworkspushToGitHubalready pushes thegit-annexbranch (src/lib/git-annex.ts:1329-1332), so clones see the S3 remote configTest plan
nemar sandbox reset && nemar sandbox— completes Step 5/6 successfullynemar sandbox reset && nemar sandbox --verbose— prints git/git-annex subprocess output during Step 5/6git clone <xx-repo>+cd <repo> && git annex init && git annex get .from a clean dir downloads via publicurl without credentials--verbosesurfaces the underlying git-annex stderr instead of just "Failed to copy to remote"