Skip to content

Migrate S3 storage driver from aws-sdk-go v1 to aws-sdk-go-v2 - #424

Open
bauerpawel wants to merge 2 commits into
Forceu:masterfrom
bauerpawel:feat/aws-sdk-v2-migration
Open

bauerpawel wants to merge 2 commits into
Forceu:masterfrom
bauerpawel:feat/aws-sdk-v2-migration

Conversation

@bauerpawel

Copy link
Copy Markdown
Contributor

Description

Migrates the S3/S3-compatible storage driver from aws-sdk-go (v1) to aws-sdk-go-v2. aws-sdk-go v1 has been in AWS's maintenance-only mode since July 2024 (security fixes only, no new features).

  • session.NewSessionconfig.LoadDefaultConfig + s3.NewFromConfig, with custom endpoint/path-style addressing moved to s3.Options (needed for S3-compatible providers like Backblaze B2)
  • s3managerfeature/s3/manager (the newer 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.Context (v2 requires it everywhere)
  • github.com/aws/aws-sdk-go (v1) is now fully removed from go.mod

No 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

  • Refactor / Chore

Technical Details

  • Database changes: No
  • Storage backend affected: S3
  • Usage of AI: Yes — developed with Claude Code as a pair-programming assistant (SDK migration, error-handling translation, dependency updates). I reviewed and tested all changes before submitting.

How Has This Been Tested?

  • Unit Tests: go test ./... --tags=test,awsmock (full suite passes; exercises the real v2 driver against a local gofakes3 HTTP server, not a hand-rolled mock). I don't have real AWS credentials to run the awstest-tagged suite locally, but the change is purely internal to the driver's SDK calls, and CI already runs awstest against real AWS on every push.
  • Environment: Windows 11

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation. (n/a — no user-facing behavior change)
  • My changes generate no new warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d

bauerpawel and others added 2 commits September 9, 2026 14:34
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
bauerpawel force-pushed the feat/aws-sdk-v2-migration branch from 90324fc to 93e2bef Compare September 13, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant