feat(sdk/rust): wire the feedback module into the client#33
Conversation
|
@graycyrus is attempting to deploy a commit to the Vezures Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe Rust SDK gains the previously missing ChangesFeedbackApi module addition
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
6f7b638 to
d162d2c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
sdk/rust/tests/api_misc.rs (1)
1042-1050: ⚡ Quick winAssert admin-auth behavior in
feedback_list_admintest.This test currently validates only method/path, so it would still pass if
list_adminaccidentally used non-admin request plumbing. Add a header/assertion that distinguishesget_adminfromget(e.g., admin signature/header presence).Suggested test hardening
#[tokio::test] async fn feedback_list_admin() { let server = any_ok(json!({"feedback": []})).await; let client = client_for(&server); let _ = client.feedback.list_admin(None).await; let req = only_request(&server).await; assert_eq!(req.method.as_str(), "GET"); assert!(req.url.path().contains("/feedback")); + assert!( + req.headers.get("TinyPlace-Admin").is_some(), + "expected admin-auth header for list_admin" + ); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdk/rust/tests/api_misc.rs` around lines 1042 - 1050, The test `feedback_list_admin` currently only verifies the HTTP method and URL path, which does not sufficiently ensure that admin authentication was actually applied. After capturing the request with `only_request(&server)`, add an assertion to verify the presence of an admin-specific header or authentication signature (such as an Authorization header, admin token, or other admin-distinguishing header) in the request. This ensures that the `list_admin` method properly uses admin request plumbing rather than accidentally using non-admin request handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@sdk/rust/tests/api_misc.rs`:
- Around line 1042-1050: The test `feedback_list_admin` currently only verifies
the HTTP method and URL path, which does not sufficiently ensure that admin
authentication was actually applied. After capturing the request with
`only_request(&server)`, add an assertion to verify the presence of an
admin-specific header or authentication signature (such as an Authorization
header, admin token, or other admin-distinguishing header) in the request. This
ensures that the `list_admin` method properly uses admin request plumbing rather
than accidentally using non-admin request handling.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 40a67ce0-b446-4e5d-b2e8-3b220b125d6b
📒 Files selected for processing (5)
sdk/rust/src/api/feedback.rssdk/rust/src/api/mod.rssdk/rust/src/api/users.rssdk/rust/src/client.rssdk/rust/tests/api_misc.rs
`api/feedback.rs` and its `types/feedback.rs` already existed but the module was never declared or exposed, so `FeedbackApi` was unreachable. Declare `pub mod feedback;` in `api/mod.rs` and add the `feedback: FeedbackApi` field + initializer on `TinyPlaceClient`, matching every other namespace. Add wiremock coverage for all six methods (list, list_admin, get, create, vote, update_status) in `tests/api_misc.rs`. Closes #15 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d162d2c to
a2c2931
Compare
What
sdk/rust/src/api/feedback.rsandsdk/rust/src/types/feedback.rsalready existed, but the module was never declared or exposed — there was nopub mod feedback;inapi/mod.rsand nofeedbackfield onTinyPlaceClient, soFeedbackApiwas completely unreachable.This wires it in:
pub mod feedback;insdk/rust/src/api/mod.rspub feedback: FeedbackApifield + initializer onTinyPlaceClient(client.rs), matching every other namespacetests/api_misc.rscovering all six methods:list,list_admin,get,create,vote,update_statusValidation (from
sdk/rust/)cargo fmt --check✅cargo clippy --all-targets -- -D warnings✅cargo test✅ (6 new feedback tests pass; full suite green)This branch is based on #32 (the compile fix), since the crate does not build on
mainwithout it. The first commit here is that fix; merge #32 first and this PR will reduce to just the feedback-wiring commit on rebase.Closes #15
🤖 Generated with Claude Code
Summary by CodeRabbit