Skip to content

Config schema#687

Merged
DenhamPreen merged 1 commit intomainfrom
dp/config-schema
Aug 14, 2025
Merged

Config schema#687
DenhamPreen merged 1 commit intomainfrom
dp/config-schema

Conversation

@DenhamPreen
Copy link
Contributor

@DenhamPreen DenhamPreen commented Aug 11, 2025

image

I've removed this, it's not linkable and it doesn't work with the llm docs, I've moved a document to the advanced section and added examples.

image

I suggest checking the preview to review

Summary by CodeRabbit

  • Documentation

    • Added deep-linkable Config Schema Reference for config.yaml with examples.
    • Updated Configuration Guide to link to the new reference (replacing interactive viewer).
    • Added the reference page to the Advanced sidebar.
    • Removed Gnosis Traces from HyperRPC and HyperSync supported networks lists.
  • Chores

    • Added an automated script to generate the Config Schema Reference and integrated it into the predeploy workflow.

@DenhamPreen DenhamPreen requested a review from moose-code August 11, 2025 10:42
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Adds a static, deep-linkable Config Schema Reference page and integrates an automated generator script to produce it from JSON Schema during predeploy. Updates a guide to link to the new reference, adjusts the HyperIndex sidebar, and removes “Gnosis Traces” from HyperSync supported networks.

Changes

Cohort / File(s) Summary
Config schema reference (new doc)
docs/HyperIndex/Advanced/config-schema-reference.md
Adds a static JSON Schema reference for config.yaml with top-level properties, definitions, anchors, and YAML examples.
Guide update
docs/HyperIndex/Guides/configuration-file.mdx
Replaces interactive schema viewer with a link to the new Config Schema Reference.
Doc generation pipeline
scripts/generate-config-schema-doc.js, package.json
Introduces a script to generate the reference from static/schemas/config.evm.json; wires it into predeploy via a new npm script.
Sidebar
sidebarsHyperIndex.js
Adds Advanced/config-schema-reference to the HyperIndex Advanced sidebar items.
Supported networks cleanup
docs/HyperSync/HyperRPC/hyperrpc-supported-networks.md, docs/HyperSync/hypersync-supported-networks.md
Removes the “Gnosis Traces” entries; no other rows changed.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant NPM as predeploy script
  participant Gen as generate-config-schema-doc.js
  participant Schema as static/schemas/config.evm.json
  participant Doc as docs/HyperIndex/Advanced/config-schema-reference.md
  participant Site as Docs site

  Dev->>NPM: yarn predeploy
  NPM->>Gen: yarn generate-config-schema-doc
  Gen->>Schema: Read JSON Schema
  Gen->>Doc: Write Markdown reference
  Site-->>Doc: Link via sidebar and guide
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested reviewers

  • moose-code
  • JonoPrest

Poem

I hop through schemas, nibbling on keys,
Linking each anchor with carrot-ease.
Predeploy whispers, “Generate, go!”
Markdown blooms where JSON flows.
Gnosis tracks fade from the maps—
I twitch my nose, commit, perhaps.
Thump! Docs updated; time for naps.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dp/config-schema

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
envio-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 10:46am

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🔭 Outside diff range comments (1)
docs/HyperIndex/Guides/configuration-file.mdx (1)

184-185: Broken in-page link: “Interactive Schema Explorer” anchor no longer exists

The interactive viewer section was removed; this link will now be dead. Point it to the new reference.

Apply:

