-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade AWS crates and localstack #269
Conversation
Upgraded Cargo Updated localstack Fixed use of localstack in integration tests.
7f7c860
to
46bae53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still working my way through this, but need to context switch right now. I'll leave the comments I have so far.
Overall looks great, I don't see any major issue, but I still need to look more closely at the new functions that have been added.
Something for us to consider. Given this is a significant breaking change that takes us to 1.0
of the AWS SDK, when we release this should we call it 1.0.0
? Related to that, before we land this can we update the CHANGELOG.md
with a summary of any changes that users of cobalt-aws
will need to be aware of?
Cargo.toml
Outdated
serde = "1.0" | ||
serde_json = "1.0" | ||
tokio = { version = "1.35", features=["macros"] } | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features=["json", "env-filter"] } | ||
url = { version = "2.5", features = ["serde"] } | ||
bytes = "1.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: To help with readability these dependencies are maintained in alphabetical order. Could we move this new dependency up?
(This is another case where a linter would be an ideal solution to keep things tidy (in the eye of the beholder)).
@@ -301,7 +301,7 @@ where | |||
// for future work). To work around this, we capture any errors during this phase | |||
// and pass them into the handler function itself, so that it can raise the error | |||
// when the function is invoked. | |||
let init_result = (|| async { | |||
let init_result = async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: This is much nicer! Do you know if this syntax has always worked? I seem to recall wrestling with this code when I first wrote it to get it to behave how I wanted. I wonder if I just missed this simplification, or if something in the language has changed 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know the syntax let example_future = async { ... }
; has been valid since Rust 1.39.0, released in November 2019. If you were working with Rust before this version, it's possible you might have missed this simplification at the time. Earlier versions required using a feature flag for async/await, so the language's capabilities have evolved significantly since then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the challenge of upgrading, it is not an easy feat. From my standpoint it looks great. 👍🏿
Makefile
Outdated
@@ -12,7 +12,7 @@ test: | |||
# Sleep for 20s in between to let CI complete execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: change 20s to 1s to match the change below
docker-compose.yml
Outdated
@@ -49,10 +54,11 @@ services: | |||
- LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-} # only required for Pro | |||
- DOCKER_HOST=unix:///var/run/docker.sock | |||
- AWS_DEFAULT_REGION=ap-southeast-2 | |||
- DEFAULT_REGION=ap-southeast-2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: What is using this env var ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed, it was something I tried while trying to get the tests to pass.
@@ -0,0 +1,25 @@ | |||
FROM ghcr.io/harrison-ai/rust:1.75-1.0 | |||
|
|||
# cargo deny version 0.14.3 in the rust base layer fails on cargo deny check with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Thanks for the comment. Our future self will be happy to find 😄
@@ -26,6 +35,70 @@ pub use async_multipart_put_object::AsyncMultipartUpload; | |||
pub use async_put_object::AsyncPutObject; | |||
pub use s3_object::S3Object; | |||
|
|||
/// `FuturesStreamCompatByteStream` is a compatibility layer struct designed to wrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: Awesome comment. I've learned something. Thanks
Co-authored-by: Tim Leslie <[email protected]>
📢 For the Reviewer
In this PR, we're updating various AWS SDK dependencies for the
cobalt-aws
project to align with the latest versions and introducing support for LocalStack 3.0.2. Please provide feedback following the conventional comments guidebook to streamline the review process.🚦 Depends on
No other PRs.
🛠️ What
This PR includes the following key changes:
Dependency Updates:
aws-sdk-athena
: Upgraded from0.29
to1.10.0
.aws-config
: Updated to1.1.2
with thebehavior-version-latest
feature.aws-sdk-s3
: Upgraded from0.29
to1.12.0
.aws-sdk-sqs
: Upgraded from0.29
to1.10.0
.aws-types
: Upgraded from0.56
to1.1.2
.aws-smithy-async
: Added1.1.2
.aws-smithy-runtime-api
: Added1.1.2
.aws-smithy-http
: Removed.New Internal Structs:
futures::AsyncBufRead
.futures
implementation.LocalStack Upgrade: Upgraded to LocalStack 3.0.2, involving modifications in initializing LocalStack and ensuring its proper initialization.
❓ Why
The primary goals for this PR are:
FuturesStreamCompatByteStream
andFuturesPaginationStream
, we aim to maintain our asynchronous data operations.😟 Concerns
📝 Notes
During the process of passing the integration test, it was observed that the cargo-deny version 0.14.3 in the rust base image led to failures in executing cargo deny check. To resolve this, a docker file was introduced to revert to version 0.14.1, the earliest version that operates correctly. This temporary local modification was chosen to expedite the review and merging of this ticket. The plan is to propose a change for downgrading cargo-deny in the primary docker repository. The update will be applied to this ticket or a new one will be created in this repository to eliminate the rust-dev.dockerfile after the primary repository releases a new version. It's important to note that the issue with cargo-deny was exclusively found when running it inside docker.