Skip to content
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

chore: update aws sdk, also for all the dependencies #162

Merged
merged 2 commits into from
Mar 19, 2024
Merged

Conversation

junghao
Copy link
Contributor

@junghao junghao commented Mar 18, 2024

Proposed Changes

aws wrappers in kit is working weirdly due to aws sdk version conflicts with downstream application's dependencies.
eg. fits requires go-aws-sdk-v2 v1.25 and above, however existin go-aws-sdk-v2 in kit is v1.22.

This caused a conflict between data types (aws has changed some functions' signatures to pointer)

Also did a full upgrade for all other dependencies. Hope I'm doing what we supposed to do?

Please note the upgraded dependencies here https://github.com/GeoNet/kit/pull/162/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R6
(I don't think we can care about those indirect)

Production Changes

The following production changes are required to deploy these changes:

  • None

Review

Check the box that applies to this code review. If necessary please seek help with adding a checklist guide for the reviewer.
When assigning the code review please consider the expertise needed to review the changes.

  • This is a content (documentation, web page etc) only change.
  • This is a minor change (meta data, bug fix, improve test coverage etc).
  • This is a larger change (new feature, significant refactoring etc). Please use the code review guidelines to add a checklist below to guide the code reviewer.

Code Review Guide

Insert check list here if needed.

@junghao junghao force-pushed the aws-deps branch 5 times, most recently from 8c68af4 to aad6638 Compare March 18, 2024 19:47
aws/s3/s3.go Outdated
@@ -243,7 +243,7 @@ func (s *S3) GetContentSizeTime(bucket, key string) (int64, time.Time, error) {
if err != nil {
return size, mt, err
}
return o.ContentLength, *o.LastModified, nil
return *o.ContentLength, *o.LastModified, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

should probably use aws.ToString() / aws.String() (can't remember which in this case). Is safer if pointer is nil.

Probably review all the pointers in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is AWS SDK changed the member type in the returned structure from int64 to *int64, not the calling parameters.

And the reason I didn't do pointer check is because the *o.LastModified has been living well, also there's already a error check right above, and apparently the ContentLength is not an optional attribute. So I think it should be fine to just de-referencing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also for the IsTruncated below, I don't think it's optional tool. It must have zero value when the sdk forms the structure.

@sue-h-gns sue-h-gns merged commit 5b5fd9f into main Mar 19, 2024
5 checks passed
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.

3 participants