Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved subgraph config to env variables (except codegen) #155

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Nov 27, 2024

Also pinned node and yarn version

Summary by CodeRabbit

  • New Features

    • Introduced a new .yarnrc file to specify the Yarn version in use.
    • Added environment variables for multiple subgraph URLs to enhance configuration options.
  • Bug Fixes

    • Updated the GraphQL schema endpoint to ensure accurate data retrieval.
  • Chores

    • Enhanced the .gitignore file to manage Yarn-related files effectively.
    • Added Volta configuration to specify Node.js and Yarn versions in package.json.
    • Refactored URL handling in the configuration to utilize environment variables.

Copy link

coderabbitai bot commented Nov 27, 2024

Walkthrough

This pull request introduces several changes aimed at enhancing the project's configuration and environment management. Key updates include the addition of Yarn-related entries in the .gitignore file, the creation of a new .yarnrc file specifying the Yarn version, and modifications to the codegen.yml file to update the GraphQL schema endpoint. Additionally, new environment variables are added to both env.d.ts and next.config.js, and the package.json file is updated with Volta configuration. The subgraph_url object in src/config/subgraph.ts is also modified to use these new environment variables.

Changes

File Change Summary
.gitignore Added rules to ignore Yarn-related files while allowing specific subdirectories.
.yarnrc Created new file specifying the Yarn version and warning against direct edits.
codegen.yml Updated the GraphQL schema endpoint URL.
env.d.ts Added four new string properties for subgraph URLs: MAINNET_SUBGRAPH_URL, GNOSIS_SUBGRAPH_URL, CHIADO_SUBGRAPH_URL, SEPOLIA_SUBGRAPH_URL.
next.config.js Added four new environment variables sourced from process.env: MAINNET_SUBGRAPH_URL, GNOSIS_SUBGRAPH_URL, CHIADO_SUBGRAPH_URL, SEPOLIA_SUBGRAPH_URL.
package.json Introduced Volta configuration specifying Node.js and Yarn versions; modified package manager declaration.
src/config/subgraph.ts Replaced hardcoded URLs with references to new environment variables for subgraph URLs.

Possibly related PRs

  • Testnets #148: The changes in this PR involve adding new environment variables in env.d.ts and next.config.js, which are relevant to the management of environment variables, similar to the changes made in the main PR regarding Yarn-related configurations.

