Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds fluent builder methods ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
docs/how-to/use-functions-and-triggers.mdx (2)
249-258:⚠️ Potential issue | 🟡 MinorAlign these result examples with the earlier
math::addpayload.The first
math::addexample in this page returns{ id, result }, but these later Rust snippets still imply the response is only{ "result": ... }. Please make the output comments/examples match the actual payload shape users will get back.Also applies to: 669-679
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/how-to/use-functions-and-triggers.mdx` around lines 249 - 258, The example response comments for the Rust trigger examples are inconsistent with the earlier math::add payload shape — update the inline output comments and any printed example values in the math::calculate and related snippets (look for iii.register_function, math::calculate, iii.trigger, TriggerRequest and function_id "math::add") to show the full payload shape { "id": <id>, "result": 5 } (or the exact id field used earlier) instead of just { "result": 5 }; also apply the same correction to the other occurrences noted around the later snippet range (the second block referenced at lines ~669-679) so all examples show the { id, result } structure consistently.
165-187:⚠️ Potential issue | 🟠 MajorImport
serde_json::jsonin thehttp_invoked.rssnippet.Line 187 uses the
json!macro but the imports do not includeserde_json::json, preventing the example from compiling.🔧 Proposed fix
use iii_sdk::{register_worker, InitOptions, HttpAuthConfig, HttpInvocationConfig, HttpMethod, RegisterFunctionMessage, TriggerRequest}; +use serde_json::json; use std::collections::HashMap;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/how-to/use-functions-and-triggers.mdx` around lines 165 - 187, The example uses the json! macro but doesn't import it; add the serde_json::json import to the top imports in the http_invoked.rs snippet so the macro is available (update the import list alongside iii_sdk::{...}); ensure the TriggerRequest call that uses json!({ ... }) compiles after adding serde_json::json.docs/how-to/expose-http-endpoint.mdx (1)
82-89:⚠️ Potential issue | 🟠 MajorRemove the
?fromregister_worker(...)on line 85.The function signature returns
IIIdirectly, not aResult. All API reference examples and the SDK docstring useregister_worker(...)without the?operator. This code will not compile as written.🔧 Proposed fix
- let iii = register_worker(&url, InitOptions::default())?; + let iii = register_worker(&url, InitOptions::default());🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/how-to/expose-http-endpoint.mdx` around lines 82 - 89, The call to register_worker(...) is incorrectly treated as returning a Result; remove the `?` operator so the returned III value is assigned directly (e.g., let iii = register_worker(&url, InitOptions::default());). Update the assignment in main (the async fn main -> Result<(), Box<dyn std::error::Error>>) to use the direct III value from register_worker and ensure any subsequent error handling remains correct for functions that do return Results; target the register_worker(...) call site and the let iii binding when making this change.docs/api-reference/sdk-rust.mdx (1)
77-89:⚠️ Potential issue | 🟡 MinorUpdate the generated API reference to document the
with_idandwith_descriptionbuilder methods.The example at line 84 correctly uses
RegisterFunctionMessage::with_id(), but these public builder methods are not documented in theRegisterFunctionMessagesection below. Since this file is auto-generated, the fix likely requires updating the generator or source annotations so the canonical API reference includes these methods.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-reference/sdk-rust.mdx` around lines 77 - 89, The generated API reference is missing documentation for the public builder methods on RegisterFunctionMessage (specifically RegisterFunctionMessage::with_id and RegisterFunctionMessage::with_description); update the source or generator so these methods are included: add proper Rust doc comments (/// ...) to the with_id and with_description impls on RegisterFunctionMessage (or adjust the doc-generator configuration to include inherent impl methods), then regenerate the API reference so the RegisterFunctionMessage section shows these builder methods and their signatures/remarks consistent with the example using RegisterFunctionMessage::with_id().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@docs/api-reference/sdk-rust.mdx`:
- Around line 77-89: The generated API reference is missing documentation for
the public builder methods on RegisterFunctionMessage (specifically
RegisterFunctionMessage::with_id and RegisterFunctionMessage::with_description);
update the source or generator so these methods are included: add proper Rust
doc comments (/// ...) to the with_id and with_description impls on
RegisterFunctionMessage (or adjust the doc-generator configuration to include
inherent impl methods), then regenerate the API reference so the
RegisterFunctionMessage section shows these builder methods and their
signatures/remarks consistent with the example using
RegisterFunctionMessage::with_id().
In `@docs/how-to/expose-http-endpoint.mdx`:
- Around line 82-89: The call to register_worker(...) is incorrectly treated as
returning a Result; remove the `?` operator so the returned III value is
assigned directly (e.g., let iii = register_worker(&url,
InitOptions::default());). Update the assignment in main (the async fn main ->
Result<(), Box<dyn std::error::Error>>) to use the direct III value from
register_worker and ensure any subsequent error handling remains correct for
functions that do return Results; target the register_worker(...) call site and
the let iii binding when making this change.
In `@docs/how-to/use-functions-and-triggers.mdx`:
- Around line 249-258: The example response comments for the Rust trigger
examples are inconsistent with the earlier math::add payload shape — update the
inline output comments and any printed example values in the math::calculate and
related snippets (look for iii.register_function, math::calculate, iii.trigger,
TriggerRequest and function_id "math::add") to show the full payload shape {
"id": <id>, "result": 5 } (or the exact id field used earlier) instead of just {
"result": 5 }; also apply the same correction to the other occurrences noted
around the later snippet range (the second block referenced at lines ~669-679)
so all examples show the { id, result } structure consistently.
- Around line 165-187: The example uses the json! macro but doesn't import it;
add the serde_json::json import to the top imports in the http_invoked.rs
snippet so the macro is available (update the import list alongside
iii_sdk::{...}); ensure the TriggerRequest call that uses json!({ ... })
compiles after adding serde_json::json.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6c5bca45-f89c-4e52-a80f-67f74e38e7b0
📒 Files selected for processing (39)
README.mddocs/advanced/telemetry.mdxdocs/api-reference/sdk-rust.mdxdocs/architecture/channels.mdxdocs/architecture/trigger-types.mdxdocs/examples/conditions.mdxdocs/examples/cron.mdxdocs/examples/hello-world.mdxdocs/examples/multi-trigger.mdxdocs/examples/observability.mdxdocs/examples/state-management.mdxdocs/examples/todo-app.mdxdocs/how-to/create-custom-trigger-type.mdxdocs/how-to/create-ephemeral-worker.mdxdocs/how-to/dead-letter-queues.mdxdocs/how-to/expose-http-endpoint.mdxdocs/how-to/manage-state.mdxdocs/how-to/react-to-state-changes.mdxdocs/how-to/schedule-cron-task.mdxdocs/how-to/stream-realtime-data.mdxdocs/how-to/use-functions-and-triggers.mdxdocs/how-to/use-queues.mdxdocs/how-to/use-trigger-conditions.mdxdocs/modules/module-cron.mdxdocs/modules/module-pubsub.mdxdocs/modules/module-state.mdxdocs/modules/module-stream.mdxengine/README.mdsdk/README.mdsdk/packages/rust/iii/src/protocol.rssdk/packages/rust/iii/tests/api_triggers.rssdk/packages/rust/iii/tests/bridge.rssdk/packages/rust/iii/tests/data_channels.rssdk/packages/rust/iii/tests/healthcheck.rssdk/packages/rust/iii/tests/http_external_functions.rssdk/packages/rust/iii/tests/init_api.rssdk/packages/rust/iii/tests/pubsub.rssdk/packages/rust/iii/tests/queue_integration.rssdk/packages/rust/iii/tests/state.rs
|
merged this pr into #1332 |
Summary by CodeRabbit
New Features
Documentation