Skip to content

Feat: Project public list endpoints#11981

Merged
Meldiron merged 16 commits into
1.9.xfrom
feat-public-list-endpoints
Apr 24, 2026
Merged

Feat: Project public list endpoints#11981
Meldiron merged 16 commits into
1.9.xfrom
feat-public-list-endpoints

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

@Meldiron Meldiron commented Apr 23, 2026

What does this PR do?

  • Adds more list endpoints for project resources, and improves existing with pagination support
  • Removes unsupported and unused endpoints
  • Moves deleteProject to public API

Test Plan

  • new 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?

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR adds listPolicies and getPolicy read endpoints to the public project API, adds limit/offset pagination to the existing listMockPhones and listEmailTemplates endpoints, moves deleteProject into the platform module, and removes deprecated bulk service/API endpoints and the JWT key endpoint. Both previously reported blocking issues — the missing 5th $project argument at $parseLabel cache call sites and the unregistered listPolicies action — have been fully resolved in this revision.

Confidence Score: 4/5

Safe to merge once the outstanding security design decision about API-key-permitted project deletion (flagged in a prior review thread) is confirmed as intentional.

All previously raised P0 and P1 code defects are resolved. The one remaining open item — allowing AuthType::KEY to permanently delete a project — is an unresolved security design question from a prior thread, not a new finding. No new logic or data-integrity bugs were found in this revision.

src/Appwrite/Platform/Modules/Project/Http/Project/Delete.php — confirm the AuthType::KEY permission is intentional for irreversible project deletion.

Important Files Changed

Filename Overview
app/controllers/shared/api.php Updated $parseLabel closure to accept a 5th $project parameter, and all three call sites (audit resource, cache.resource, cache.resourceType) have been updated to pass $project. Prior P0 concern resolved.
src/Appwrite/Platform/Modules/Project/Services/Http.php Registers all new actions: DeleteProject, ListPolicies, and GetPolicy. Prior P1 concern (listPolicies not registered) is resolved.
src/Appwrite/Platform/Modules/Project/Http/Project/Delete.php New deleteProject action moved to the public project API. Uses authorization->skip() for DB deletion. AuthType::KEY is permitted (security concern flagged in prior review thread).
src/Appwrite/Platform/Modules/Project/Http/Project/Policies/XList.php New listPolicies endpoint returning all 9 in-memory policy documents with limit/offset pagination support. Total is correctly calculated before slicing.
src/Appwrite/Platform/Modules/Project/Http/Project/Policies/Get.php New getPolicy endpoint with exhaustive match on valid policy IDs via WhiteList validator; returns correct per-policy response model.
src/Appwrite/Platform/Modules/Project/Http/Project/MockPhone/XList.php Added queries param with limit/offset pagination support. Total is computed before slicing, consistent with other Appwrite list endpoints.
tests/e2e/Services/Project/PoliciesBase.php Comprehensive new tests for listPolicies and getPolicy covering pagination, total flag, auth checks, data reflection after updates, and cross-checking list vs. get responses.

Reviews (8): Last reviewed commit: "Fix anayser" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

✨ Benchmark results

Comparing 1.9.x (before) to feat-public-list-endpoints (after).

Before

Scenario P50 (ms) P95 (ms) Requests RPS
API total 15.05 134.48 185 33.42
Account 24.52 187.23 35 6.93
TablesDB 15.11 20.27 35 8.38
Storage 12.31 52.89 75 17.7
Functions 18.95 32.07 40 9.65

After

Scenario P50 (ms) P95 (ms) Requests RPS
API total 15.04 141.4 185 33.13
Account 26.22 198.55 35 6.84
TablesDB 13.74 24.02 35 8.2
Storage 12.13 56 75 17.21
Functions 21.08 36.68 40 9.31

Delta

Scenario P95 delta (ms)
API total +6.91
Account +11.33
TablesDB +3.75
Storage +3.11
Functions +4.61
Top API waits
API request Max wait (ms)
account.sessions.email.create 687.61
account.password.update 198.17
account.create 152.46