🐇 In the land of code, where changes abound,
Yarn's paths are ignored, new rules we have found.
With subgraph URLs, our config's now bright,
Volta's here too, making everything right!
So hop along, friends, let’s code with delight! 🌟

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning eslint-config-next > @next/eslint-plugin-next > glob@7.1.7: Glob versions prior to v9 are no longer supported
warning eslint-config-next > @next/eslint-plugin-next > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > rimraf > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > npmlog@5.0.1: This package is no longer supported.
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > npmlog > are-we-there-yet@2.0.0: This package is no longer supported.
warning @cyntler/react-doc-viewer > react-pdf > pdfjs-dist > canvas > @mapbox/node-pre-gyp > npmlog > gauge@3.0.2: This package is no longer supported.
warning @ffmpeg/ffmpeg > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @web3modal/ethereum@2.7.1: Please use new @web3modal/wagmi package
warning @web3modal/react@2.7.1: Please use new @web3modal/wagmi package
warning @web3modal/react > @web3modal/ui > motion > @motionone/vue@10.16.4: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion
warning jimp > @jimp/custom > @jimp/core > phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning wagmi > @wagmi/core > @wagmi/connectors > @walletconnect/ethereum-provider > @walletconnect/sign-client@2.11.0: Reliability and performance greatly improved - please see https://github.com/WalletConnect/walletconnect-monorepo/releases
warning wagmi > @wagmi/core > @wagmi/connectors > @walletconnect/ethereum-provider > @walletconnect/universal-provider > @walletconnect/sign-client@2.11.0: Reliability and performance greatly improved - please see https://github.com/WalletConnect/walletconnect-monorepo/releases
warning @filebase/client > ipfs-car > ipfs-core-utils@0.12.2: js-IPFS has been deprecated in favour of Helia - please see ipfs/js-ipfs#4336 for details
warning @filebase/client > ipfs-car > ipfs-core-utils > multiaddr-to-uri@8.0.0: This module is deprecated, please upgrade to @multiformats/multiaddr-to-uri
warning @filebase/client > ipfs-car > ipfs-core-utils > multiaddr@10.0.1: This module is deprecated, please upgrade to @multiformats/multiaddr
warning @filebase/client > ipfs-car > ipfs-core-utils > multiaddr-to-uri > multiaddr@10.0.1: This module is deprecated, please upgrade to @multiformats/multiaddr
warning @filebase/client > ipfs-car > ipfs-core-types@0.8.4: js-IPFS has been deprecated in favour of Helia - please see ipfs/js-ipfs#4336 for details
warning @filebase/client > ipfs-car > ipfs-core-utils > ipfs-core-types@0.8.4: js-IPFS has been deprecated in favour of Helia - please see ipfs/js-ipfs#4336 for details
warning @filebase/client > ipfs-car > ipfs-core-types > multiaddr@10.0.1: This module is deprecated, please upgrade to @multiformats/multiaddr
warning @graphql-codegen/cli > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @graphql-codegen/typescript > @graphql-codegen/visitor-plugin-common > @graphql-tools/relay-operation-optimizer > @ardatan/relay-compiler > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @graphql-codegen/typescript > @graphql-codegen/visitor-plugin-common > @graphql-tools/relay-operation-optimizer > @ardatan/relay-compiler > babel-preset-fbjs > @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @graphql-codegen/typescript > @graphql-codegen/visitor-plugin-common > @graphql-tools/relay-operation-optimizer > @ardatan/relay-compiler > babel-preset-fbjs > @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning ipfs-car@0.7.0: Invalid bin entry for "🚘" (in "ipfs-car").
warning " > eslint-config-next@14.0.1" has incorrect peer dependency "eslint@^7.23.0 || ^8.0.0".
warning "eslint-config-next > eslint-plugin-react-hooks@5.0.0-canary-7118f5dd7-20230705" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0".
warning "eslint-config-next > @typescript-eslint/parser@6.21.0" has incorrect peer dependency "eslint@^7.0.0 || ^8.0.0".
warning " > @trivago/prettier-plugin-sort-imports@3.4.0" has incorrect peer dependency "prettier@2.x".
warning " > @web3modal/ethereum@2.7.1" has unmet peer dependency "@wagmi/core@>=1".
warning "subgraph-status > slick-carousel@1.8.1" has unmet peer dependency "jquery@>=1.8.0".


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for proof-of-humanity-v2 ready!

Name Link
🔨 Latest commit 5918c1e
🔍 Latest deploy log https://app.netlify.com/sites/proof-of-humanity-v2/deploys/67474b866787b20008320694
😎 Deploy Preview https://deploy-preview-155--proof-of-humanity-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@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 and nitpick comments (2)
src/config/subgraph.ts (1)

Line range hint 20-24: Add error handling for GraphQL client initialization

The GraphQL clients are created immediately without any error handling. Consider wrapping the client creation in a try-catch block or implementing lazy initialization.

Here's a suggested implementation:

-export const sdk = {
-  [mainnet.id]: getSdk(new GraphQLClient(subgraph_url[mainnet.id])),
-  [gnosis.id]: getSdk(new GraphQLClient(subgraph_url[gnosis.id])),
-  [sepolia.id]: getSdk(new GraphQLClient(subgraph_url[sepolia.id])),
-  [gnosisChiado.id]: getSdk(new GraphQLClient(subgraph_url[gnosisChiado.id])),
-};
+export const sdk = Object.fromEntries(
+  [mainnet.id, gnosis.id, sepolia.id, gnosisChiado.id].map(chainId => {
+    try {
+      return [chainId, getSdk(new GraphQLClient(subgraph_url[chainId]))];
+    } catch (error) {
+      console.error(`Failed to initialize GraphQL client for chain ${chainId}:`, error);
+      throw error;
+    }
+  })
+) as Record<SupportedChainId, sdkReturnType>;
next.config.js (1)

