DEV: Update aws-sdk-s3 gem for S3 multipart uploads (#13523)

DEV: Update aws-sdk-s3 gem for S3 multipart uploads (#13523)

We are a few versions behind on this gem. We need to update it for S3 multipart uploads. In the current version we are using, we cannot do this:

Discourse.store.s3_helper.object(key).presigned_url(:upload_part, part_number: 1, upload_id: multipart_upload_id)

The S3 client raises an error, saying the operation is undefined. Once I updated the gem this operation works as expected and returns a presigned URL for the upload_part operation.

Also remove use of Aws::S3::FileUploader::FIFTEEN_MEGABYTES. This was part of a private API and should not have been used.

diff --git a/Gemfile.lock b/Gemfile.lock
index 282255e..6dde31f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -59,10 +59,10 @@ GEM
       aws-partitions (~> 1, >= 1.239.0)
       aws-sigv4 (~> 1.1)
       jmespath (~> 1.0)
-    aws-sdk-kms (1.42.0)
+    aws-sdk-kms (1.44.0)
       aws-sdk-core (~> 3, >= 3.112.0)
       aws-sigv4 (~> 1.1)
-    aws-sdk-s3 (1.90.0)
+    aws-sdk-s3 (1.96.1)
       aws-sdk-core (~> 3, >= 3.112.0)
       aws-sdk-kms (~> 1)
       aws-sigv4 (~> 1.1)
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 636b278..ed4d857 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -3,6 +3,7 @@
 require "aws-sdk-s3"
 
 class S3Helper
+  FIFTEEN_MEGABYTES = 15 * 1024 * 1024
 
   class SettingMissing < StandardError; end
 
@@ -42,8 +43,8 @@ class S3Helper
     obj = s3_bucket.object(path)
 
     etag = begin
-      if File.size(file.path) >= Aws::S3::FileUploader::FIFTEEN_MEGABYTES
-        options[:multipart_threshold] = Aws::S3::FileUploader::FIFTEEN_MEGABYTES
+      if File.size(file.path) >= FIFTEEN_MEGABYTES
+        options[:multipart_threshold] = FIFTEEN_MEGABYTES
         obj.upload_file(file, options)
         obj.load
         obj.etag

GitHub sha: c3394ed9bba48ad83e94e78fe946110cdb937e62

This commit appears in #13523 which was approved by CvX. It was merged by martin.