Skip to content

refactor(specs): name the alias summary "summary" - #13745

Merged
ChiragAgg5k merged 1 commit into
mainfrom
refactor/alias-summary-field
Sep 17, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
refactor/alias-summary-field

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

What

Renames the method-alias short-title field in x-appwrite.methods[] from desc to the standard OpenAPI name summary, and renames the PHP field behind it.

Why

An OpenAPI operation carries its short title in summary and its prose in description, and the producer already does that for real operations (OpenAPI3.php:310, 'summary' => $route->getDesc()). Method aliases don't exist in OpenAPI, so they're packed into x-appwrite.methods[] as mini-operations — and there the same short title was called desc, sitting directly beside a description field holding the long prose:

{
  "summary": "Create document",                      // the operation
  "description": "Create a new Document. Before…",
  "x-appwrite": {
    "methods": [{
      "name": "createDocuments",
      "desc": "Create documents",                    // the alias's summary, under another name
      "description": "Create new Documents. Before…"
    }]
  }
}

So desc reads like an abbreviation of the field next to it while actually meaning something else. That is both an abbreviation the style guide rules out and a non-standard name for something OpenAPI can express, which is what appwrite-labs/cloud#5799 is cleaning up.

Changes

  • OpenAPI3.php:359 emits 'summary' => $methodObj->getSummary().
  • Appwrite\SDK\Method::$desc → $summary, getDesc() → getSummary(), and the 16 call sites across 10 files pass summary:. Route::getDesc() is Utopia's and is untouched, including its use for the operation summary.
  • validateDesc() is renamed validateDescription() — it validates a description, and the old name collided conceptually with the new summary.

Effect on the canonical document

77 aliases: 13 carry a populated summary ("Create documents", "Upsert presence", "Create Text Embedding"…), 64 are empty strings today and stay empty strings. No value changes, only the key.

Consumers

Neither consumer needs a change.

  • sdk-generator never read desc. createAliasedOperation() derives an alias summary from alias['name'] and its description from alias['description'].
  • vibes already reads additionalMethod.summary || additionalMethod.desc || operation.summary (src/lib/api-explorer/parse-spec.ts:154), so it picks up the new field on the first branch with no flag day. Dropping the now-dead desc fallback is an independent tidy-up for whenever historical specs stop mattering.

Testing

testCanonicalDocumentListsEveryAliasVariant now gives one of its two aliases summary: 'Update presence for a user' and asserts the emitted summary for both aliases, so the alias keeps a summary distinct from its name and description.

  • vendor/bin/phpunit tests/unit/SDK/Specification/FormatTest.php — 42 tests, 250 assertions, OK
  • vendor/bin/phpunit --testsuite unit — 1275 tests; the only failures are 19 errors plus ExtensionsTest::testMaxminddb, which reproduce identically on a clean main in this environment (missing maxminddb extension and image/font deps)
  • composer lint — Pint passed

An operation carries its short title in the standard `summary` field and
its prose in `description`. A method alias in `x-appwrite.methods[]`
mirrors an operation, but carried the same short title under `desc` while
keeping `description` as a separate sibling, so `desc` read like an
abbreviation of the field sitting next to it.

Emit `summary` instead, and rename the PHP side to match: Method::$desc
becomes $summary with getSummary(), and the 16 call sites pass
`summary:`. Route::getDesc() is Utopia's and is untouched.

No consumer changes. The generator never read the key, deriving an alias
summary from its name. Vibes already reads
`additionalMethod.summary || additionalMethod.desc`, so it takes the new
field on the first branch and its fallback can be dropped once historical
specs stop mattering.

While here, validateDesc() validates a description, so it is renamed to
validateDescription() to keep it distinct from the new summary.
@greptile-apps

greptile-apps Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The production rename appears internally consistent, but the implementation-coupled test must be corrected to satisfy the repository’s explicit testing requirement before merging.

Fix All in Claude CodeFindings

  1. P2 Fixture Values Mirrored ▶
Fix with agent prompt
### Issue 1
tests/unit/SDK/Specification/FormatTest.php:1548-1549
These assertions repeat the exact summary passed into the fixture and its default empty value. They therefore test simple value propagation rather than an independently defined observable contract. This violates the repository directive not to mirror source configuration in assertions; the repository requirement must be satisfied before merging by replacing this with a behavior-level test and leaving schema or key validation to the appropriate linter.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR consistently renames method-alias summary metadata from desc to summary throughout the SDK method model, route declarations, and OpenAPI extension output.

  • Renames Method::$desc and getDesc() to their summary equivalents.
  • Updates all populated alias declarations to use the new named argument.
  • Emits summary in x-appwrite.methods[].
  • Adds canonical-format coverage, but the new assertions violate the repository’s testing rule by mirroring fixture values.

Reviews (1) · Last reviewed commit: "refactor(specs): name the alias summary ..."

Comment on lines +1548 to +1549
$this->assertSame('', $canonical['x-appwrite']['methods'][0]['summary']);
$this->assertSame('Update presence for a user', $canonical['x-appwrite']['methods'][1]['summary']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Fixture Values Mirrored

These assertions repeat the exact summary passed into the fixture and its default empty value. They therefore test simple value propagation rather than an independently defined observable contract. This violates the repository directive not to mirror source configuration in assertions; the repository requirement must be satisfied before merging by replacing this with a behavior-level test and leaving schema or key validation to the appropriate linter.

Context Used: Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/unit/SDK/Specification/FormatTest.php
Line: 1548-1549

Comment:
**Fixture Values Mirrored**

These assertions repeat the exact summary passed into the fixture and its default empty value. They therefore test simple value propagation rather than an independently defined observable contract. This violates the repository directive not to mirror source configuration in assertions; the repository requirement must be satisfied before merging by replacing this with a behavior-level test and leaving schema or key validation to the appropriate linter.

**Context Used:** Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → refactor/alias-summary-field (after).

Metric Before After Change
🚀 Requests/sec 497.61 494.62 ⚪ -0.6%
⏱️ Latency P50 34.25 ms 34.89 ms ⚪ +1.9%
⏱️ Latency P95 84.16 ms 82.81 ms ⚪ -1.6%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 34.89 82.81 30,267 494.62 -1.35
Account 61.62 115.81 1,593 26.51 -6.58
TablesDB 33.28 65.37 16,461 271.37 +1.52
Storage 32.25 80 7,965 133.11 +0.01
Functions 50.08 101.92 4,248 71.73 +0.52

Top API waits (after)

API request Max wait (ms)
account.name.update 231.39
functions.create 201.54
functions.variables.update 171.58
tablesdb.rows.create 168.77
tablesdb.rows.delete 168.3

@ChiragAgg5k
ChiragAgg5k merged commit e986d8f into main Sep 17, 2026
51 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the refactor/alias-summary-field branch September 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants