fix: Error while deploying to localstack or MinIo resolved as S3 was always pointing to the default aws environment and failing to save artifacts metadata#13586
Conversation
…ing to default aws environment
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthrough
ChangesCustom S3 Endpoint Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
feat(s3): support custom endpoint via AWS_ENDPOINT_URL env var
Summary
Adds support for local/custom S3-compatible endpoints (e.g. LocalStack, MinIO) by
reading the
AWS_ENDPOINT_URLenvironment variable at client initialization time.Problem
The
AwsS3Clientconstructor had no way to target a non-AWS S3-compatible endpoint.This made local development and integration testing difficult — developers had to either
work against real AWS buckets or monkey-patch the client after instantiation.
Solution
Before constructing the
S3Client, the constructor now checks forAWS_ENDPOINT_URL.If present, it merges two additional options into
awsConfig:endpoint— points the client at the custom URLforcePathStyle: true— required by most S3-compatible services (LocalStack, MinIO,etc.) which do not support virtual-hosted-style bucket addressing
Why this approach
preserved when it is unset.
AWS_ENDPOINT_URLis the de-facto standardvariable used by the AWS CLI, LocalStack, and many CI setups, so no extra
documentation is needed.
parameters, no new public methods.
Testing
Set
AWS_ENDPOINT_URL=http://localhost:4566(or your local stack URL) and run theexisting S3 integration tests — all bucket operations should route to the local
endpoint without any code changes.
Checklist
awsConfigoverridesSummary by CodeRabbit
Release Notes