Repository navigation
feat: add description to functions, sites, variables, keys, webhooks and databases - #14355
Conversation
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Optional description on create and update, stored on the functions collection (1024 chars, default '') and included in search. Mirrors WAF rule descriptions on Cloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same shape as functions: optional, up to 1024 chars, default '', kept on update when omitted. Covers sites, function/site/project variables, API keys, webhooks, databases, tables/collections, columns/attributes (every type, legacy and TablesDB) and indexes, including inline column and index definitions on table create. Searchable where the list endpoint supports search. Description-only variable updates no longer mark functions or sites for redeploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bases Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2f9057a to
6438d20
Compare
Main added a webhooks case to V25 for httpPass, which shadowed the webhooks label in the keys case. Move the description step into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bucket update now also rewrites search, which it never did, so a renamed bucket was only found by its old name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review complete. 🟡 1 medium 📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to🟡 Medium — Topic // src/Appwrite/Platform/Modules/Messaging/Http/Topics/Create.php
83 try {Topics Create and Update now store 🧹 Nitpicks (1) — 🟢 1 low
The change threads an optional, length-capped
Reviewed commit: 4527b30 |
🟢 Tier S · Ready to mergeAdds optional descriptions to compute resources, variables, keys, webhooks, database resources, storage buckets, and messaging topics. The change extends collection schemas and the V25 migration, updates response models and relevant search fields, and adds API and validator coverage. 68 of 150 changed files were too large to include in full.
Note Part of the diff was too large to review, so Hansi did not approve. 📂 Walkthrough · 7
🔇 Filtered out · 1Findings Hansi considered but did not post.
Merged |
The schema half of this PR moved to feat/description-schema so it can merge first. Merging it here also brings in main; the only conflicts were the topic `expiry` param rewording next to the new `description` param. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds an optional `description` string (size 1024, default '') to functions, sites, variables, databases, attributes, indexes, keys, webhooks, buckets, topics and the per-database metadata collection template, with the V25 upgrade steps that add it to existing installs. Schema only: no endpoint reads or writes the attribute yet, and response models do not expose it. The API side follows in appwrite#14355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resh the SDK lock Drops the explicit-null handling I had added on top of #14355. That 500 is not specific to description: 211 optional Text params across main's create endpoints share the shape (entrypoint and commands on Functions/Create.php, for two), because Utopia skips validation for an explicit null and only falls back to the declared default when the key is absent. Fixing it for description alone would be inconsistent with the rest of the API, so it belongs in its own PR. What remains on top of #14355 is only what main requires: - tests/e2e/.../VectorsDB/DatabasesBase.php and the two validator unit tests used Database::INDEX_HNSW_* and the pre-enum attribute constants; main has moved to the IndexType/ColumnType enums, so they died resolving a constant before reaching their assertions. - app/config/sdks/parameters.lock.json carried no description entries, so ParametersTest::testMethodsAreLocked failed on every touched method. Regenerated, not hand-patched: 222 entries gain "description", no method added, removed or reordered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The API params for resource descriptions were merged into feat/description-schema by appwrite#14355 ten hours after appwrite#14471 had already merged that branch's then-tip into main, so the params never reached main. This merge brings them across. 51 files conflicted, 49 of them under the Databases module, because main refactored the attribute/column endpoints after the branch was cut. Every conflict is resolved by keeping main's structure and applying only the branch's description addition on top: - Database::VAR_* -> ColumnType::*->value (main's enum migration) - getAdapter()->getMaxUIDLength() -> getMaxUidLength() - getAdapter()->get{Min,Max}DateTime() -> getAdapter()->limits()->{min,max}DateTime - new Spatial(Database::VAR_*) -> new Spatial(ColumnType::*->value) tests/e2e/Services/Databases/DatabasesBase.php is rebuilt from main's version plus the branch's five new description tests, ported to main's enums and Id::unique() casing, because git had interleaved the branch's new tests with three main-only tests added in the same region. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

What does this PR do?
Adds an optional
descriptionto functions, sites, variables, API keys, webhooks, databases, tables/collections, columns/attributes, indexes, storage buckets and messaging topics. It follows how WAF rules handle descriptions on Cloud (appwrite-labs/cloud,Modules/WAF/Http/Rules/*): same param name, limit, validator, update semantics and wording.API
Every resource takes the same
descriptionparam:Text(1024, 0), optionalNullable(Text(1024, 0)), optional''''''The field is returned on every matching response model. Docs text is "Optional description for the {resource}.", as on Cloud.
POST /v1/functions,PUT /v1/functions/:functionIdPOST /v1/sites,PUT /v1/sites/:siteIdPOST /v1/webhooks,PUT /v1/webhooks/:webhookIdPOST /v1/storage/buckets,PUT /v1/storage/buckets/:bucketIdPOST /v1/messaging/topics,PATCH /v1/messaging/topics/:topicIdBehaviour notes:
descriptionis the last param on each endpoint. Existing params keep their positions, so SDK calls that pass arguments positionally still work. Subclasses that inherit an action (TablesDB, DocumentsDB and VectorsDB on top of the legacy Databases actions) declare it in the same position. A script checked the 109 database, compute, key, variable and webhook endpoints that takedescriptionfor this. The 4 bucket and topic endpoints were checked by hand.description. TheAttributesandIndexesvalidators check it with the sameText(1024, 0).searchindex, so?search=on those lists matches it. Topics already haddescriptionin theirtopicSearchfilter, so they only needed the column. Bucket update now rewritessearchtoo. Before, it never did, so a renamed bucket was only found by its old name. Variables, keys and webhooks have no list search, so theirsearchvalue is unchanged. Description is not a filterable query attribute anywhere, which matches WAF rules.livetofalse. A description-only update on a variable also skips that step. Before, any project variable update setlive: falseon every function and site in the project.descriptionset returns 200. Before, an update with nokey,valueorsecretreturned 400.Storage
The
descriptionattributes (size 1024, default'') and the V25 upgrade steps moved to #14471. Its description lists the collections and the MariaDB row widths.Not in this PR
bucketsandtopicsin both the platform and project databases.descriptionthroughutopia-php/migrationexports and the CLI'sappwrite.config.json.descriptionwith a different limit and wording (Text(256), "Project description. Max length: 256 chars."). This PR leaves it unchanged.SDK usage
Test Plan
CI on this PR ran the E2E lanes on PostgreSQL and passed: Databases (1,295 tests), TablesDB (526), Project (977), Sites (65), Organization (102), Webhooks (139), Functions (88). MariaDB, MongoDB and shared-tables lanes did not run. The Storage and Messaging tests for buckets and topics were added after that run and have not run yet. The functions tests also ran locally against Postgres (4 tests, 103 assertions); the rest has not run locally.
E2E:
Databases/DatabasesBase(Legacy, TablesDB and DocumentsDB):testUpdateDatabaseDescriptionandtestUpdateCollectionDescription: set on create,''default, kept on update without it, cleared with'', found bysearch, 1025 chars returns400 general_argument_invalid.testUpdateAttributeDescription: creates one column of every type with a description, then updates each through its own type endpoint. This catches a mis-wired param in any of the 72 column/attribute files. Spatial types and relationships run where the adapter supports them.testCreateCollectionInlineDescription: inline column and index definitions.testCreateIndexDescription: index create.Databases/VectorsDB/DatabasesBase: database, collection and index descriptions.SitesCustomServerTest): the create/get/list/update tests are extended, andtestUpdateVariableDescriptionis new.livestayingtrueon a description-only update but goingfalseon a value update.Project/KeysBase) and organization project keys (Organization/KeysBase).StorageCustomServerTest::testUpdateBucketDescription): same cases as databases. It also checks thatsearchmatches the new description after an update and no longer matches the old one.MessagingBase::testUpdateTopicDescription): same cases as databases, on the PATCH update.Unit tests for the inline definition validators (
AttributesTest::testDescriptionand the newIndexesTest) pass on the host.Static checks:
descriptionparam position with the action signature each endpoint runs, including inherited ones. It checked all 109 endpoints that takedescriptionand found no mismatches.Related PRs and Issues
Checklist
🤖 Generated with Claude Code