Skip to content

feat(rook): build registry services for account, pool, route, and settings#608

Merged
yacosta738 merged 1 commit into
developfrom
feat/rook-584-registry-services
Apr 20, 2026
Merged

feat(rook): build registry services for account, pool, route, and settings#608
yacosta738 merged 1 commit into
developfrom
feat/rook-584-registry-services

Conversation

@yacosta738
Copy link
Copy Markdown
Contributor

Summary

Implements #584 — registry services for the Rook local-first provider gateway.

What changed

  • SqliteAccountService — CRUD for ProviderAccount wired to the correct db layer methods (insert_account, get_account, delete_account). Update = delete + insert (db layer has no update_* ops).
  • SqlitePoolService — CRUD for ProviderPool including member management (add_pool_member, remove_pool_member). Pool delete and update via raw sqlx::query since the db layer has no delete_pool.
  • SqliteRouteService — CRUD for ModelRoute with model-based lookup (find_route_by_model). Update = delete + insert.
  • SettingsService trait — async trait with InMemorySettingsService and SqliteSettingsService; backed by a single-row upsert pattern.
  • db/settings.rsload_settings / save_settings helpers.
  • migrations/0002_settings.sqlsettings table (single-row enforced via WHERE id = 1).
  • RookRegistry — uses concrete types (not dyn Trait) to stay compatible with RPITIT async traits (Rust 1.75+, no async_trait). Exposes typed accessors for all four services.
  • domain/mod.rs — added RookSettings struct with a sensible Default.

Design decisions

  • No async_trait — RPITIT traits (fn foo(&self) -> impl Future<Output = T> + Send) are not dyn-compatible, so RookRegistry holds concrete Sqlite*Service types. This avoids vtable overhead and the async_trait macro entirely.
  • Update = delete + insert — the existing db layer has no update_* methods; this keeps the service layer honest about what the db actually supports.

Test results

83/84 tests pass. The 1 failure (db::account::tests::vendor_other_with_quotes_round_trips) is a pre-existing bug in quote-escaping for ProviderVendor::Other — unrelated to this PR.

Close #584

…tings

- Add SqliteAccountService, SqlitePoolService, SqliteRouteService wired
  to the correct db layer methods (insert_*, get_*, delete_*); update
  implemented as delete + insert since the db layer has no update_* ops
- Add SettingsService trait with InMemorySettingsService and
  SqliteSettingsService backed by a single-row upsert pattern
- Add db/settings.rs with load_settings / save_settings helpers
- Add migration 0002_settings.sql creating the settings table
- Add RookRegistry using concrete types (not dyn Trait) to stay
  compatible with RPITIT async traits; exposes typed accessors for all
  four services
- Expand domain/mod.rs with RookSettings and a sensible Default

Close #584
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying corvus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9bc818e
Status: ✅  Deploy successful!
Preview URL: https://f5c2db64.corvus-42x.pages.dev
Branch Preview URL: https://feat-rook-584-registry-servi.corvus-42x.pages.dev

View logs

@github-actions
Copy link
Copy Markdown
Contributor

✅ Contributor Report

User: @yacosta738
Status: Passed (12/13 metrics passed)

Metric Description Value Threshold Status
PR Merge Rate PRs merged vs closed 91% >= 30%
Repo Quality Repos with ≥100 stars 0 >= 0
Positive Reactions Positive reactions received 11 >= 1
Negative Reactions Negative reactions received 0 <= 5
Account Age GitHub account age 3096 days >= 30 days
Activity Consistency Regular activity over time 108% >= 0%
Issue Engagement Issues with community engagement 0 >= 0
Code Reviews Code reviews given to others 584 >= 0
Merger Diversity Unique maintainers who merged PRs 2 >= 0
Repo History Merge Rate Merge rate in this repo 93% >= 0%
Repo History Min PRs Previous PRs in this repo 262 >= 0
Profile Completeness Profile richness (bio, followers) 90 >= 0
Suspicious Patterns Spam-like activity detection 1 N/A

Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-04-20 to 2026-04-20

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@yacosta738 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4ad2ac3-7ac1-424d-8dc0-7a74c7e3eb9c

📥 Commits

Reviewing files that changed from the base of the PR and between c6d1b82 and 9bc818e.

📒 Files selected for processing (11)
  • clients/rook/migrations/0002_settings.sql
  • clients/rook/src/db/mod.rs
  • clients/rook/src/db/settings.rs
  • clients/rook/src/domain/mod.rs
  • clients/rook/src/registry/mod.rs
  • clients/rook/src/services/account.rs
  • clients/rook/src/services/health.rs
  • clients/rook/src/services/mod.rs
  • clients/rook/src/services/pool.rs
  • clients/rook/src/services/route.rs
  • clients/rook/src/services/settings.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rook-584-registry-services

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.

❤️ Share

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

@yacosta738 yacosta738 merged commit ec1ee5f into develop Apr 20, 2026
7 checks passed
@yacosta738 yacosta738 deleted the feat/rook-584-registry-services branch April 20, 2026 13:06
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.

1 participant