Repository navigation
refactor(storage)!: align remaining API with the Swift API Design Guidelines - #1368
Conversation
…delines SortBy.order stored the raw "asc"/"desc" string even though its own initializer already took a type-safe SortOrder, discarding that safety one property read later. Type it SortOrder directly. upload, update, and uploadToSignedURL left their file path unlabeled while every other StorageFileApi method taking a path (download, info, exists, createSignedURL, ...) labels it path:. Label it there too, for the same reason the others do: an unlabeled String at the call site doesn't tell a reader whether it's a path, a key, or a URL. See V3_MIGRATION.md for call-site examples.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (13)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe public Storage upload, update, and signed-upload methods now require a labeled Priority: ⬇️ Low Change: Refactor Merge Risk: ⚪ Minimal · up to The API migration preserves current repository callers and request encoding, with no identified merge-blocking risk. 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 |
Captures the naming/clarity rules from swift.org's API Design Guidelines as a project skill, alongside swift-docc and writing-migration-guides. Used to review #1358 and drive this PR.
|
The following capabilities are marked
The following capabilities are marked
These may have been renamed, removed, or never registered. Please update the capability matrix. |
Coverage Report for CI Build 35249193306Coverage remained the same at 89.413%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Follow-up to #1358's review — audited the rest of
Sources/Storage/(excludingDeprecated/) against the Swift API Design Guidelines, judging each call site on its own rather than by precedent in this file. Two findings, both fixed here.SortBy.orderis nowSortOrder, notStringSortBy.orderstored the raw"asc"/"desc"string even though its own initializer already took a type-safeSortOrder, discarding that safety one property read later — the exact pattern AGENTS.md's "Enum-like Values" section exists to prevent.upload/update/uploadToSignedURLlabel their file pathEvery other
StorageFileApimethod taking a path labels itpath:(download(path:),info(path:),exists(path:),createSignedURL(path:...),createSignedUploadURL(path:...)).upload,update, anduploadToSignedURLwere the odd ones out, taking it positionally — an unlabeledStringat the call site doesn't tell a reader whether it's a path, a key, or a URL, and it's inconsistent with its own siblings in the same file.All six overloads (
data:/fileURL:variants ofupload/update/uploadToSignedURL) move together.Shape
SortOrderstill encodes to"asc"/"desc", and the HTTP requestsupload/update/uploadToSignedURLmake are untouched.Sources/,Tests/, andExamples/updated to match.Testing
Didn't run
IntegrationTests(no local Supabase instance in this session) — none of the changed call sites are integration-only, and the request shapes are unchanged, only argument labels and one property's static type.