Conversation
76958b4 to
6fe7d9c
Compare
Greptile SummaryThis PR adds a C++ SDK generator targeting C++20, and represents substantial iteration over a previous round of review: the vast majority of the 50+ previously flagged issues have been resolved. The generated
Confidence Score: 3/5The PR has addressed the vast majority of prior issues but carries the known complexity of a brand-new language SDK; one remaining P1 in the model test fixture could break CI. Extensive iteration has resolved 50+ previously flagged bugs. One new P1 remains:
Important Files Changed
Reviews (60): Last reviewed commit: "Clean up base.hpp.twig formatting" | Re-trigger Greptile |
9f55656 to
a07a162
Compare
|
@coderabbitai review |
…r and exception safety
- Updated Dockerfile to pre-install dependencies and build cpr/json/gtest from source - Updated test.sh with CMAKE_PREFIX_PATH to ensure air-gapped dependency discovery - Added GTest find_package check to CMakeLists.txt.twig - Synchronized SDK project name to 'cpp' in example.php - Restored hardened client architecture (mutable config, error extraction, C++20 compliance) - Regenerated examples/cpp output
bead5f0 to
80b900d
Compare
- Guarded Realtime service with APPWRITE_ENABLE_REALTIME feature flag - Implemented robust call-time static_assert stub for disabled Realtime - Moved RealtimeResponse to services.hpp for better visibility - Aligned setEndpoint exception type and integration test reporting - Fixed integration test output flushing to prevent null-match errors
22ba2ca to
a3b8729
Compare
Removed unnecessary blank lines and fixed namespace closing.
| // Deserialization must not throw (skip on type mismatch in example data) | ||
| appwrite::models::{{ definition.name | casePascal }} model; | ||
| try { | ||
| model = appwrite::models::{{ definition.name | casePascal }}::fromJson(seed); | ||
| } catch (const nlohmann::json::exception&) { | ||
| GTEST_SKIP() << "Seed example data type mismatch — skipped"; | ||
| } |
There was a problem hiding this comment.
DeserializationException not caught — GTest failure instead of skip
The catch block only handles nlohmann::json::exception, but fromJson can also throw AppwriteException subclasses (e.g. DeserializationException("Required field '...' is null") for a required field that is present in the JSON but explicitly null). When that exception propagates out of the TEST() body, GTest catches it at the framework level and records a test failure rather than a skip — causing test_appwrite to exit non-zero and fail CI.
Add a second catch arm before the closing brace to cover std::exception (which AppwriteException inherits from):
| // Deserialization must not throw (skip on type mismatch in example data) | |
| appwrite::models::{{ definition.name | casePascal }} model; | |
| try { | |
| model = appwrite::models::{{ definition.name | casePascal }}::fromJson(seed); | |
| } catch (const nlohmann::json::exception&) { | |
| GTEST_SKIP() << "Seed example data type mismatch — skipped"; | |
| } | |
| try { | |
| model = appwrite::models::{{ definition.name | casePascal }}::fromJson(seed); | |
| } catch (const nlohmann::json::exception&) { | |
| GTEST_SKIP() << "Seed example data type mismatch — skipped"; | |
| } catch (const std::exception& e) { | |
| GTEST_SKIP() << "Deserialization error — skipped: " << e.what(); | |
| } |
What does this PR do?
Adds a modern, production-ready C++ SDK generator targeting the C++20 standard.
This implementation focuses on high performance, thread-safety, and a seamless developer
experience through a monolithic header-only architecture and coroutine-compatible async dispatch.
Key Features
include/appwrite/appwrite.hppentry point. No separate compilation units required.ThreadPool, enabling concurrent execution across multiple threads. TheTask<T>type provides a coroutine-compatible interface (co_await/.get()). Note: true non-blocking I/O would require an async runtime (Asio/libuv), which is intentionally out of scope for this SDK.callBytes), and complex JSON serialization.Clientuses a copy-on-write config pattern viashared_ptr<const Config>with mutex protection, making it safe for concurrent use across multiple threads.Production Hardening
InputFile::Progress(C++20 compliant, order-safe).verify()— extracts the namespaced"type"field from error JSON and passes it toServerExceptionfor richer error context.makeResolvedTask— exceptions captured bystd::futureare caught and returned asResult<T>::Errrather than propagating as raw exceptions.[]suffix (e.g.k[]=v1&k[]=v2).Test Plan
x-appwrite-idpropagation.Query,Permission, andIDhelper correctness.test.shexecutes the suite within themockapiDocker network. The build-validation CI step compiles headers without running integration tests, keeping CI fast.Verified output (condensed):