Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jan 14, 2026

What does this PR do?

Changes as per latest server specs, these include -

  1. Updates to Runtime enums
  2. Output is now correctly renamed to ImageFormat
  3. Introduces Backups module for managing Database backups
  4. Introduces Organization module

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

  • New Features

    • Added Backups service for managing archives, policies, and restorations.
    • Added Organizations service for managing organization operations.
    • Added Health service endpoints for queue monitoring and aggregations.
    • Added optional duration parameter to JWT creation.
  • Breaking Changes

    • Removed support for deprecated Deno runtime versions.
    • Output enum replaced with ImageFormat in avatars service.
  • Improvements

    • Enhanced database and storage operations for better control.
    • Updated documentation with new examples and version compatibility.
    • SDK version bumped to 14.1.1.

✏️ Tip: You can customize this high-level summary in your review settings.

@ItzNotABug ItzNotABug self-assigned this Jan 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Warning

Rate limit exceeded

@ItzNotABug has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f618b12 and 7762a92.

📒 Files selected for processing (1)
  • CHANGELOG.md

Walkthrough

The pull request updates the Python SDK from version 14.1.0 to 14.1.1. Changes include introducing two new service classes (Backups and Organizations), removing the Output enum in favor of ImageFormat in image-related services, deprecating three Deno runtime versions, adding new OAuth providers and Name enum members, extending the Account and Health services with new optional parameters and methods, and modifying the Databases service to make the data parameter optional in upsert_document. Corresponding documentation examples and setup metadata are updated to reflect the version bump and new functionality.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Updates: sync as per latest cloud specs' is vague and generic, using non-descriptive terms like 'Updates' and 'sync' that don't convey the specific nature of the changes. Revise the title to be more specific about the primary changes, such as 'Add Backups service and update SDK to v14.1.1' or 'Update SDK enums and add backup/health/organization services'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@appwrite/services/account.py`:
- Line 1231: The enum listing OAuth2 providers includes "githubImagine" and
"googleImagine" with no documentation—determine whether these are production
providers or test-only artifacts and either (A) add a clear doc comment above
the enum (or next to the specific values) explaining their purpose and intended
usage (e.g., "test-only/mock providers used for internal integration testing;
not for production"), or (B) remove the "githubImagine" and "googleImagine"
entries from the enum if they are only test artifacts; if you remove them, also
update any tests, fixtures, or reference code that expect those values (search
for "githubImagine" and "googleImagine" across the repo and update docs/tests
accordingly) and ensure the enum docstring reflects the final set of supported
providers.

In `@appwrite/services/organizations.py`:
- Around line 15-18: The docstring for the parameter organization_id is
inconsistent (it says "Team ID"); update the parameter description in the
docstring to read "Organization ID" so it matches the parameter name
organization_id and improves clarity (locate the docstring in
appwrite.services.organizations where organization_id is documented and replace
"Team ID" with "Organization ID").
- Around line 47-50: Update the docstring for the function in
appwrite/services/organizations.py that declares the parameter organization_id
so the parameter description reads "Organization ID" instead of "Team ID";
locate the docstring that documents the organization_id parameter (same place
where delete had the mismatch) and replace the incorrect "Team ID" text with
"Organization ID" to keep docs consistent.

In `@appwrite/services/storage.py`:
- Around line 441-443: The permissions value is always being sent even when None
which can override inherited permissions; change the code that builds api_params
to only set api_params['permissions'] = permissions when permissions is not None
(mirroring the existing conditional for name), i.e., add a conditional check
around the permissions assignment so permissions is only included in api_params
when not None.
🧹 Nitpick comments (12)
README.md (1)

9-9: Consider specifying a concrete version number for the compatibility note.

Stating compatibility with "Appwrite server version latest" may become ambiguous over time. Consider specifying the exact server version (e.g., "1.8.x") for clearer compatibility guidance, as was done in the previous version.

appwrite/services/avatars.py (1)

10-10: Remove unnecessary semicolon.

Python does not require semicolons at end of statements.

Proposed fix
-from ..enums.image_format import ImageFormat;
+from ..enums.image_format import ImageFormat
docs/examples/account/create-jwt.md (1)

11-13: Consider using a meaningful example value for duration.

The example uses duration = 0, which may produce an immediately expiring JWT or be rejected by the API. According to the docstring, the default is 900 seconds and max is 3600 seconds. A value like duration = 1800 (30 minutes) would be a more practical example.

Proposed fix
 result = account.create_jwt(
-    duration = 0 # optional
+    duration = 1800 # optional
 )
appwrite/services/organizations.py (1)

1-4: Unused imports.

List, Optional, and deprecated are imported but not used in this module.

🧹 Suggested cleanup
 from ..service import Service
-from typing import List, Dict, Any, Optional
+from typing import Dict, Any
 from ..exception import AppwriteException
-from appwrite.utils.deprecated import deprecated
appwrite/services/backups.py (4)

1-9: Unused import: deprecated.

The deprecated decorator is imported but never used in this module.

Proposed fix
 from ..service import Service
 from typing import List, Dict, Any, Optional
 from ..exception import AppwriteException
-from appwrite.utils.deprecated import deprecated

68-69: Inconsistent handling of optional resource_id parameter.

resource_id is always added to api_params even when None, unlike other optional parameters in this file (e.g., queries in list_archives). This inconsistency could send unnecessary null values to the API.

Proposed fix
         api_params['services'] = services
-        api_params['resourceId'] = resource_id
+        if resource_id is not None:
+            api_params['resourceId'] = resource_id

214-222: Same inconsistency with resource_id parameter.

Line 218 adds resourceId unconditionally while name and enabled are conditionally added. Apply the same pattern for consistency.

Proposed fix
         api_params['policyId'] = policy_id
         if name is not None:
             api_params['name'] = name
         api_params['services'] = services
-        api_params['resourceId'] = resource_id
+        if resource_id is not None:
+            api_params['resourceId'] = resource_id
         if enabled is not None:
             api_params['enabled'] = enabled
         api_params['retention'] = retention
         api_params['schedule'] = schedule

294-298: Inconsistent handling of optional parameters in update_policy.

schedule is conditionally added (line 296-297), but name, retention, and enabled are added unconditionally, potentially sending None values. Since all parameters are optional in an update operation, they should all be handled consistently.

Proposed fix
-        api_params['name'] = name
-        api_params['retention'] = retention
+        if name is not None:
+            api_params['name'] = name
+        if retention is not None:
+            api_params['retention'] = retention
         if schedule is not None:
             api_params['schedule'] = schedule
-        api_params['enabled'] = enabled
+        if enabled is not None:
+            api_params['enabled'] = enabled
docs/examples/backups/create-archive.md (1)

11-14: Provide a meaningful example for services.

An empty array [] passes validation but creates a backup of nothing. Consider showing a realistic example with actual service values to guide users.

Proposed fix
 result = backups.create_archive(
-    services = [],
+    services = ['databases'],  # e.g., 'databases', 'storage', etc.
     resource_id = '<RESOURCE_ID>' # optional
 )
docs/examples/backups/create-policy.md (2)

13-13: Consider using a more illustrative services example.

The empty list services = [] might not clearly demonstrate to users what should be included. Backup policies typically need to specify at least one service to back up.

💡 Suggested improvement

Consider showing an example with actual service names:

-    services = [],
+    services = ['database', 'storage'], # e.g., database, storage, functions

15-15: Consider using a cron expression for the schedule parameter.

The empty string schedule = '' doesn't demonstrate the expected format. Appwrite backup policies require cron expressions (5 space-separated fields: minute hour day month weekday).

💡 Suggested improvement

Use a realistic cron expression such as:

-    schedule = '',
+    schedule = '0 0 * * *',  # daily at midnight

Other examples: '*/15 * * * *' (every 15 minutes), '0 * * * *' (hourly), '0 0 * * 1' (every Monday at midnight).

docs/examples/databases/update-documents.md (1)

14-20: Good improvement with populated example data.

The switch from an empty dictionary to a realistic payload makes the example more helpful.

However, note that the age field is set to 33 here, while in docs/examples/databases/upsert-document.md it's set to 30 for the same user. Consider standardizing the age value across all examples featuring walter.obrien for consistency.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd6ff57 and f618b12.

📒 Files selected for processing (48)
  • CHANGELOG.md
  • LICENSE
  • README.md
  • appwrite/client.py
  • appwrite/encoders/value_class_encoder.py
  • appwrite/enums/build_runtime.py
  • appwrite/enums/name.py
  • appwrite/enums/o_auth_provider.py
  • appwrite/enums/output.py
  • appwrite/enums/runtime.py
  • appwrite/operator.py
  • appwrite/query.py
  • appwrite/service.py
  • appwrite/services/account.py
  • appwrite/services/avatars.py
  • appwrite/services/backups.py
  • appwrite/services/databases.py
  • appwrite/services/health.py
  • appwrite/services/organizations.py
  • appwrite/services/storage.py
  • docs/examples/account/create-jwt.md
  • docs/examples/avatars/get-screenshot.md
  • docs/examples/backups/create-archive.md
  • docs/examples/backups/create-policy.md
  • docs/examples/backups/create-restoration.md
  • docs/examples/backups/delete-archive.md
  • docs/examples/backups/delete-policy.md
  • docs/examples/backups/get-archive.md
  • docs/examples/backups/get-policy.md
  • docs/examples/backups/get-restoration.md
  • docs/examples/backups/list-archives.md
  • docs/examples/backups/list-policies.md
  • docs/examples/backups/list-restorations.md
  • docs/examples/backups/update-policy.md
  • docs/examples/databases/update-document.md
  • docs/examples/databases/update-documents.md
  • docs/examples/databases/upsert-document.md
  • docs/examples/health/get-queue-billing-project-aggregation.md
  • docs/examples/health/get-queue-billing-team-aggregation.md
  • docs/examples/health/get-queue-priority-builds.md
  • docs/examples/health/get-queue-region-manager.md
  • docs/examples/health/get-queue-threats.md
  • docs/examples/organizations/delete.md
  • docs/examples/organizations/estimation-delete-organization.md
  • docs/examples/tablesdb/update-row.md
  • docs/examples/tablesdb/update-rows.md
  • docs/examples/tablesdb/upsert-row.md
  • setup.py
💤 Files with no reviewable changes (6)
  • appwrite/enums/runtime.py
  • appwrite/enums/build_runtime.py
  • appwrite/enums/output.py
  • appwrite/service.py
  • appwrite/operator.py
  • appwrite/query.py
🧰 Additional context used
🧬 Code graph analysis (5)
appwrite/services/organizations.py (5)
appwrite/service.py (1)
  • Service (3-5)
appwrite/exception.py (1)
  • AppwriteException (1-7)
appwrite/utils/deprecated.py (1)
  • deprecated (11-51)
appwrite/services/databases.py (1)
  • delete (378-410)
appwrite/client.py (1)
  • call (75-141)
appwrite/services/avatars.py (2)
appwrite/enums/image_format.py (1)
  • ImageFormat (3-10)
appwrite/enums/theme.py (1)
  • Theme (3-5)
appwrite/services/health.py (1)
appwrite/client.py (1)
  • call (75-141)
appwrite/services/account.py (1)
appwrite/services/users.py (1)
  • create_jwt (655-693)
appwrite/encoders/value_class_encoder.py (1)
appwrite/enums/image_format.py (1)
  • ImageFormat (3-10)
🪛 LanguageTool
README.md

[style] ~11-~11: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help ...

(EN_WEAK_ADJECTIVE)


[grammar] ~11-~11: Use a hyphen to join words.
Context: ...e development tasks behind a very simple to use REST API. Appwrite aims to help y...

(QB_NEW_EN_HYPHEN)


[grammar] ~11-~11: Use a hyphen to join words.
Context: ...evelopment tasks behind a very simple to use REST API. Appwrite aims to help you ...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
docs/examples/tablesdb/update-rows.md

19-19: Bare URL used

(MD034, no-bare-urls)

docs/examples/tablesdb/upsert-row.md

19-19: Bare URL used

(MD034, no-bare-urls)

🪛 Ruff (0.14.11)
appwrite/services/organizations.py

34-34: Avoid specifying long messages outside the exception class

(TRY003)


66-66: Avoid specifying long messages outside the exception class

(TRY003)

appwrite/services/avatars.py

10-10: Statement ends with an unnecessary semicolon

Remove unnecessary semicolon

(E703)

appwrite/services/backups.py

65-65: Avoid specifying long messages outside the exception class

(TRY003)


98-98: Avoid specifying long messages outside the exception class

(TRY003)


129-129: Avoid specifying long messages outside the exception class

(TRY003)


202-202: Avoid specifying long messages outside the exception class

(TRY003)


205-205: Avoid specifying long messages outside the exception class

(TRY003)


208-208: Avoid specifying long messages outside the exception class

(TRY003)


211-211: Avoid specifying long messages outside the exception class

(TRY003)


251-251: Avoid specifying long messages outside the exception class

(TRY003)


290-290: Avoid specifying long messages outside the exception class

(TRY003)


327-327: Avoid specifying long messages outside the exception class

(TRY003)


365-365: Avoid specifying long messages outside the exception class

(TRY003)


368-368: Avoid specifying long messages outside the exception class

(TRY003)


434-434: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (46)
appwrite/enums/name.py (1)

14-14: LGTM!

The new V1_SCREENSHOTS enum member follows the established naming conventions and is consistent with the existing members in the Name enum.

appwrite/services/health.py (5)

146-173: LGTM!

The get_queue_billing_project_aggregation method follows the established pattern used by other queue methods in this service. The implementation correctly:

  • Defines the API path
  • Conditionally adds the optional threshold parameter
  • Returns the result of client.call()

175-202: LGTM!

The get_queue_billing_team_aggregation method is consistent with the billing project aggregation method and follows the same pattern.


233-260: LGTM!

The get_queue_priority_builds method correctly maps to the /health/queue/builds-priority endpoint. The documented default threshold of 500 differs from other endpoints (5000), which is appropriately documented in the docstring.


534-561: LGTM!

The get_queue_region_manager method follows the established pattern. The lower default threshold (100) is correctly documented in the docstring.


621-648: LGTM!

The get_queue_threats method is implemented correctly with the same pattern as other queue methods. The default threshold of 100 is appropriately documented.

docs/examples/health/get-queue-priority-builds.md (1)

1-13: LGTM!

The example correctly demonstrates how to use the new get_queue_priority_builds method with the optional threshold parameter. The pattern is consistent with other SDK documentation examples.

docs/examples/health/get-queue-threats.md (1)

1-13: LGTM!

The example correctly demonstrates how to use the new get_queue_threats method with the optional threshold parameter.

docs/examples/health/get-queue-region-manager.md (1)

1-13: LGTM!

The example correctly demonstrates how to use the new get_queue_region_manager method with the optional threshold parameter.

docs/examples/health/get-queue-billing-team-aggregation.md (1)

1-13: LGTM!

The example correctly demonstrates how to use the new get_queue_billing_team_aggregation method with the optional threshold parameter. The pattern is consistent with the other health queue endpoint examples.

docs/examples/health/get-queue-billing-project-aggregation.md (1)

11-13: [Unable to complete verification due to repository access failure. Manual verification required to assess pattern consistency across other Health method documentation examples.]

LICENSE (1)

1-1: LGTM!

Copyright year updated to 2026, which is appropriate for the current year.

docs/examples/backups/delete-archive.md (1)

1-13: LGTM!

Clear and well-structured documentation example for the new Backups service. The pattern is consistent with other SDK examples.

appwrite/client.py (1)

18-22: LGTM!

Version headers consistently updated to 14.1.1, aligning with the SDK release.

appwrite/services/storage.py (1)

69-77: LGTM!

Documentation updates correctly reflect the increased maximum file size (5GB) and updated compression algorithm descriptions.

appwrite/encoders/value_class_encoder.py (2)

10-10: LGTM!

Import correctly updated from Output to ImageFormat, aligning with the SDK-wide transition to the new enum.


66-67: LGTM!

Serialization handler correctly updated to check for ImageFormat instances.

docs/examples/tablesdb/update-rows.md (1)

14-20: LGTM!

The populated data payload provides a clearer, more practical example for users compared to an empty object. The field types (string, integer, boolean) effectively demonstrate the variety of data that can be updated.

docs/examples/backups/list-restorations.md (1)

1-13: LGTM!

The example follows the established SDK documentation pattern and correctly demonstrates the new Backups service usage for listing restorations.

docs/examples/databases/update-document.md (1)

17-23: LGTM!

The populated data payload is consistent with the other documentation examples updated in this PR, providing users with a realistic example of document updates.

appwrite/services/databases.py (1)

2773-2827: data parameter correctly made optional in upsert_document.

The change to make data optional aligns with the update_document method pattern and the server API specification. The conditional if data is not None check properly handles the optional parameter, and the implementation is consistent with how other update methods in the service handle optional data fields.

appwrite/enums/o_auth_provider.py (1)

44-46: LGTM!

The new OAuth provider enum members follow the established naming conventions in this file. The value strings use camelCase consistent with existing multi-word providers like paypalSandbox and tradeshiftBox. The githubImagine and googleImagine providers are documented in the Account service as supported providers, and MOCK_UNVERIFIED follows the pattern of the existing MOCK provider for testing purposes.

README.md (2)

4-4: LGTM!

Version badge correctly updated to 1.8.1, aligning with the SDK version bump.


11-11: LGTM!

Grammar improvements correctly applied ("abstracts and simplifies").

appwrite/services/avatars.py (1)

320-320: LGTM!

The output parameter type correctly updated from Output to ImageFormat, which is more descriptive for image format options. The docstring is properly aligned with the type hint.

Also applies to: 368-368

docs/examples/avatars/get-screenshot.md (1)

5-5: LGTM!

Documentation example correctly updated to use ImageFormat instead of Output, consistent with the API changes in avatars.py.

Also applies to: 37-37

appwrite/services/account.py (1)

188-216: LGTM!

The create_jwt method correctly implements the optional duration parameter, consistent with the pattern used in users.py (lines 654-692). The docstring properly documents the default (900s) and maximum (3600s) values.

setup.py (1)

11-21: LGTM!

Version bump to 14.1.1 is consistent across version and download_url. The grammar fix in the description ("abstracts and simplifies") is also correct.

CHANGELOG.md (1)

3-5: LGTM!

The changelog entry follows the established format and maintains reverse chronological order. The entry is consistent with the PR description.

appwrite/services/organizations.py (2)

31-41: LGTM!

The method implementation follows the established pattern used by other service methods in the SDK (e.g., databases.delete). Path construction, parameter validation, and API call are correct.


43-45: Verify: PATCH method for a "get estimation" operation.

The docstring describes this as getting an estimation, but the implementation uses PATCH (typically for partial updates). If this matches the server API specification, it's fine. Otherwise, consider if GET would be more appropriate for a read-only estimation operation.

Also applies to: 71-73

docs/examples/organizations/estimation-delete-organization.md (1)

1-13: LGTM!

The documentation example correctly demonstrates how to use the new estimation_delete_organization method, following the established pattern for SDK examples.

docs/examples/organizations/delete.md (1)

1-13: LGTM!

The documentation example correctly demonstrates how to use the new delete method on the Organizations service, following the established pattern for SDK examples.

appwrite/services/backups.py (3)

11-38: LGTM!

The list_archives method correctly handles the optional queries parameter and follows consistent SDK patterns.


75-165: LGTM!

The get_archive, delete_archive, and list_policies methods correctly validate required parameters and handle optional parameters consistently.


304-439: LGTM!

The delete_policy, create_restoration, list_restorations, and get_restoration methods correctly validate required parameters and handle optional parameters consistently.

docs/examples/backups/get-archive.md (1)

1-13: LGTM!

The example clearly demonstrates how to retrieve a backup archive using the SDK.

docs/examples/backups/get-policy.md (1)

1-13: LGTM!

The example clearly demonstrates how to retrieve a backup policy using the SDK.

docs/examples/backups/get-restoration.md (1)

1-13: LGTM!

The example clearly demonstrates how to retrieve a restoration status using the SDK.

docs/examples/backups/list-policies.md (1)

1-13: LGTM!

The example follows the standard documentation pattern and correctly demonstrates the list_policies method usage with an optional queries parameter.

docs/examples/backups/list-archives.md (1)

1-13: LGTM!

The example is consistent with other Backups documentation and correctly demonstrates the list_archives method usage.

docs/examples/backups/delete-policy.md (1)

1-13: LGTM!

The example is clear and demonstrates the delete_policy method correctly with the required policy_id parameter.

docs/examples/backups/create-restoration.md (1)

1-16: LGTM! Clear example for the new Backups service.

The example correctly demonstrates the create_restoration method with required and optional parameters, following the established documentation pattern.

docs/examples/tablesdb/update-row.md (1)

17-23: LGTM! Populated payload improves example clarity.

The realistic data payload is more instructive than an empty dictionary. Note that this example uses age: 33, which should ideally align with the age value used in other walter.obrien examples (see upsert-document.md which uses age: 30).

docs/examples/databases/upsert-document.md (1)

17-23: Good example enhancement with populated data.

The realistic payload is much more useful for developers than an empty object. Minor note: the age value is 30 here but 33 in related examples (update-documents.md, update-row.md, upsert-row.md). While this doesn't affect functionality, consistency across examples would be ideal.

docs/examples/tablesdb/upsert-row.md (1)

17-23: LGTM! Realistic example payload.

The populated data dictionary provides a clearer example for developers. Minor consistency note: the age is 33 here and in other update examples, but 30 in upsert-document.md. Consider aligning for uniformity across the walter.obrien examples.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

----------
provider : OAuthProvider
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for usage of these OAuth provider names in the codebase
rg -n "githubImagine|googleImagine" --type py

Repository: appwrite/sdk-for-python

Length of output: 681


🏁 Script executed:

cat -n appwrite/enums/o_auth_provider.py

Repository: appwrite/sdk-for-python

Length of output: 1482


🏁 Script executed:

rg -i "imagine" -n --type py --type md -A 2

Repository: appwrite/sdk-for-python

Length of output: 1120


🏁 Script executed:

fd -type f -name "*.md" -o -name "*.txt" | head -20

Repository: appwrite/sdk-for-python

Length of output: 237


🏁 Script executed:

rg -i "oauth.*provider" --type md -A 3 | head -50

Repository: appwrite/sdk-for-python

Length of output: 746


🏁 Script executed:

find . -name "README*" -o -name "CHANGELOG*" | head -10

Repository: appwrite/sdk-for-python

Length of output: 93


🏁 Script executed:

rg "githubImagine|googleImagine" -i

Repository: appwrite/sdk-for-python

Length of output: 670


🏁 Script executed:

grep -n "Imagine" ./CHANGELOG.md | head -20

Repository: appwrite/sdk-for-python

Length of output: 49


Add documentation clarifying the purpose of "githubImagine" and "googleImagine" providers, or remove them if they are test-only.

These OAuth providers are formally defined in the enum but lack any documentation or context explaining their purpose. They appear alongside MOCK and MOCK_UNVERIFIED test providers, suggesting they may be development/testing only. Clarify in documentation whether these are intentional production providers or test providers that should be removed.

🤖 Prompt for AI Agents
In `@appwrite/services/account.py` at line 1231, The enum listing OAuth2 providers
includes "githubImagine" and "googleImagine" with no documentation—determine
whether these are production providers or test-only artifacts and either (A) add
a clear doc comment above the enum (or next to the specific values) explaining
their purpose and intended usage (e.g., "test-only/mock providers used for
internal integration testing; not for production"), or (B) remove the
"githubImagine" and "googleImagine" entries from the enum if they are only test
artifacts; if you remove them, also update any tests, fixtures, or reference
code that expect those values (search for "githubImagine" and "googleImagine"
across the repo and update docs/tests accordingly) and ensure the enum docstring
reflects the final set of supported providers.

Comment on lines +15 to +18
Parameters
----------
organization_id : str
Team ID.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Docstring parameter description is inconsistent.

The docstring describes the parameter as "Team ID" but the parameter name is organization_id. This should say "Organization ID" for consistency and clarity.

📝 Suggested fix
         Parameters
         ----------
         organization_id : str
-            Team ID.
+            Organization ID.
🤖 Prompt for AI Agents
In `@appwrite/services/organizations.py` around lines 15 - 18, The docstring for
the parameter organization_id is inconsistent (it says "Team ID"); update the
parameter description in the docstring to read "Organization ID" so it matches
the parameter name organization_id and improves clarity (locate the docstring in
appwrite.services.organizations where organization_id is documented and replace
"Team ID" with "Organization ID").

Comment on lines +47 to +50
Parameters
----------
organization_id : str
Team ID.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Docstring parameter description is inconsistent.

Same issue as the delete method - the docstring describes the parameter as "Team ID" but should say "Organization ID".

📝 Suggested fix
         Parameters
         ----------
         organization_id : str
-            Team ID.
+            Organization ID.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Parameters
----------
organization_id : str
Team ID.
Parameters
----------
organization_id : str
Organization ID.
🤖 Prompt for AI Agents
In `@appwrite/services/organizations.py` around lines 47 - 50, Update the
docstring for the function in appwrite/services/organizations.py that declares
the parameter organization_id so the parameter description reads "Organization
ID" instead of "Team ID"; locate the docstring that documents the
organization_id parameter (same place where delete had the mismatch) and replace
the incorrect "Team ID" text with "Organization ID" to keep docs consistent.

Comment on lines +441 to 443
if name is not None:
api_params['name'] = name
api_params['permissions'] = permissions
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's look at the actual code around lines 441-443 in storage.py
cd /root && find . -name "storage.py" -path "*/services/*" | head -5

Repository: appwrite/sdk-for-python

Length of output: 122


🏁 Script executed:

# Get the file and check the context around lines 441-443
cat -n appwrite/services/storage.py | sed -n '430,455p'

Repository: appwrite/sdk-for-python

Length of output: 1171


🏁 Script executed:

# Check for other instances of permissions handling in update operations across the SDK
rg -n "api_params\['permissions'\]" --type=py appwrite/services/

Repository: appwrite/sdk-for-python

Length of output: 1315


🏁 Script executed:

# Look for patterns in databases.py where data is made optional (mentioned in scratchpad)
rg -n "if.*is not None" --type=py appwrite/services/databases.py | head -20

Repository: appwrite/sdk-for-python

Length of output: 798


🏁 Script executed:

# Look at the update_file method signature and full context
cat -n appwrite/services/storage.py | sed -n '410,450p'

Repository: appwrite/sdk-for-python

Length of output: 1674


🏁 Script executed:

# Check the method signature and parameters
rg -n "def update_file" --type=py appwrite/services/storage.py -A 10

Repository: appwrite/sdk-for-python

Length of output: 542


🏁 Script executed:

# Compare with create_file to see if permissions handling differs
rg -n "def create_file" --type=py appwrite/services/storage.py -A 10

Repository: appwrite/sdk-for-python

Length of output: 1247


🏁 Script executed:

# Check other create/update methods in storage.py to understand the pattern
rg -n "def (create|update)_" --type=py appwrite/services/storage.py | head -10

Repository: appwrite/sdk-for-python

Length of output: 1244


🏁 Script executed:

# Let's see the actual parameter list for update_file
cat -n appwrite/services/storage.py | sed -n '408,445p'

Repository: appwrite/sdk-for-python

Length of output: 1532


Apply conditional inclusion to permissions to match documented behavior.

The name parameter is now conditionally included (only when not None), but permissions on line 443 is always included, even when None. The docstring states "By default, the current permissions are inherited," which suggests that when permissions is not provided (None), existing permissions should be preserved. Sending permissions=None may override this behavior.

Apply the same conditional pattern to permissions:

♻️ Suggested fix
         if name is not None:
             api_params['name'] = name
-        api_params['permissions'] = permissions
+        if permissions is not None:
+            api_params['permissions'] = permissions
🤖 Prompt for AI Agents
In `@appwrite/services/storage.py` around lines 441 - 443, The permissions value
is always being sent even when None which can override inherited permissions;
change the code that builds api_params to only set api_params['permissions'] =
permissions when permissions is not None (mirroring the existing conditional for
name), i.e., add a conditional check around the permissions assignment so
permissions is only included in api_params when not None.

policy_id = '<POLICY_ID>',
name = '<NAME>', # optional
retention = 1, # optional
schedule = '', # optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cd /root && find . -name "update-policy.md" -type f 2>/dev/null | head -5

Repository: appwrite/sdk-for-python

Length of output: 122


🌐 Web query:

Appwrite backup policy schedule parameter format cron

💡 Result:

Use a standard 5-field cron expression (minute hour day month weekday — e.g. "0 0 * * *" for daily at midnight). Appwrite evaluates cron schedules in UTC. [1][2][3]

Examples:

  • Every minute: "*/1 * * * *".
  • Hourly: "0 * * * *".
  • Daily at 00:00 UTC: "0 0 * * *". [2]

Sources:

  1. Appwrite Backups (backup policies). [1]
  2. Appwrite Functions — Schedule / cron examples. [2]
  3. Appwrite thread confirming cron jobs run in UTC. [3]

🏁 Script executed:

find . -name "update-policy.md" -type f 2>/dev/null

Repository: appwrite/sdk-for-python

Length of output: 107


🏁 Script executed:

git ls-files | grep -i "update-policy.md"

Repository: appwrite/sdk-for-python

Length of output: 105


🏁 Script executed:

cat -n docs/examples/backups/update-policy.md

Repository: appwrite/sdk-for-python

Length of output: 695


Use a realistic cron expression for the schedule parameter.

The empty string schedule = '' does not clearly demonstrate the expected format. Appwrite backup schedules require a 5-field cron expression (evaluated in UTC).

Suggested improvement
-    schedule = '', # optional
+    schedule = '0 0 * * *', # optional (cron format: daily at midnight UTC)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
schedule = '', # optional
schedule = '0 0 * * *', # optional (cron format: daily at midnight UTC)

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