Skip to content

Upgrade SDK to 4.0 #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Upgrade SDK to 4.0 #316

wants to merge 2 commits into from

Conversation

niemyjski
Copy link
Member

This is a work in progress wanted to see what all was breaking.

Logged some initial feedback here: aws/aws-sdk-net#3784

@niemyjski niemyjski self-assigned this May 1, 2025
@niemyjski niemyjski added the dependencies Pull requests that update a dependency file label May 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the AWS SDK to version 4.0 and adjusts the code to accommodate new API and language features.

  • Updated credentials resolution to use DefaultAWSCredentialsIdentityResolver.
  • Revised handling of nullable properties and updated JSON conversion methods.
  • Adjusted collection initializers and null checks in file deletion and attribute parsing logic.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/Foundatio.AWS/Storage/S3FileStorage.cs Updated credentials, fixed nullable LastModified handling, and modified delete request initialization.
src/Foundatio.AWS/Queues/SQSQueue.cs Updated credentials and modified redrive policy creation using JsonObject.
src/Foundatio.AWS/Queues/AttributeExtensions.cs Updated JSON parsing for RedrivePolicy and streamlined TryParse calls.
src/Foundatio.AWS/Extensions/Extensions.cs Updated FileSpec conversion logic to safely handle nullable properties.
Files not reviewed (1)
  • src/Foundatio.AWS/Foundatio.AWS.csproj: Language not supported

@@ -306,7 +307,7 @@ public async Task<bool> ExistsAsync(string path)
const int PAGE_SIZE = 100;

var listRequest = new ListObjectsV2Request { BucketName = _bucket, Prefix = criteria.Prefix, MaxKeys = PAGE_SIZE };
var deleteRequest = new DeleteObjectsRequest { BucketName = _bucket };
var deleteRequest = new DeleteObjectsRequest { BucketName = _bucket, Objects = [] };
Copy link
Preview

Copilot AI May 1, 2025

Choose a reason for hiding this comment

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

The 'Objects' property of DeleteObjectsRequest likely expects a list (e.g., List), but an empty array literal is used. Please initialize it with new List() to ensure compatibility with subsequent AddRange calls.

Suggested change
var deleteRequest = new DeleteObjectsRequest { BucketName = _bucket, Objects = [] };
var deleteRequest = new DeleteObjectsRequest { BucketName = _bucket, Objects = new List<KeyVersion>() };

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant