Skip to content

Fix: Developer experiene with recent chagnes - #12178

Merged
Meldiron merged 8 commits into
1.9.xfrom
fix-developer-experience
Apr 29, 2026
Merged

Meldiron merged 8 commits into
1.9.xfrom
fix-developer-experience

Conversation

@Meldiron

@Meldiron Meldiron commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds category to project scopes console endpoint
  • Adds depricated boolean to project scopes console endpoint
  • Reorders scopes and improves descriptions in project scopes console endpoint
  • Renames execution scopes to plural executions
  • Adds sessions read sope
  • Fix missing sessions write scope in few user API endpoints
  • Renames console project socpes endpoint to better fit in future with other key types
  • Makes duration in ephemeral JWT required
  • Renames createStandardKey to just createKey
  • Proper use of indexes, columns and attributes scopes

Test Plan

Existing tests

Related PRs and Issues

x

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@Meldiron
Meldiron marked this pull request as ready for review April 29, 2026 11:55
@greptile-apps

greptile-apps Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves developer experience around scopes, key management, and API surface: it reorganizes project.php scopes with categories and deprecation flags, renames execution → executions, adds a sessions.read scope, makes ephemeral-key duration required, and renames createStandardKey → createKey (collapsing the /standard path into /v1/project/keys).

  • P1 — path removal: src/Appwrite/Platform/Modules/Project/Http/Project/Keys/Create.php drops /v1/project/keys/standard without adding it back as an alias; raw REST clients that target that path will receive 404.

Confidence Score: 4/5

Safe to merge after confirming whether /v1/project/keys/standard needs a backward-compat alias.

One P1 finding (removed HTTP path without alias) limits the ceiling to 4. All other changes are well-scoped and consistent; the double-quoted ' issue in Project-category descriptions was already flagged in a prior review.

src/Appwrite/Platform/Modules/Project/Http/Project/Keys/Create.php (removed /standard path) and app/config/scopes/project.php (double-quoted ' in Project-category descriptions).

Important Files Changed

Filename Overview
src/Appwrite/Platform/Modules/Project/Http/Project/Keys/Create.php Replaces Standard/Create.php; renames SDK method to createKey and HTTP path from /v1/project/keys/standard to /v1/project/keys without preserving the old path as an alias — breaking change for REST clients.
app/config/scopes/project.php Major reorganization: adds category and deprecated fields, renames execution → executions scopes, adds sessions.read, reorders entries; Project-category entries still use double-quoted strings with ' (backslash preserved literally — already flagged in prior review).
src/Appwrite/Platform/Modules/Project/Http/Project/Keys/Ephemeral/Create.php Makes duration a required param (removes default 900s); default changed to null with optional: false — works correctly since missing param triggers validation error before reaching the action.
app/controllers/api/users.php Adds sessions.read/sessions.write as alternative scopes on four session-related endpoints, preserving backward compatibility with existing users.read/users.write keys.
src/Appwrite/Platform/Modules/Console/Http/Scopes/Key/XList.php Renames endpoint from /v1/console/scopes/key to /v1/console/scopes/project and SDK method to listProjectScopes; adds category and deprecated fields to each scope document.
src/Appwrite/Utopia/Response/Model/ConsoleKeyScope.php Adds category (string, default '') and deprecated (boolean, default false) response model fields; consistent with config and XList changes.
tests/e2e/Services/Console/ConsoleConsoleClientTest.php Updates endpoint URL and expected description; asserts deprecated field but omits assertion for the new category field.
tests/e2e/Services/Project/KeysBase.php Updates ephemeral key tests to explicitly pass duration (now required); adds testCreateEphemeralKeyMissingDuration to verify 400 is returned when duration is omitted.

Reviews (5): Last reviewed commit: "Fix tests" | Re-trigger Greptile

@github-actions

github-actions Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing 1.9.x (before) to fix-developer-experience (after).

Before

Scenario P50 (ms) P95 (ms) Requests RPS
API total 0 0 n/a n/a
Account n/a n/a n/a n/a
TablesDB n/a n/a n/a n/a
Storage n/a n/a n/a n/a
Functions n/a n/a n/a n/a

After

Scenario P50 (ms) P95 (ms) Requests RPS
API total 15.51 135.18 185 31.85
Account 26.99 256.42 35 6.58
TablesDB 15.28 23.21 35 7.86
Storage 13.15 55.93 75 16.55
Functions 20.85 33.91 40 8.92

Delta

Scenario P95 delta (ms)
API total +135.18
Account n/a
TablesDB n/a
Storage n/a
Functions n/a
Top API waits
API request Max wait (ms)
account.sessions.email.create 698.59
account.password.update 256.26
account.create 157.14

Comment thread app/config/scopes/project.php Resolved
@Meldiron

Copy link
Copy Markdown
Contributor Author

@copilot Can you spot any breaking changes here, or is everything backwards compatible - no regression?

Comment thread app/config/scopes/project.php Resolved

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

@copilot Can you spot any breaking changes here, or is everything backwards compatible - no regression?

Here's the breaking-change analysis:

✅ Backwards compatible (safe)

  1. sessions.read scope added — purely additive, no regressions.
  2. collections.*/attributes.*/documents.* marked deprecated: true — the scopes and their endpoints still work, it's just metadata signalling.
  3. Session endpoints now accept both users.read and sessions.read — old keys with only users.read still pass, nothing breaks.
  4. execution.read/execution.write → executions.read/executions.write (endpoints) — the execution endpoint scopes were updated to accept an array ['executions.read', 'execution.read'], so existing API keys with the old singular names still work.
  5. Scope descriptions and category metadata — cosmetic only.

⚠️ Potential regressions / breaking changes

  1. rules.read, rules.write, schedules.read, schedules.write, vcs.read, vcs.write removed from project.php
    Proxy, Schedules, and VCS endpoints still reference these scopes (e.g. ->label('scope', 'rules.write')), but the scopes no longer appear in the publicly-visible project scopes list. This means the console/key-creation UI no longer shows them, so users cannot assign these scopes to new API keys. Existing keys with these scopes are unaffected at the endpoint level, but the ability to create new keys for these features is silently lost.

  2. createStandardProjectKey → createProjectKey (SDK method name)
    The getName() on the create-key action was renamed. Any SDK client code that calls project.createStandardKey will break. The V24 request filter still references the old name (project.createStandardKey), which may have been intended to bridge the gap — worth verifying the versioned filter covers all affected SDK consumers.

  3. Ephemeral key duration parameter became required
    optional: false was added to the duration param. Any existing caller (SDK, manual HTTP call) that omits duration (relying on the old default of 900 s) will now receive a 400 error. This is the most clear-cut backwards-incompatible change in the PR.


Summary: Items 1–5 in the first section are safe. The three items in the second section are the ones that need attention before merging, particularly the removal of rules/schedules/vcs from the visible scopes and the now-required duration field.

@blacksmith-sh

This comment has been minimized.

@github-actions

github-actions Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit 32ebfc6 - 28 flaky tests
Test Retries Total Time Details
UsageTest::testFunctionsStats 1 10.19s Logs
UsageTest::testPrepareSitesStats 1 9ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 7ms Logs
WebhooksCustomServerTest::testDeleteDeployment 1 18ms Logs
WebhooksCustomServerTest::testDeleteFunction 1 15ms Logs
WebhooksCustomServerTest::testCreateCollection 1 16ms Logs
WebhooksCustomServerTest::testCreateAttributes 1 77ms Logs
WebhooksCustomServerTest::testCreateDocument 1 15ms Logs
WebhooksCustomServerTest::testUpdateDocument 1 30ms Logs
WebhooksCustomServerTest::testDeleteDocument 1 17ms Logs
WebhooksCustomServerTest::testCreateTable 1 10ms Logs
WebhooksCustomServerTest::testCreateColumns 1 14ms Logs
WebhooksCustomServerTest::testCreateRow 1 19ms Logs
WebhooksCustomServerTest::testUpdateRow 1 18ms Logs
WebhooksCustomServerTest::testDeleteRow 1 11ms Logs
WebhooksCustomServerTest::testCreateStorageBucket 1 7ms Logs
WebhooksCustomServerTest::testUpdateStorageBucket 1 13ms Logs
WebhooksCustomServerTest::testCreateBucketFile 1 33ms Logs
WebhooksCustomServerTest::testUpdateBucketFile 1 11ms Logs
WebhooksCustomServerTest::testDeleteBucketFile 1 8ms Logs
WebhooksCustomServerTest::testDeleteStorageBucket 1 18ms Logs
WebhooksCustomServerTest::testCreateTeam 1 8ms Logs
WebhooksCustomServerTest::testUpdateTeam 1 10ms Logs
WebhooksCustomServerTest::testUpdateTeamPrefs 1 14ms Logs
WebhooksCustomServerTest::testDeleteTeam 1 6ms Logs
WebhooksCustomServerTest::testCreateTeamMembership 1 13ms Logs
WebhooksCustomServerTest::testDeleteTeamMembership 1 14ms Logs
WebhooksCustomServerTest::testWebhookAutoDisable 1 27ms Logs
Commit 36486cc - 5 flaky tests
Test Retries Total Time Details
VectorsDBConsoleClientTest::testGetCollectionLogs 1 7ms Logs
DatabasesConsoleClientTest::testGetCollectionLogs 1 9ms Logs
UsageTest::testFunctionsStats 1 10.20s Logs
UsageTest::testPrepareSitesStats 1 8ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 5ms Logs

@Meldiron
Meldiron merged commit 1aeee8c into 1.9.x Apr 29, 2026
44 checks passed
@TorstenDittmann
TorstenDittmann deleted the fix-developer-experience branch April 29, 2026 14:03
HarshMN2345 added a commit that referenced this pull request Oct 1, 2026
Restore the sessions.* scopes and reject non-key, non-privileged callers
at runtime instead of dropping the scopes. Dropping them broke
least-privilege API keys scoped to sessions.* (added in #12178), while
restoring them alone reopens the routes to guest/user roles that carry
sessions.write. The guard closes that hole and keeps the key scope.

Cover all four routes with e2e: members are rejected, and a key scoped
to sessions.* only still succeeds.
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