Repository navigation
feat(shell): add Object Lock management commands - #8141
Conversation
Add new weed shell command to view and enable S3 Object Lock on existing buckets. This allows administrators to enable Object Lock without recreating buckets, which is useful when buckets already contain data. The command: - Shows current Object Lock and Versioning status - Enables Object Lock with -enable flag (irreversible, per AWS S3 spec) - Automatically enables Versioning if not already enabled (required for Object Lock) Usage: s3.bucket.lock -name <bucket> # view status s3.bucket.lock -name <bucket> -enable # enable Object Lock Co-Authored-By: Claude <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
Add support for creating buckets with Object Lock enabled directly from weed shell. The flag automatically enables versioning as required by Object Lock. Usage: s3.bucket.create -name mybucket -withLock Co-Authored-By: Claude <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
📝 WalkthroughWalkthroughAdds optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Summary of ChangesHello @kvaps, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to S3 bucket management by adding comprehensive support for Object Lock. It provides users with flexible options to enable Object Lock, either when creating new buckets or on existing ones, thereby ensuring data immutability and compliance with WORM storage principles. The changes aim to simplify the process of securing data against unauthorized modifications. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces new shell commands for managing S3 Object Lock. A -withLock flag is added to s3.bucket.create to enable Object Lock on new buckets, and a new s3.bucket.lock command is added to view and enable Object Lock on existing buckets. The implementation is solid and covers the described functionality.
My review found one high-severity issue in the new s3.bucket.lock command where flag parsing errors are silently ignored. Fixing this will improve the command's robustness and user experience. Overall, this is a great addition.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
thanks! Maybe adds similar commands to enable/pause bucket versioning. |
Summary
s3.bucket.lockcommand to view and enable Object Lock on existing buckets-withLockflag tos3.bucket.createfor creating buckets with Object Lock enabledDetails
s3.bucket.lock command
Allows administrators to enable Object Lock on existing buckets without recreating them:
s3.bucket.create -withLock flag
Creates a new bucket with Object Lock enabled:
Test plan
s3.bucket.lock -name <bucket>shows correct statuss3.bucket.lock -name <bucket> -enableenables Object Locks3.bucket.create -name <bucket> -withLockcreates bucket with Object LockSummary by CodeRabbit
-withLockoption when creating S3 buckets to enable Object Lock (automatically enables Versioning).✏️ Tip: You can customize this high-level summary in your review settings.