Line range hint 39-45: Security & Quality Concern: Build errors being ignored

The configuration is currently set to ignore both ESLint and TypeScript errors during builds. This can lead to:

  • Potential bugs reaching production
  • Type-safety guarantees being bypassed
  • Code quality issues being overlooked

Consider:

  1. Addressing and fixing existing errors
  2. Setting up pre-commit hooks to catch issues early
  3. Making the build process stricter for production deployments

Would you like assistance in setting up a more robust build configuration that maintains both development velocity and code quality?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef77fd and 5918c1e.

⛔ Files ignored due to path filters (2)
  • .yarn/releases/yarn-1.22.22.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • .gitignore (1 hunks)
  • .yarnrc (1 hunks)
  • codegen.yml (1 hunks)
  • env.d.ts (1 hunks)
  • next.config.js (1 hunks)
  • package.json (1 hunks)
  • src/config/subgraph.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .yarnrc
🔇 Additional comments (6)
codegen.yml (1)

2-2: Verify the new GraphQL service endpoint

The schema URL has changed significantly:

  • Different organization ID: from 64099 to 61738
  • Different project name: from 'proof-of-humanity-mainnet' to 'poh-origin-mainnet'
  • Using 'latest' version tag which could lead to inconsistent builds

Let's verify the endpoint and its accessibility:

✅ Verification successful

GraphQL endpoint change appears valid and properly configured

The endpoint change is legitimate and well-integrated:

  • The new endpoint is accessible and returns a valid GraphQL schema with PoH-specific types
  • The endpoint URL is only referenced in codegen.yml and used for code generation
  • Runtime GraphQL queries use environment variables (MAINNET_SUBGRAPH_URL) for flexibility
  • The project's dependencies include proper GraphQL tooling and code generation setup
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the GraphQL endpoint accessibility and schema
# Expected results: 200 OK response and valid GraphQL schema

# Test endpoint accessibility
curl -s -o /dev/null -w "%{http_code}" "https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest"

# Fetch and validate schema
curl -X POST -H "Content-Type: application/json" \
  -d '{"query":"query { __schema { types { name } } }"}' \
  "https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest"

# Search for any references to the old endpoint
rg -g '!codegen.yml' "64099/proof-of-humanity-mainnet"

Length of output: 3063


Script:

#!/bin/bash
# Let's check for any references to both old and new endpoints in the codebase
# and look for any configuration or documentation files that might provide context

# Search for any references to both old and new subgraph names
rg -l "proof-of-humanity-mainnet|poh-origin-mainnet"

# Search for GraphQL related configuration files
fd -e graphql -e gql -e config.js -e config.ts

# Check package.json and other common config files for graph-related dependencies
fd -e json -e yaml -e yml | xargs rg -l "graph|graphql"

# Look for documentation about the GraphQL endpoint
fd "README|CONTRIBUTING|DEVELOPMENT" | xargs rg -l "graph|graphql"

Length of output: 1234


Script:

#!/bin/bash
# Let's examine the subgraph configuration and its usage

# Check the subgraph configuration
cat src/config/subgraph.ts

# Look for any version pinning or endpoint configuration
cat package.json

# Check if there are any migration scripts or documentation about the endpoint change
rg -l "61738" 

# Examine the GraphQL codegen configuration in detail
cat codegen.yml

Length of output: 4062

env.d.ts (1)

8-11: LGTM! The environment variable declarations look good.

The new subgraph URL environment variables follow consistent naming patterns and maintain parity with existing RPC configurations across all networks.

Let's verify the usage of these new environment variables:

✅ Verification successful

Environment variables are properly used and no hardcoded subgraph URLs found

The verification shows that:

  • All new environment variables are correctly used in next.config.js for client-side access
  • The variables are properly mapped to network IDs in src/config/subgraph.ts
  • No hardcoded subgraph URLs were found in the codebase
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the new environment variables are properly used and that no hardcoded subgraph URLs remain