Comment thread src/Appwrite/Platform/Modules/Project/Http/Project/Delete.php
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit 9c6ed95 - 4 flaky tests
Test Retries Total Time Details
RealtimeConsoleClientTest::testDeleteIndexTablesAPI 1 120.40s Logs
UsageTest::testFunctionsStats 1 10.19s Logs
UsageTest::testPrepareSitesStats 1 7ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 5ms Logs
Commit 4b39635 - 28 flaky tests
Test Retries Total Time Details
UsageTest::testFunctionsStats 1 10.20s Logs
UsageTest::testPrepareSitesStats 1 11ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 7ms Logs
WebhooksCustomServerTest::testDeleteDeployment 1 35ms Logs
WebhooksCustomServerTest::testDeleteFunction 1 19ms Logs
WebhooksCustomServerTest::testCreateCollection 1 22ms Logs
WebhooksCustomServerTest::testCreateAttributes 1 19ms Logs
WebhooksCustomServerTest::testCreateDocument 1 16ms Logs
WebhooksCustomServerTest::testUpdateDocument 1 11ms Logs
WebhooksCustomServerTest::testDeleteDocument 1 12ms Logs
WebhooksCustomServerTest::testCreateTable 1 77ms Logs
WebhooksCustomServerTest::testCreateColumns 1 11ms Logs
WebhooksCustomServerTest::testCreateRow 1 15ms Logs
WebhooksCustomServerTest::testUpdateRow 1 14ms Logs
WebhooksCustomServerTest::testDeleteRow 1 10ms Logs
WebhooksCustomServerTest::testCreateStorageBucket 1 7ms Logs
WebhooksCustomServerTest::testUpdateStorageBucket 1 15ms Logs
WebhooksCustomServerTest::testCreateBucketFile 1 11ms Logs
WebhooksCustomServerTest::testUpdateBucketFile 1 5ms Logs
WebhooksCustomServerTest::testDeleteBucketFile 1 5ms Logs
WebhooksCustomServerTest::testDeleteStorageBucket 1 15ms Logs
WebhooksCustomServerTest::testCreateTeam 1 7ms Logs
WebhooksCustomServerTest::testUpdateTeam 1 12ms Logs
WebhooksCustomServerTest::testUpdateTeamPrefs 1 11ms Logs
WebhooksCustomServerTest::testDeleteTeam 1 7ms Logs
WebhooksCustomServerTest::testCreateTeamMembership 1 17ms Logs
WebhooksCustomServerTest::testDeleteTeamMembership 1 14ms Logs
WebhooksCustomServerTest::testWebhookAutoDisable 1 27ms Logs
Commit 4de3009 - 6 flaky tests
Test Retries Total Time Details
UsageTest::testFunctionsStats 1 10.18s Logs
UsageTest::testPrepareSitesStats 1 6ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 5ms Logs
LegacyCustomClientTest::testPatchAttribute 1 97ms Logs
VectorsDBConsoleClientTest::testGetCollectionLogs 1 4ms Logs
DatabasesConsoleClientTest::testGetCollectionLogs 1 6ms Logs
Commit 5beeca5 - 28 flaky tests
Test Retries Total Time Details
WebhooksCustomServerTest::testDeleteDeployment 1 14ms Logs
WebhooksCustomServerTest::testDeleteFunction 1 10ms Logs
WebhooksCustomServerTest::testCreateCollection 1 11ms Logs
WebhooksCustomServerTest::testCreateAttributes 1 13ms Logs
WebhooksCustomServerTest::testCreateDocument 1 85ms Logs
WebhooksCustomServerTest::testUpdateDocument 1 10ms Logs
WebhooksCustomServerTest::testDeleteDocument 1 13ms Logs
WebhooksCustomServerTest::testCreateTable 1 16ms Logs
WebhooksCustomServerTest::testCreateColumns 1 14ms Logs
WebhooksCustomServerTest::testCreateRow 1 14ms Logs
WebhooksCustomServerTest::testUpdateRow 1 15ms Logs
WebhooksCustomServerTest::testDeleteRow 1 14ms Logs
WebhooksCustomServerTest::testCreateStorageBucket 1 6ms Logs
WebhooksCustomServerTest::testUpdateStorageBucket 1 13ms Logs
WebhooksCustomServerTest::testCreateBucketFile 1 16ms Logs
WebhooksCustomServerTest::testUpdateBucketFile 1 8ms Logs
WebhooksCustomServerTest::testDeleteBucketFile 1 8ms Logs
WebhooksCustomServerTest::testDeleteStorageBucket 1 28ms Logs
WebhooksCustomServerTest::testCreateTeam 1 16ms Logs
WebhooksCustomServerTest::testUpdateTeam 1 17ms Logs
WebhooksCustomServerTest::testUpdateTeamPrefs 1 13ms Logs
WebhooksCustomServerTest::testDeleteTeam 1 6ms Logs
WebhooksCustomServerTest::testCreateTeamMembership 1 15ms Logs
WebhooksCustomServerTest::testDeleteTeamMembership 1 10ms Logs
WebhooksCustomServerTest::testWebhookAutoDisable 1 30ms Logs
UsageTest::testFunctionsStats 1 10.17s Logs
UsageTest::testPrepareSitesStats 1 8ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 6ms Logs
Commit e323139 - 5 flaky tests
Test Retries Total Time Details
VectorsDBConsoleClientTest::testGetCollectionLogs 1 10ms Logs
DatabasesConsoleClientTest::testGetCollectionLogs 1 30ms Logs
UsageTest::testFunctionsStats 1 10.18s Logs
UsageTest::testPrepareSitesStats 1 7ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 5ms Logs

Note: Flaky test results are tracked for the last 5 commits

@blacksmith-sh

This comment has been minimized.

@Meldiron Meldiron merged commit 29b700d into 1.9.x Apr 24, 2026
80 of 81 checks passed
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