Skip to content

feat: upgrade Go dependencies and optimize S3 uploads - #13

Merged
LeeEirc merged 1 commit into
masterfrom
pr@master@perf_deps
Sep 10, 2026
Merged

LeeEirc merged 1 commit into
masterfrom
pr@master@perf_deps

Conversation

@LeeEirc

@LeeEirc LeeEirc commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings September 10, 2026 10:28
@LeeEirc
LeeEirc merged commit 51181b1 into master Sep 10, 2026
1 check passed
@LeeEirc
LeeEirc deleted the pr@master@perf_deps branch September 10, 2026 10:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new S3 multipart implementation has a compile-time error (sync.WaitGroup has no Go method) and an incorrect size-limit validation that can allow oversized uploads to proceed until S3 rejects them.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR upgrades several Go dependencies (AWS SDK, Elasticsearch client, gopsutil, testify) and refactors S3 uploads to use AWS SDK v2 with an optimized multipart upload path to avoid buffering large files in memory.

Changes:

  • Migrates S3 uploads from aws-sdk-go v1 to aws-sdk-go-v2, adding a custom multipart implementation with bounded concurrency.
  • Upgrades Elasticsearch client usage from go-elasticsearch/v6 to go-elasticsearch/v7, and adds an HTTP-based test for bulk indexing.
  • Updates system status collection to gopsutil/v4, and bumps the module Go version plus dependency sums.
File summaries
File Description
storage/s3.go Switches to AWS SDK v2; adds single-part vs multipart upload logic and concurrency.
storage/s3_test.go Adds unit tests for both single PUT and multipart behavior (retry, abort, memory usage).
storage/es.go Updates Elasticsearch v6 client import to v7.
storage/es_test.go Adds HTTP server-backed test covering ES v7 bulk request behavior.
common/sys_status.go Updates gopsutil imports from v3 to v4.
go.mod Bumps Go version and updates required modules for AWS SDK v2, ES v7, gopsutil v4, etc.
go.sum Updates module checksums consistent with the dependency upgrades.
Review details
  • Files reviewed: 6/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread storage/s3.go
Comment on lines +83 to +87
// Grow parts for large files without exceeding S3's 10,000-part limit.
partSize := max(s3UploadPartSize, (size-1)/10000+1)
if partSize > 5*1024*1024*1024 {
return errors.New("file exceeds the S3 multipart upload size limit")
}
Comment thread storage/s3.go
Comment on lines +117 to +121
var wg sync.WaitGroup
var once sync.Once
var firstErr error
for range min(5, partCount) {
wg.Go(func() {
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.

2 participants