-See all possible options in the [Interactive Schema Explorer](#interactive-schema-explorer) or use IDE autocomplete for your help.
+See all possible options in the [Config Schema Reference](../Advanced/config-schema-reference) or use IDE autocomplete for your help.
🧹 Nitpick comments (2)
scripts/generate-config-schema-doc.js (1)

27-58: Consider externalizing the example snippets for better maintainability.

The hardcoded YAML examples could become outdated when the schema changes. Consider loading these from external YAML files or generating them from test fixtures to ensure they stay in sync with the actual schema.

package.json (1)

9-12: Consider generating the doc for local dev/build flows too

If the generated doc isn’t checked in or needs to stay fresh locally, include generation in predev/prebuild. Otherwise devs may see stale/missing pages.

Example:

-"predev": "node ./scripts/update-endpoints.js",
+"predev": "node ./scripts/update-endpoints.js && yarn generate-config-schema-doc",

-"prebuild": "node ./scripts/update-endpoints.js",
+"prebuild": "yarn update-endpoints && yarn update-cli-help && yarn update-evm-config-schema && yarn generate-config-schema-doc",

Also consider LLM builds:

-"build-llm": "yarn consolidate-docs && npx docusaurus build --config docusaurus.config.llm.js",
+"build-llm": "yarn consolidate-docs && yarn generate-config-schema-doc && npx docusaurus build --config docusaurus.config.llm.js",

-"start-llm": "yarn consolidate-docs && npx docusaurus start --config docusaurus.config.llm.js"
+"start-llm": "yarn consolidate-docs && yarn generate-config-schema-doc && npx docusaurus start --config docusaurus.config.llm.js"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 166e690 and 8780120.

📒 Files selected for processing (7)
  • docs/HyperIndex/Advanced/config-schema-reference.md (1 hunks)
  • docs/HyperIndex/Guides/configuration-file.mdx (1 hunks)
  • docs/HyperSync/HyperRPC/hyperrpc-supported-networks.md (0 hunks)
  • docs/HyperSync/hypersync-supported-networks.md (0 hunks)
  • package.json (1 hunks)
  • scripts/generate-config-schema-doc.js (1 hunks)
  • sidebarsHyperIndex.js (1 hunks)
💤 Files with no reviewable changes (2)
  • docs/HyperSync/HyperRPC/hyperrpc-supported-networks.md
  • docs/HyperSync/hypersync-supported-networks.md
🧰 Additional context used
🪛 LanguageTool
docs/HyperIndex/Advanced/config-schema-reference.md

[grammar] ~266-~266: Ensure spelling is correct
Context: ... in the HyperIndex generated code. When ommitted, the event field will be used. Should b...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~266-~266: To form a complete sentence, be sure to include a subject.
Context: ...ommitted, the event field will be used. Should be unique per contract - `field_selecti...

(MISSING_IT_THERE)


[style] ~346-~346: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...string>)` – URL of the RPC endpoint. Can be a single URL or an array of URLs. If...

(MISSING_IT_THERE)

🔇 Additional comments (4)
package.json (1)

17-18: Good addition: generation script is hooked into predeploy

Adding generate-config-schema-doc and chaining it in predeploy after fetching the schema is correct and keeps the reference up to date at deploy time.

docs/HyperIndex/Guides/configuration-file.mdx (1)

357-357: Section rename looks good

“Configuration Schema Reference” matches the new static, deep-linkable reference.

sidebarsHyperIndex.js (2)

101-102: Sidebar entry correctly added and positioned

Advanced/config-schema-reference matches the expected doc id from docs/HyperIndex/Advanced/config-schema-reference.md. Good placement between related topics.


99-104: Sidebar entries validated – no issues found
The referenced document Advanced/config-schema-reference.md exists at docs/HyperIndex/Advanced/config-schema-reference.md and declares id: config-schema-reference as expected. No broken sidebar links detected.


Properties:
- `event`: `string` – The human readable signature of an event 'eg. Transfer(address indexed from, address indexed to, uint256 value)' OR a reference to the name of an event in a json ABI file defined in your contract config. A provided signature will take precedence over what is defined in the json ABI
- `name`: `string | null` – Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Fix typo in generated documentation: "ommitted" should be "omitted".

This appears to be generated content. The typo should be fixed in the source schema or generator script.


🏁 Script executed:

#!/bin/bash
# Search for the source of the typo in the schema file
rg -A 2 -B 2 "ommitted" static/schemas/config.evm.json

Length of output: 280


Fix typo in config schema description

Please update the source schema to correct “ommitted” → “omitted” so that generated docs reflect the fix.

Affected file:

  • static/schemas/config.evm.json
     "description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract",
    + "description": "Name of the event in the HyperIndex generated code. When omitted, the event field will be used. Should be unique per contract",

After applying the change, regenerate the documentation (e.g., rerun the schema‐to‐Markdown generator) to update docs/HyperIndex/Advanced/config-schema-reference.md.

📝 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.

Suggested change
- `name`: `string | null`Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract
- "description": "Name of the event in the HyperIndex generated code. When ommitted, the event field will be used. Should be unique per contract",
+ "description": "Name of the event in the HyperIndex generated code. When omitted, the event field will be used. Should be unique per contract",
🧰 Tools
🪛 LanguageTool

[grammar] ~266-~266: Ensure spelling is correct
Context: ... in the HyperIndex generated code. When ommitted, the event field will be used. Should b...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~266-~266: To form a complete sentence, be sure to include a subject.
Context: ...ommitted, the event field will be used. Should be unique per contract - `field_selecti...

(MISSING_IT_THERE)

🤖 Prompt for AI Agents
In docs/HyperIndex/Advanced/config-schema-reference.md around line 266, the word
"ommitted" in the description should be corrected to "omitted"; edit the source
schema file static/schemas/config.evm.json to fix the typo in the corresponding
"description" field, then re-run the schema-to-Markdown documentation generator
to regenerate docs/HyperIndex/Advanced/config-schema-reference.md so the
corrected text appears in the generated docs.

import JSONSchemaViewer from "@theme/JSONSchemaViewer";

<JSONSchemaViewer schema={Schema} />
- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Prefer a relative doc link (or verify slug) to avoid broken routes

The link uses an absolute path that assumes a specific slug. If the generated page doesn’t set slug: /config-schema-reference (under the HyperIndex docs route), this may 404. Use a relative link to the doc id to decouple from slug.

Apply:

-- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
+- See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference)

To verify current frontmatter, run:


🏁 Script executed:

#!/bin/bash
# Inspect frontmatter for id/slug of the generated page
fd -a 'config-schema-reference.md' docs | sed -n '1,1p'
echo "---- frontmatter ----"
fd -a 'config-schema-reference.md' docs | xargs -I{} awk 'NR==1,/^---$/{print} NR>1 && p==0{exit} /^---$/{p++}' {}
echo "---- id/slug lines ----"
fd -a 'config-schema-reference.md' docs | xargs rg -n '^(id|slug):'

Length of output: 488


Update the doc link to prevent a 404

I confirmed that docs/HyperIndex/Advanced/config-schema-reference.md has slug: /config-schema-reference, so the current absolute link /docs/HyperIndex/config-schema-reference will 404. Prefer a relative link to the source file:

- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
+ See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference)
📝 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.

Suggested change
- See the full, deep-linkable reference: [Config Schema Reference](/docs/HyperIndex/config-schema-reference)
- See the full, deep-linkable reference: [Config Schema Reference](../Advanced/config-schema-reference)
🤖 Prompt for AI Agents
In docs/HyperIndex/Guides/configuration-file.mdx around line 361, the absolute
link /docs/HyperIndex/config-schema-reference will 404 because the actual
document slug is /config-schema-reference; update the link to a relative path
pointing to the source file (for example ../Advanced/config-schema-reference or
./../Advanced/config-schema-reference.md or the direct repo path
docs/HyperIndex/Advanced/config-schema-reference.md) so the link resolves
correctly to the config schema reference page.

@@ -14,7 +14,8 @@
"update-endpoints": "node ./scripts/update-endpoints.js",
"update-cli-help": "node ./scripts/update-cli-help.js",
"update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Harden the schema fetch to avoid silent failures and ensure directory exists

curl without strict flags can write HTML error pages or empty files; mkdir safeguards the target path.

Apply:

-"update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json",
+"update-evm-config-schema": "mkdir -p ./static/schemas && curl -fsSL https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json -o ./static/schemas/config.evm.json && test -s ./static/schemas/config.evm.json",

Optional hardening: pin to a specific commit SHA for reproducibility:

-https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json
+https://raw.githubusercontent.com/enviodev/hyperindex/<PINNED_COMMIT_SHA>/codegenerator/cli/npm/envio/evm.schema.json
📝 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.

Suggested change
"update-evm-config-schema": "curl https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json > ./static/schemas/config.evm.json",
"update-evm-config-schema": "mkdir -p ./static/schemas && curl -fsSL https://raw.githubusercontent.com/enviodev/hyperindex/main/codegenerator/cli/npm/envio/evm.schema.json -o ./static/schemas/config.evm.json && test -s ./static/schemas/config.evm.json",
🤖 Prompt for AI Agents
In package.json around line 16, the npm script that uses curl to fetch the
schema is brittle: it can create empty or HTML error files and assumes the
target directory exists; update the script to first create the static/schemas
directory (mkdir -p ./static/schemas) and run curl with strict flags to fail
loudly and write only on success (e.g. --fail --location --silent --show-error),
redirecting output to the file; optionally replace the GitHub branch URL with a
pinned commit SHA to ensure reproducible fetches.

Comment on lines +351 to +364
function main() {
if (!fs.existsSync(INPUT_SCHEMA_PATH)) {
console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`);
process.exit(1);
}
const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
const schema = JSON.parse(raw);
const md = generateMarkdown(schema);
ensureDirSync(OUTPUT_DOC_PATH);
fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
}

