feat(s3): add lsh s3 object storage commands - #97
Open
LanusseMorais wants to merge 4 commits into
Open
LanusseMorais wants to merge 4 commits into
LanusseMorais wants to merge 4 commits into
Conversation
Collaborator
Author
Comment on lines
+531
to
+532
| root.SetArgs(append([]string{"s3"}, args...)) | ||
| err := root.Execute() |
There was a problem hiding this comment.
The compatibility shim forwards legacy arguments unchanged. However, storage-objects get <id> accepted a raw bucket ID while s3 get requires an s3:// URI, and storage-objects delete <id> deleted a bucket while s3 delete now deletes objects. Existing scripts using either documented legacy form therefore fail instead of performing the original bucket operation. Translate these legacy verbs and arguments to the corresponding bucket commands before redispatching.
Prompt To Fix With AI
This is a comment left during a code review.
Path: cmd/s3/s3.go
Line: 531-532
Comment:
**Legacy commands break**
The compatibility shim forwards legacy arguments unchanged. However, `storage-objects get <id>` accepted a raw bucket ID while `s3 get` requires an `s3://` URI, and `storage-objects delete <id>` deleted a bucket while `s3 delete` now deletes objects. Existing scripts using either documented legacy form therefore fail instead of performing the original bucket operation. Translate these legacy verbs and arguments to the corresponding bucket commands before redispatching.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lsh s3command group covering buckets, objects, access keys and lifecycle rules, addressing them ass3://<bucket>/<key>:list get copy move delete create-bucket delete-bucket sync presign configure access-keys lifecycle metrics usage(short aliasesls stat cp mv rm mb rb).lsh help object-storageexplains addressing and access keys.lsh help exit-codes; the older command groups keep their current behaviour.textoutput format and extends--queryto it.latitudesh-go-sdkv1.16.5 -> v1.19.20 (access keys, lifecycle rules, metrics, usage) and adapts the existing command groups to the new request/response models.minio-go/v7as the S3 client: +1.54 MB on the binary against +7.96 MB foraws-sdk-go-v2(measured). Release builds now use-s -w -trimpath.storage_objectsgroup;storage-objectsremains as an alias.Known limitations
POST /storage/access_keysreturns the secret exactly once. A key that cannot be persisted is deleted again rather than left behind as a credential nobody can use.region.site.slugand an access key'sbuckets[]/accessare dropped by the generated models (read from the raw JSON:API document), andretention_periodcomes back as a string while the model is*int64(normalised in the HTTP client).list,get,copy,move,delete,create-bucket,delete-bucket); the short spellings (ls,stat,cp,mv,rm,mb,rb) remain as aliases.deleteremoves objects:lsh s3 delete s3://<bucket>(and the legacystorage-objects delete <bucket-id>) fails with a message namingdelete-bucketinstead of removing the bucket.storage-objectsis kept as a hidden, deprecated command that prints a notice on stderr and re-dispatches tolsh s3. Thebucketsalias was dropped.Closes E-4227
Closes E-4233
Closes E-4047
Testing
Clone & checkout
Build & unit tests
Try the commands
🤖 Generated with Claude Code
The PR is not yet safe to merge because the advertised legacy
storage-objectsshim breaks existing get and delete scripts.Summary
lsh s3command hierarchy and object data-plane operations.storage-objectsas a deprecated shim, although two legacy bucket operations are not currently translated correctly.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR CLI[lsh s3] --> API[Latitude API] CLI --> S3[S3 bucket endpoint] API --> B[Buckets] API --> K[Access keys] API --> L[Lifecycle, metrics, usage] S3 --> O[Object list, copy, move, delete, get, sync] K --> P[Profile credential store]Reviews (3) · Last reviewed commit: "refactor(s3): lsh verbs as canonical nam..."