-
Notifications
You must be signed in to change notification settings - Fork 24
feat: bucket folders #62
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new design document (021-bucket-folders.md) describing folder support for storage buckets. It defines lightweight, non-nesting folders, a folders collection stored alongside files with a discriminator, and a folderId reference on files (root vs specific folder). It outlines API endpoints for folder CRUD, file endpoint adjustments to associate/filter by folder, required indexes, and a migration to annotate existing documents. It details implementation steps, delete semantics including force behavior, reliability/testing plans, UI/UX notes, documentation needs, roadmap for nesting/permissions, rationale, and open questions. Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
021-bucket-folders.md (1)
37-51
: Add fence languages for API examplesMarkdown linters (MD040) are flagging the unlabeled code fences in this section. Tag them with an appropriate language (e.g.,
http
,json
, ortext
) so automated checks pass.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
021-bucket-folders.md
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
021-bucket-folders.md
10-10: Link and image reference definitions should be needed
Unused link or image reference definition: "summary"
(MD053, link-image-reference-definitions)
16-16: Link fragments should be valid
(MD051, link-fragments)
16-16: Link and image reference definitions should be needed
Unused link or image reference definition: "problem-statement"
(MD053, link-image-reference-definitions)
24-24: Link fragments should be valid
(MD051, link-fragments)
24-24: Link and image reference definitions should be needed
Unused link or image reference definition: "design-proposal"
(MD053, link-image-reference-definitions)
37-37: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
46-46: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
184-184: Link and image reference definitions should be needed
Unused link or image reference definition: "prior-art"
(MD053, link-image-reference-definitions)
196-196: Link and image reference definitions should be needed
Unused link or image reference definition: "unresolved-questions"
(MD053, link-image-reference-definitions)
205-205: Link and image reference definitions should be needed
Unused link or image reference definition: "future-possibilities"
(MD053, link-image-reference-definitions)
- `(bucketInternalId, type, name)` - unique constraint for folder names | ||
- `(bucketInternalId, folderId)` - list files in folder | ||
- `(bucketInternalId, type)` - list all folders |
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.
Unique index will break existing file uploads
The proposed unique index (bucketInternalId, type, name)
applies to all documents in the bucket collection. Once the migration sets type = 'file'
on every file, this index will forbid two files in the same bucket sharing the same name—something Appwrite currently allows. That’s a backward-incompatible change that will cause uploads (and even the migration itself) to fail in any bucket that already contains duplicate filenames. Please limit the uniqueness to folders only (e.g., partial index type = 'folder'
) or pick another discriminator so files remain unaffected.
🤖 Prompt for AI Agents
In 021-bucket-folders.md around lines 93-95, the suggested unique index
`(bucketInternalId, type, name)` would make filenames unique across all
documents once files get `type = 'file'`, breaking existing uploads; change the
index to only enforce uniqueness for folders by creating a partial/filtered
unique index that applies when `type = 'folder'` (or use a folder-specific
discriminator field), and update the migration steps to set `type` only for
folder documents (or populate the discriminator safely) so files are not
affected; ensure the migration creates the partial unique index after ensuring
all folder documents meet the constraint and include a fallback plan to detect
and resolve existing duplicate folder names before index creation.
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit