Add Godot platform support and GDScript SDK generator#1527
Add Godot platform support and GDScript SDK generator#1527NIKHIL0VERMA wants to merge 54 commits into
Conversation
Greptile SummaryThis PR introduces two new SDK generation targets — Godot (client, with browser OAuth via a local TCP server and cookie-based session persistence) and GDScript (server, headless redirect-based OAuth) — along with Twig templates, PHP language classes, CI jobs, and integration tests. A large number of issues flagged in the prior review round appear to have been addressed: the
Confidence Score: 4/5The PR can be merged once the The GDScript client misclassifies a transport-level failure (e.g., connection refused) as a server HTTP 400 instead of a network error, making it impossible for callers to distinguish between the two. This is the only blocking defect found; the many issues from the prior review round appear to have been addressed.
Important Files Changed
Reviews (21): Last reviewed commit: "refract: statusCode set to 0 for network..." | Re-trigger Greptile |
Initial implementation of Godot support: - template-based generation for services and client - preliminary docs example template - mirrors structure of existing SDKs (services/, enums/, models/) - not fully functional yet (runtime + DX pending)
- Refactored Godot SDK output directory structure to follow the addons/appwrite convention for plugins. - Migrated call_api in client.gd from an HTTPClient polling loop to a native, async HTTPRequest node architecture. - Added appwrite.gd plugin singleton and updated plugin.cfg / plugin.gd generation logic. - Implemented robust error handling by parsing HTTP responses into typed AppwriteExceptions. - Fixed docs/example.md.twig template for correct GDScript method invocation and autoload reference. - Enhanced global state management by defaulting endpoint and project settings directly from ProjectSettings overrides.
- corrected type resolution for models, enums, arrays of models, and arrays of enums - added .env support for loading client configuration - reduced global namespace pollution by removing class_name from enums - improved enum system to support string-based values (Appwrite-compatible vs Godot int enums) - refactored models to use FIELD_MAP for better readability and mapping - added proper import handling for enums and nested models - updated plugin to load only when enabled (not immediately after installation) - centralized network calls and exception handling for better debugging - removed deprecated and duplicate methods from generated services - updated services to use centralized network caller
- Fix enum handling to use String-based representation instead of invalid typed enums(Godot internal use int representation) - Resolve incorrect default value mapping for integer parameters (e.g. [] assigned to int in storage) - Improve parameter type inference in codegen for arrays, enums, and primitives - Fix Godot HTTPRequest lifecycle issue caused by calling request before node enters scene tree - Replace deferred node attachment pattern with proper add_child timing - Improve robustness of generated GDScript service methods and parameter defaults
- refactor Appwrite singleton to delegate all config to client - centralize environment variable handling with _apply_env() - add dynamic header setters using spec.global.headers - support additional env configs (JWT, session, locale, mode, self-signed) - enforce single client instance via autoload (singleton pattern) - cleared Appwrite singleton namespace by removing raw classes
Changed typed return values to Variant so errors can be returned to the SDK user instead of causing runtime failures in services.
- Generate inline documentation for all service methods - Add parameter description using [param] annotation - Include return type details helping in better type casting - Automatically annotate deprecated APIs with @deprecated - Format docs using Godot BBCode for editor integration
- Add explicit typing for services to enable autocomplete and navigation - Replace inline preload().new() with typed constants and instances - Introduce class_name to enable doc indexing - Fix missing method hints for chained calls (e.g., Appwrite.account.*) - Add description for services and examples - Exposed Enums through Appwrite autoload - Ensure documentation appears in editor tooltips along with method hints - Added Appwrite icon to Godot generated docs
…ethods - Updated service templates to use 'Variant = null' for all optional parameters. - Added runtime type validation to ensure passed values match the intended types. - Included explicit type hints in documentation comments using [Type] notation.
- route ping() through service error handling - return AppwriteException consistently on failures - avoid malformed multipart CRLF for empty arrays - clean up remaining GDScript generator issues
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
What does this PR do?
This PR adds support for the Godot game engine and introduces GDScript as a new SDK generation target.
The generated SDK is designed for Godot 4.x projects and enables direct integration with Appwrite services using GDScript
Godot-specific implementation details
Appwrite.account.get()conflicts with a built-in GDScript methodAppwrite.account.xget()The generated SDK is designed for Godot 4.x projects and enables direct integration with Appwrite services using GDScript.
Test Plan
The Godot SDK generates with sample project which can be opened directly inside the Godot Engine for integration testing.
The generated project also includes test files compatible with the GUT testing framework. Tests can be executed after installing GUT from the Godot Asset Library. If GUT is not installed, parsing error of test files can be ignored safely.
Automated validation
Added CI and automated SDK validation for generated Godot and GDScript targets.
Personally tested on:
6.5.0-45-generic4.6.2.stable.official.71f334935Verified:
Have you read the Contributing Guidelines on issues?
yes