Skip to content

feat(sdk/rust): wire the feedback module into the client#33

Merged
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:feat/rust-wire-feedback
Jun 16, 2026
Merged

feat(sdk/rust): wire the feedback module into the client#33
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:feat/rust-wire-feedback

Conversation

@graycyrus

@graycyrus graycyrus commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

sdk/rust/src/api/feedback.rs and sdk/rust/src/types/feedback.rs already existed, but the module was never declared or exposed — there was no pub mod feedback; in api/mod.rs and no feedback field on TinyPlaceClient, so FeedbackApi was completely unreachable.

This wires it in:

  • pub mod feedback; in sdk/rust/src/api/mod.rs
  • pub feedback: FeedbackApi field + initializer on TinyPlaceClient (client.rs), matching every other namespace
  • wiremock tests in tests/api_misc.rs covering all six methods: list, list_admin, get, create, vote, update_status

Validation (from sdk/rust/)

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test ✅ (6 new feedback tests pass; full suite green)

⚠️ Stacked on #32

This branch is based on #32 (the compile fix), since the crate does not build on main without 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

  • New Features
    • Feedback API introduced to the Rust SDK client. The new feedback module provides comprehensive feedback management capabilities, allowing developers to list existing feedback items, create new feedback, vote on feedback entries, and update feedback status. The feedback API is fully integrated into the client with a dedicated namespace for easy access.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@graycyrus is attempting to deploy a commit to the Vezures Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61446234-f653-4dd2-a8b9-4665aa3ebaca

📥 Commits

Reviewing files that changed from the base of the PR and between d162d2c and a2c2931.

📒 Files selected for processing (4)
  • sdk/rust/src/api/feedback.rs
  • sdk/rust/src/api/mod.rs
  • sdk/rust/src/client.rs
  • sdk/rust/tests/api_misc.rs
✅ Files skipped from review due to trivial changes (1)
  • sdk/rust/src/api/feedback.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • sdk/rust/src/api/mod.rs
  • sdk/rust/tests/api_misc.rs

📝 Walkthrough

Walkthrough

The Rust SDK gains the previously missing feedback API module. pub mod feedback is added to the API module index, FeedbackApi is imported and wired as a public field on TinyPlaceClient, and the vote method signature is reformatted. Six integration tests covering all FeedbackApi endpoints are added.

Changes

FeedbackApi module addition

Layer / File(s) Summary
FeedbackApi module declaration and client wiring
sdk/rust/src/api/mod.rs, sdk/rust/src/client.rs, sdk/rust/src/api/feedback.rs
Adds pub mod feedback to the API module index, imports FeedbackApi into the client, adds a pub feedback: FeedbackApi field to TinyPlaceClient, constructs the instance in TinyPlaceClient::new, and reformats the vote method to a single-line signature.
FeedbackApi integration tests
sdk/rust/tests/api_misc.rs
Extends the tinyplace::types import block with feedback-specific types and adds six #[tokio::test] cases asserting the HTTP method and URL path for list, list_admin, get, create, vote, and update_status against a mock server.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐇 A hop through the modules, a field newly grown,
feedback now lives where it once was unknown.
Six tests stand guard on the /feedback trail,
Each method confirmed — not a single one stale.
The vote line collapsed, neat and trim in one row,
This bunny approves of the elegant flow! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(sdk/rust): wire the feedback module into the client' accurately and concisely summarizes the main change—exposing the feedback API module through the Rust SDK client.
Linked Issues check ✅ Passed The pull request successfully implements all coding requirements from issue #15: adds feedback module exposure in api/mod.rs, wires FeedbackApi into TinyPlaceClient with a public field, and includes comprehensive integration tests for all six feedback API methods.
Out of Scope Changes check ✅ Passed All changes are directly related to wiring the feedback module into the Rust SDK client as specified in issue #15; no unrelated or out-of-scope modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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

@graycyrus
graycyrus force-pushed the feat/rust-wire-feedback branch from 6f7b638 to d162d2c Compare June 16, 2026 09:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
sdk/rust/tests/api_misc.rs (1)

1042-1050: ⚡ Quick win

Assert admin-auth behavior in feedback_list_admin test.

This test currently validates only method/path, so it would still pass if list_admin accidentally used non-admin request plumbing. Add a header/assertion that distinguishes get_admin from get (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

📥 Commits

Reviewing files that changed from the base of the PR and between ac7981e and d162d2c.

📒 Files selected for processing (5)
  • sdk/rust/src/api/feedback.rs
  • sdk/rust/src/api/mod.rs
  • sdk/rust/src/api/users.rs
  • sdk/rust/src/client.rs
  • sdk/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>
@graycyrus
graycyrus force-pushed the feat/rust-wire-feedback branch from d162d2c to a2c2931 Compare June 16, 2026 10:57
@graycyrus
graycyrus merged commit 0bc16a7 into tinyhumansai:main Jun 16, 2026
7 of 8 checks passed
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.

[Rust SDK] Port the missing feedback API module

1 participant