-
Notifications
You must be signed in to change notification settings - Fork 8
chore: make aws optional #68
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
Conversation
Reviewer's GuideThis PR extracts AWS S3 support behind a new "s3" feature flag by conditionally compiling all S3-related code, marks the Source enum as non-exhaustive for future expansion, and updates project versioning and dependencies accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `common/src/scoop/source.rs:27-35` </location>
<code_context>
};
use url::Url;
+#[cfg(feature = "s3")]
+use aws_config::{BehaviorVersion, Region, meta::region::RegionProviderChain};
+#[cfg(feature = "s3")]
</code_context>
<issue_to_address>
**question:** Conditional compilation may lead to inconsistent behavior if 's3' feature is disabled.
If 's3' is disabled, S3 URLs are handled as Path sources without warning. Consider raising an explicit error for unsupported schemes instead.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
96992be to
0312975
Compare
|
@sourcery-ai review |
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider returning an explicit error when encountering an "s3://" URI with the s3 feature disabled, rather than silently treating it as a file path.
- The new #[non_exhaustive] on the Source enum can break existing exhaustive matches downstream—please verify call sites are updated to handle this change.
- There’s a lot of repetitive cfg(feature = "s3") around each S3 match arm and method; you might extract those into helper functions or modules to reduce duplication and improve readability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider returning an explicit error when encountering an "s3://" URI with the s3 feature disabled, rather than silently treating it as a file path.
- The new #[non_exhaustive] on the Source enum can break existing exhaustive matches downstream—please verify call sites are updated to handle this change.
- There’s a lot of repetitive cfg(feature = "s3") around each S3 match arm and method; you might extract those into helper functions or modules to reduce duplication and improve readability.
## Individual Comments
### Comment 1
<location> `common/src/scoop/source.rs:37` </location>
<code_context>
+ #[cfg(feature = "s3")]
+ if value.starts_with("s3://") {
</code_context>
<issue_to_address>
**issue (bug_risk):** The conditional compilation for S3 parsing may lead to silent fallback to Path if the feature is disabled.
Consider raising an explicit error or warning when 's3://' is encountered but the 's3' feature is disabled, to prevent user confusion from silent fallback.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
0312975 to
9b06693
Compare
|
@sourcery-ai review |
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider consolidating the scattered #[cfg(feature = "s3")] blocks by moving all S3-specific functionality into its own module behind the feature flag to improve readability in source.rs.
- Since you marked Source as non_exhaustive, ensure all downstream match statements include a wildcard arm to handle future variants without breaking.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider consolidating the scattered #[cfg(feature = "s3")] blocks by moving all S3-specific functionality into its own module behind the feature flag to improve readability in source.rs.
- Since you marked Source as non_exhaustive, ensure all downstream match statements include a wildcard arm to handle future variants without breaking.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
8d410a4 to
405652f
Compare
mrizzi
left a comment
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.
@ctron it looks very good, thanks
Summary by Sourcery
Enable optional AWS S3 support behind a new "s3" feature flag and make S3-related code and dependencies conditional, falling back to HTTP or filesystem sources when disabled, and bump package version to 0.15.0.
New Features:
Enhancements:
Build:
Tests: