error-endpoint - #685
error-endpoint#685
Conversation
WalkthroughError messages in DataSource construction were updated to use centralized documentation link constants. A new public constant for the HyperSync config schema link was added to the links module. No behavior or control flow changes; only message content and constants extended. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
c3c64c0 to
37fbbf6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
codegenerator/cli/src/config_parsing/system_config.rs (1)
976-987: Action: Replace the hard-coded docs URL with links::DOC_CONFIGURATION_FILE in system_config.rs (and update the test); consider centralizing other runtime docs links.constants.rs already defines links::DOC_CONFIGURATION_FILE; a repo search found multiple hard-coded docs URLs. At minimum update the two occurrences in system_config.rs and the test; consider centralizing other code occurrences (not template/README content) into constants.rs.
Files needing attention (from search):
- codegenerator/cli/src/config_parsing/system_config.rs:976
- codegenerator/cli/src/config_parsing/system_config.rs:1985 (test assertion)
- codegenerator/cli/src/config_parsing/validation.rs:208 (different docs path — consider adding a constant)
- codegenerator/cli/npm/envio/src/sources/SourceManager.res:262
- many README / template files under codegenerator/cli/templates/** and other docs references (these are content files — decide whether to centralize)
Suggested diffs:
Replace the runtime error message (system_config.rs ~976):
- (Some(_), Some(_)) => Err(anyhow!("EE106: Cannot define both rpc and deprecated rpc_config for the same network, please only use the rpc option. Read more in our docs https://docs.envio.dev/docs/configuration-file"))?, + (Some(_), Some(_)) => Err(anyhow!( + "EE106: Cannot define both rpc and deprecated rpc_config for the same network, please only use the rpc option. Read more in our docs {}", + links::DOC_CONFIGURATION_FILE + ))?,Update the test assertion (system_config.rs ~1985):
- assert_eq!(error.to_string(), "EE106: Cannot define both hypersync_config and rpc as a data-source for historical sync at the same time, please choose only one option or set RPC to be a fallback. Read more in our docs https://docs.envio.dev/docs/configuration-file"); + assert_eq!( + error.to_string(), + format!( + "EE106: Cannot define both hypersync_config and rpc as a data-source for historical sync at the same time, please choose only one option or set RPC to be a fallback. Read more in our docs {}", + links::DOC_CONFIGURATION_FILE + ) + );Notes:
- Ensure the links module is in scope where you use it (e.g., add
use crate::constants::links;or fully qualifycrate::constants::links::DOC_CONFIGURATION_FILE).- For other code hits (validation.rs, SourceManager.res, etc.) either add matching constants in constants.rs (and expose them to the relevant language/package) or decide intentionally to leave some README/template content unchanged.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
codegenerator/cli/src/config_parsing/system_config.rs(1 hunks)codegenerator/cli/src/constants.rs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (2)
codegenerator/cli/src/config_parsing/system_config.rs (2)
1017-1017: Swapping hard-coded link for centralized constant is correct.Using links::DOC_CONFIGURATION_FILE keeps the message consistent with other places and avoids drift if the docs URL changes.
1023-1027: Docs anchor verified — no change required.Verified: the HyperIndex "Configuration Schema Reference" page on docs.envio.dev contains a "HypersyncConfig" section reachable at the #hypersyncconfig anchor, so the link used in the error message is correct.
- File: codegenerator/cli/src/config_parsing/system_config.rs (lines 1023–1027) — keep the existing reference to links::DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG.
| pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str = | ||
| "https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig"; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Good addition; consistent naming and scoping.
Public constant is appropriately placed under links and naming matches existing style.
Optionally add a brief doc comment to clarify where/when to use this specific link.
pub mod links {
pub const DOC_CONFIGURATION_FILE: &str = "https://docs.envio.dev/docs/configuration-file";
+ /// Docs anchor for HyperSyncConfig within the HyperIndex config schema reference.
pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str =
"https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig";
}Please verify that the URL and anchor are still correct (docs sometimes move). If helpful, run this web search:
🌐 Web query:
Is the HyperSync config schema anchor at:
https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig
💡 Result:
The documentation currently does not expose a dedicated schema anchor labeled specifically #hypersyncconfig at https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig. There is, however, detailed material about HyperSync configuration spread throughout the related Envio docs, especially regarding how HyperSync is used by default in HyperIndex and the structure of configuration files[1][3][4][6].
Key findings:
- The official Envio documentation at
/HyperIndex/config-schema-referencedoes not directly provide an anchor for#hypersyncconfigin the search results, nor does any search result mention it specifically by anchor or title. - HyperSync settings are generally not specified as a standalone schema section. Instead, HyperSync behavior is determined by the absence of a historical
rpcin the config file; if no RPC is set, HyperIndex will default to HyperSync for supported networks[1]. - The main configuration schema is documented at
/HyperIndex/configuration-fileand/HyperIndex/config-schema-reference, but search results only surface configurations related to indexers, contracts, and network fields, not a specific “hypersyncconfig” section[3]. - The
start_block: 0trick, automatic contract deployment detection, and RPC fallback logic are documented, but again not under ahypersyncconfigheading[1][4]. - Envio documentation is structured such that HyperSync configuration is implicit via network and indexing options, not via a dedicated “hypersyncconfig” object/schema[1][3][6].
Summary:
There appears to be no officially documented, stable anchor or schema block at [/HyperIndex/config-schema-reference#hypersyncconfig] as of August 2025. HyperSync configuration is typically part of the general HyperIndex config YAML file, with no separate “hypersyncconfig” schema. If you require a schema reference, use the main configuration guide and schema explorer at /HyperIndex/config-schema-reference, and look for relevant fields like networks, rpc, and start_block.[1][3][4][6]
If you need explicit schema examples or YAML snippets for HyperSync, refer to /HyperIndex/configuration-file and related usage docs, which document all fields affecting HyperSync operation[1][3].
Citations:
- 1: https://docs.envio.dev/docs/HyperIndex/hypersync
- 2: https://docs.envio.dev/docs/HyperIndex/overview
- 3: https://docs.envio.dev/docs/HyperIndex/configuration-file
- 4: https://docs.envio.dev/docs/HyperSync/hypersync-usage
- 5: https://docs.celo.org/developer/indexers/envio
- 6: https://docs.envio.dev/docs/HyperSync/overview
- 7: https://docs.arbitrum.io/for-devs/third-party-docs/Envio/
- 8: https://docs.darwinia.network/build/indexer/envio/
- 9: https://lib.rs/crates/hypersync-client
- 10: https://unpkg.com/@envio-dev/hypersync-client@0.6.3/docs/interfaces/FieldSelection.html
Fix required — constant links to a non‑existent docs anchor; update the URL
The docs do not expose a #hypersyncconfig anchor at the referenced page. Replace the anchor URL with the HyperSync docs (or the main config schema page) and keep the brief doc comment.
- File: codegenerator/cli/src/constants.rs (around lines 12–13)
Suggested diff:
pub mod links {
pub const DOC_CONFIGURATION_FILE: &str = "https://docs.envio.dev/docs/configuration-file";
- /// Docs anchor for HyperSyncConfig within the HyperIndex config schema reference.
- pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str =
- "https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig";
+ /// Link to the HyperSync documentation (there is no dedicated `#hypersyncconfig` anchor on the schema page).
+ pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str =
+ "https://docs.envio.dev/docs/HyperIndex/hypersync";
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str = | |
| "https://docs.envio.dev/docs/HyperIndex/config-schema-reference#hypersyncconfig"; | |
| pub mod links { | |
| pub const DOC_CONFIGURATION_FILE: &str = "https://docs.envio.dev/docs/configuration-file"; | |
| /// Link to the HyperSync documentation (there is no dedicated `#hypersyncconfig` anchor on the schema page). | |
| pub const DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG: &str = | |
| "https://docs.envio.dev/docs/HyperIndex/hypersync"; | |
| } |
🤖 Prompt for AI Agents
In codegenerator/cli/src/constants.rs around lines 12–13, the
DOC_CONFIGURATION_SCHEMA_HYPERSYNC_CONFIG constant points to a non-existent
#hypersyncconfig anchor; update the string to a valid docs URL (for example
replace the value with the main config schema page
"https://docs.envio.dev/docs/HyperIndex/config-schema-reference" or the correct
HyperSync docs page URL if available) and retain the existing brief doc comment.
improve error msg to hypersync_config
Summary by CodeRabbit