Neutralize metaboards (~5s per request saved)#86
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces top-level Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/raindex/config.rs (1)
19-42: Consider using a YAML parser for robustness.The line-based rewrite works for the current registry format but is fragile: it assumes
metaboards:only ever appears as a top-level key and that child entries are indented (no blank lines, no flow-style spanning multiple lines, no comments at column 0 inside the block). Aserde_yaml/serde_ymlround-trip that removes themetaboardsmapping and inserts{_disabled: https://localhost}would be less brittle and easier to reason about. Not a blocker given the registry format is controlled, but worth considering if registry YAML ever becomes more flexible.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/raindex/config.rs` around lines 19 - 42, The current neutralize_metaboards function does fragile line-based editing; replace it with a YAML parse/modify/serialize approach using serde_yaml: in neutralize_metaboards parse the input into a serde_yaml::Value (or Mapping), remove or replace the top-level "metaboards" entry, insert a mapping value {"_disabled": "https://localhost"} under that key, then serialize the Value back to a String and return it; use serde_yaml::from_str and serde_yaml::to_string and handle parse/serialize errors appropriately within neutralize_metaboards.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/raindex/config.rs`:
- Around line 19-42: The current neutralize_metaboards function does fragile
line-based editing; replace it with a YAML parse/modify/serialize approach using
serde_yaml: in neutralize_metaboards parse the input into a serde_yaml::Value
(or Mapping), remove or replace the top-level "metaboards" entry, insert a
mapping value {"_disabled": "https://localhost"} under that key, then serialize
the Value back to a String and return it; use serde_yaml::from_str and
serde_yaml::to_string and handle parse/serialize errors appropriately within
neutralize_metaboards.
|
Re: the serde_yaml suggestion for
If the registry format becomes more complex in the future, we can revisit. Good callout though. |
bb039b7 to
503a210
Compare
How to use the Graphite Merge QueueAdd the label add-to-gt-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
503a210 to
fb31e7b
Compare
bb989eb to
5951bd2
Compare
fb31e7b to
56061d9
Compare
findolor
left a comment
There was a problem hiding this comment.
I don't think we should have a logic where we omit some of the fields we have in settings yaml. If we don't need the fields we should not add the fields in the first place if it's possible.
That said I don't think this PR should be merged. We should update the registry with a settings yaml that does not have the metaboard fields. @alastairong1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56061d9 to
b63a8ef
Compare

Summary
neutralize_metaboards()to replace Goldsky metaboard subgraph URLs with a localhost stubfetch_orders_dotrain_sources()calls each order's metaboard (~5s for 20 orders) — our API never usesDotrainSourceV1, so this is pure wasteload()to useRaindexClient::new(vec![neutralized_settings], None, db)instead ofregistry.get_raindex_client()Test plan
cargo checkpassescargo testpasses (3 new tests for neutralize_metaboards)/v1/orders/token/{addr}before/after — expect ~5s improvement🤖 Generated with Claude Code
Summary by CodeRabbit
Changes
Tests