Migrate S3 storage driver from aws-sdk-go v1 to aws-sdk-go-v2 - #424
Open
bauerpawel wants to merge 2 commits into
Open
bauerpawel wants to merge 2 commits into
bauerpawel wants to merge 2 commits into
Conversation
aws-sdk-go v1 has been in AWS's maintenance-only mode since July 2024 (security fixes only, no new features). Migrated the S3/S3-compatible storage driver to aws-sdk-go-v2: - session.NewSession -> config.LoadDefaultConfig + s3.NewFromConfig, with custom endpoint/path-style addressing moved to s3.Options (needed for S3-compatible providers like Backblaze B2) - s3manager -> feature/s3/manager (the new feature/s3/transfermanager successor is still pre-1.0 and not suitable for production use yet) - presigned URLs: GetObjectRequest().Presign() -> PresignClient - awserr.Error/.Code() -> smithy.APIError/.ErrorCode() for error translation, including in the setup wizard's AWS connection test (internal/configuration/setup/Setup.go), which also inspected v1 error types directly - all API calls now take an explicit context (v2 requires it everywhere) Verified against the existing test suite, which exercises the real implementation (not the hand-rolled mock) via a local gofakes3 HTTP server: all AWS-path tests pass except TestDownloadFromAws, which fails identically with the original v1 code on Windows (pre-existing os.Remove-on-open-handle flakiness, unrelated to this change - CI runs on Linux where this isn't an issue). github.com/aws/aws-sdk-go (v1) is now fully removed from go.mod. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019woTYJGrS4pfPWC6CCgffQ
Resolves go.mod/go.sum conflicts between master's dependency bumps and this branch's migration to aws-sdk-go-v2: keeps the new aws-sdk-go-v2/* modules, drops the superseded aws-sdk-go v1 line, and takes master's updated versions of shared dependencies. Verified go generate, go build, go vet (test/noaws/awsmock tags) and go test --tags=test,awstest all succeed after the merge; the remaining local test failures are pre-existing Windows-only environment issues (path separators, file locks) reproduced identically on unmodified upstream/master. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JWZJU5aSCEBB9DHBWvL4t4
bauerpawel
force-pushed
the
feat/aws-sdk-v2-migration
branch
from
September 13, 2026 10:27
90324fc to
93e2bef
Compare
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.
Description
Migrates the S3/S3-compatible storage driver from
aws-sdk-go(v1) toaws-sdk-go-v2.aws-sdk-gov1 has been in AWS's maintenance-only mode since July 2024 (security fixes only, no new features).session.NewSession→config.LoadDefaultConfig+s3.NewFromConfig, with custom endpoint/path-style addressing moved tos3.Options(needed for S3-compatible providers like Backblaze B2)s3manager→feature/s3/manager(the newerfeature/s3/transfermanagersuccessor is still pre-1.0 and not suitable for production use yet)GetObjectRequest().Presign()→PresignClientawserr.Error/.Code()→smithy.APIError/.ErrorCode()for error translation, including in the setup wizard's AWS connection test (internal/configuration/setup/Setup.go), which also inspected v1 error types directlycontext.Context(v2 requires it everywhere)github.com/aws/aws-sdk-go(v1) is now fully removed fromgo.modNo behavior change for users — this is an internal driver swap. The public S3 configuration (endpoint, bucket, region, credentials, path-style addressing) is unaffected.
Type of Change
Technical Details
How Has This Been Tested?
go test ./... --tags=test,awsmock(full suite passes; exercises the real v2 driver against a localgofakes3HTTP server, not a hand-rolled mock). I don't have real AWS credentials to run theawstest-tagged suite locally, but the change is purely internal to the driver's SDK calls, and CI already runsawstestagainst real AWS on every push.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d