Fix cross-resource s3_copy and AWS config resolution - #462
Open
PeterSu92 wants to merge 1 commit into
Open
Conversation
The s3_copy tool could not do a recursive cross-resource copy, and every AWS-backed tool could silently use the wrong workspace's credentials. This PR: - Copies recursive cross-resource transfers one object at a time. The previous code passed a temp FILE as the destination of `aws s3 cp --recursive`, which requires a directory, so recursive cross-profile copies always failed. Per-object staging also bounds disk use to the largest single object instead of the whole prefix, which can exceed the staging filesystem. - Resolves the workspace lazily in ensureAWSConfig via getCurrentWorkspaceUUID(). It previously read cachedWorkspaceUUID, which is only filled at startup, so a workspace set after the server booted left it empty. - Removes the fallback that returned an arbitrary .conf from ~/.workbench/aws. Those belong to other workspaces, and their profiles resolve to the wrong resources, surfacing as a confusing "config profile could not be found". - Passes --wb-path when generating the AWS config, so credential_process points at the wb binary in use rather than a path that may not exist. - Adds WB_MCP_STAGE_DIR to relocate copy staging off the default temp filesystem, which is a small overlay on some images. Co-Authored-By: Claude Opus 5 <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.
Discovered during BENCH-9837 work.
The s3_copy tool could not do a recursive cross-resource copy, and every AWS-backed tool could silently use the wrong workspace's credentials.
This PR:
aws s3 cp --recursive, which requires a directory, so recursive cross-profile copies always failed. Per-object staging also bounds disk use to the largest single object instead of the whole prefix, which can exceed the staging filesystem.