# Check for any remaining hardcoded subgraph URLs
rg -i "subgraph.*\.(io|com|org)" --type ts --type js

# Check the usage of the new environment variables
rg "process\.env\.(MAINNET|GNOSIS|CHIADO|SEPOLIA)_SUBGRAPH_URL" --type ts --type js

Length of output: 730

.gitignore (2)

39-39: LGTM: Proper section separation

The empty line provides clear visual separation between different ignore rule sections.


40-47: LGTM: Standard Yarn 2+ Zero-Install configuration

The Yarn ignore rules follow the official best practices for Yarn 2+ (Berry) with Zero-Install configuration. This setup will:

  • Improve CI/CD reliability by committing the Yarn release
  • Ensure consistent tooling across the team
  • Support proper editor integration via SDKs

Let's verify the Yarn 2+ migration is complete:

src/config/subgraph.ts (1)

Line range hint 1-24: Verify environment variable configuration

Let's verify that all required environment variables are properly configured in the project.

✅ Verification successful

Environment variables are properly configured

The verification shows that all required subgraph URL environment variables are properly configured in both env.d.ts (type definitions) and next.config.js (runtime configuration). All four required variables (MAINNET_SUBGRAPH_URL, GNOSIS_SUBGRAPH_URL, SEPOLIA_SUBGRAPH_URL, and CHIADO_SUBGRAPH_URL) are present and correctly typed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for environment variable configuration in relevant files

echo "Checking .env.example file..."
if [ -f ".env.example" ]; then
  echo "Contents of .env.example:"
  grep -E "MAINNET_SUBGRAPH_URL|GNOSIS_SUBGRAPH_URL|SEPOLIA_SUBGRAPH_URL|CHIADO_SUBGRAPH_URL" .env.example || echo "No subgraph URLs found in .env.example"
fi

echo -e "\nChecking env.d.ts file..."
if [ -f "env.d.ts" ]; then
  echo "Environment variable types in env.d.ts:"
  grep -E "MAINNET_SUBGRAPH_URL|GNOSIS_SUBGRAPH_URL|SEPOLIA_SUBGRAPH_URL|CHIADO_SUBGRAPH_URL" env.d.ts || echo "No subgraph URL types found in env.d.ts"
fi

echo -e "\nChecking next.config.js file..."
if [ -f "next.config.js" ]; then
  echo "Environment variable configuration in next.config.js:"
  grep -E "MAINNET_SUBGRAPH_URL|GNOSIS_SUBGRAPH_URL|SEPOLIA_SUBGRAPH_URL|CHIADO_SUBGRAPH_URL" next.config.js || echo "No subgraph URLs found in next.config.js"
fi

Length of output: 1086

package.json (1)

86-90: LGTM: Version pinning implementation

The explicit version pinning for Yarn and the package manager specification with SHA hash ensures reproducible builds. The Yarn version 1.22.22 is the latest stable version in the 1.x series.

Let's verify the Yarn version and SHA:

@@ -1,6 +1,5 @@
overwrite: true
#schema: "https://api.studio.thegraph.com/query/64099/proof-of-humanity-sepolia/version/latest"
schema: "https://api.studio.thegraph.com/query/64099/proof-of-humanity-mainnet/version/latest"
schema: "https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Schema URL should use environment variables

The schema URL is still hardcoded despite the PR's objective to move subgraph configuration to environment variables. This could make it difficult to switch between different environments (mainnet, testnet, etc.).

Consider using the environment variables that were added in this PR:

-schema: "https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest"
+schema: ${MAINNET_SUBGRAPH_URL}
📝 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
schema: "https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest"
schema: ${MAINNET_SUBGRAPH_URL}

Comment on lines +14 to +17
[mainnet.id]: process.env.MAINNET_SUBGRAPH_URL,
[gnosis.id]: process.env.GNOSIS_SUBGRAPH_URL,
[sepolia.id]: process.env.SEPOLIA_SUBGRAPH_URL,
[gnosisChiado.id]: process.env.CHIADO_SUBGRAPH_URL,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add validation for environment variables