main();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling for JSON parsing and file operations.

The script lacks error handling for JSON parsing and file write operations, which could cause unhandled exceptions.

Apply this diff to add proper error handling:

 function main() {
   if (!fs.existsSync(INPUT_SCHEMA_PATH)) {
     console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`);
     process.exit(1);
   }
-  const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
-  const schema = JSON.parse(raw);
-  const md = generateMarkdown(schema);
-  ensureDirSync(OUTPUT_DOC_PATH);
-  fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
-  console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
+  try {
+    const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
+    const schema = JSON.parse(raw);
+    const md = generateMarkdown(schema);
+    ensureDirSync(OUTPUT_DOC_PATH);
+    fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
+    console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
+  } catch (error) {
+    console.error(`Error generating schema documentation: ${error.message}`);
+    process.exit(1);
+  }
 }
📝 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.

Suggested change
function main() {
if (!fs.existsSync(INPUT_SCHEMA_PATH)) {
console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`);
process.exit(1);
}
const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
const schema = JSON.parse(raw);
const md = generateMarkdown(schema);
ensureDirSync(OUTPUT_DOC_PATH);
fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
}
main();
function main() {
if (!fs.existsSync(INPUT_SCHEMA_PATH)) {
console.error(`Schema not found at ${INPUT_SCHEMA_PATH}`);
process.exit(1);
}
try {
const raw = fs.readFileSync(INPUT_SCHEMA_PATH, "utf8");
const schema = JSON.parse(raw);
const md = generateMarkdown(schema);
ensureDirSync(OUTPUT_DOC_PATH);
fs.writeFileSync(OUTPUT_DOC_PATH, md, "utf8");
console.log(`Wrote schema reference to ${OUTPUT_DOC_PATH}`);
} catch (error) {
console.error(`Error generating schema documentation: ${error.message}`);
process.exit(1);
}
}
main();
🤖 Prompt for AI Agents
In scripts/generate-config-schema-doc.js around lines 351 to 364, the code
reads, parses, and writes files without error handling; wrap the file read,
JSON.parse, ensureDirSync and fs.writeFileSync calls in a try/catch block, catch
and log descriptive errors (including the caught error.message or error object)
to console.error, and call process.exit(1) on failure so the script exits
cleanly; keep the existing exists check but still guard against race conditions
by handling read/parse/write exceptions and ensure the success log only runs
when all operations complete without throwing.

Copy link
Member

@moose-code moose-code left a comment

Choose a reason for hiding this comment

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

Nice! new config page looks good!

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.

2 participants