The direct use of environment variables without validation could lead to runtime errors if any of these variables are undefined. Consider adding validation and providing meaningful error messages.

Here's a suggested implementation:

export const subgraph_url = {
-  [mainnet.id]: process.env.MAINNET_SUBGRAPH_URL,
-  [gnosis.id]: process.env.GNOSIS_SUBGRAPH_URL,
-  [sepolia.id]: process.env.SEPOLIA_SUBGRAPH_URL,
-  [gnosisChiado.id]: process.env.CHIADO_SUBGRAPH_URL,
+  [mainnet.id]: validateSubgraphUrl('MAINNET_SUBGRAPH_URL', process.env.MAINNET_SUBGRAPH_URL),
+  [gnosis.id]: validateSubgraphUrl('GNOSIS_SUBGRAPH_URL', process.env.GNOSIS_SUBGRAPH_URL),
+  [sepolia.id]: validateSubgraphUrl('SEPOLIA_SUBGRAPH_URL', process.env.SEPOLIA_SUBGRAPH_URL),
+  [gnosisChiado.id]: validateSubgraphUrl('CHIADO_SUBGRAPH_URL', process.env.CHIADO_SUBGRAPH_URL),
};

function validateSubgraphUrl(name: string, url: string | undefined): string {
  if (!url) {
    throw new Error(`${name} environment variable is not defined`);
  }
  try {
    new URL(url);
    return url;
  } catch {
    throw new Error(`${name} environment variable contains an invalid URL: ${url}`);
  }
}

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +20 to +23
MAINNET_SUBGRAPH_URL: process.env.MAINNET_SUBGRAPH_URL,
GNOSIS_SUBGRAPH_URL: process.env.GNOSIS_SUBGRAPH_URL,
CHIADO_SUBGRAPH_URL: process.env.CHIADO_SUBGRAPH_URL,
SEPOLIA_SUBGRAPH_URL: process.env.SEPOLIA_SUBGRAPH_URL,
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Environment variables need documentation

The newly added subgraph URL environment variables (MAINNET_SUBGRAPH_URL, GNOSIS_SUBGRAPH_URL, CHIADO_SUBGRAPH_URL, SEPOLIA_SUBGRAPH_URL) lack documentation. Please:

  • Create a .env.example file listing these variables with sample values
  • Document the variables in the README.md or a dedicated environment setup guide
  • Include any specific requirements or format expectations for the URLs
🔗 Analysis chain

LGTM! Verify environment variable documentation.

The addition of network-specific subgraph URL environment variables aligns with the PR objective and follows good practices for configuration management.

Let's verify the environment variables are properly documented:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for environment variable documentation
# Look for .env.example, README, or documentation files that should list these variables

# Search for documentation files
echo "Searching for environment documentation files..."
fd -e md -e example --exec grep -l "SUBGRAPH_URL" {} \;
fd ".env" --exec grep -l "SUBGRAPH_URL" {} \;

Length of output: 212


Script:

#!/bin/bash
# Let's try a broader search to find any potential documentation
# First, let's check for .env files with different extensions
fd ".env" 

# Then, let's look for any files containing "env" in their name or content
fd -t f -e md -e txt | xargs grep -l -i "env" 2>/dev/null

# Finally, let's check the README for any configuration documentation
if [ -f "README.md" ]; then
  echo "=== README.md content ==="
  cat README.md
fi

Length of output: 78

"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610",
"volta": {
"node": "18.20.5",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix invalid Node.js version

The specified Node.js version 18.20.5 does not exist. The latest LTS version in the v18 series is 18.19.0.

Apply this diff to fix the version:

-    "node": "18.20.5",
+    "node": "18.19.0",
📝 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
"node": "18.20.5",
"node": "18.19.0",

@martillansky martillansky merged commit 840c480 into master Nov 27, 2024
7 checks passed
@jaybuidl jaybuidl deleted the chore/subgraph-config branch November 27, 2024 16:53
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