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

Missing commits in development branch? #181

Open
wants to merge 30 commits into
base: testnets
Choose a base branch
from
Open

Missing commits in development branch? #181

wants to merge 30 commits into from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Jan 8, 2025

Summary by CodeRabbit

  • Configuration Updates

    • Updated .gitignore to improve Yarn file tracking
    • Added new environment variables for subgraph URLs
    • Switched to Volta for managing Node.js and Yarn versions
    • Updated subgraph configuration to use environment variables
  • Development Improvements

    • Simplified subgraph URL configuration
    • Enhanced project dependency management

martillansky and others added 30 commits October 15, 2024 11:48
Moved subgraph config to env variables (except codegen)
Copy link

coderabbitai bot commented Jan 8, 2025

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.

env.d.ts

Oops! Something went wrong! :(

ESLint: 9.17.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

Walkthrough

The pull request introduces configuration updates across multiple files to improve project setup and environment management. The changes focus on Yarn version management, subgraph URL configuration, and environment variable handling. A new .yarnrc file is added to specify the Yarn release, .gitignore is updated to handle Yarn-related files, and env.d.ts and next.config.js are modified to include new subgraph URL environment variables. The package.json transitions from direct package manager specification to using Volta for version management.

Changes

File Change Summary
.gitignore Added Yarn-related ignore rules, explicitly excluding .yarn/releases, .yarn/plugins, .yarn/sdks, and .yarn/versions
.yarnrc New file specifying Yarn release path as .yarn/releases/yarn-1.22.22.cjs
codegen.yml Updated GraphQL schema URL from "proof-of-humanity-mainnet" to "poh-origin-mainnet"
env.d.ts Added 4 new environment variable type definitions: MAINNET_SUBGRAPH_URL, GNOSIS_SUBGRAPH_URL, CHIADO_SUBGRAPH_URL, SEPOLIA_SUBGRAPH_URL
next.config.js Added 4 new environment variables for subgraph URLs, minor formatting updates
package.json Removed packageManager field, added volta configuration for Node.js and Yarn versions
src/config/subgraph.ts Refactored subgraph URL assignment to use environment variables directly

Poem

🐰 A Yarn of Configuration Delight

In .gitignore, rules take flight
Subgraph URLs dancing bright
Volta manages with pure might
Our code now sings, clean and tight!

🚀 Hop, hop, hooray! 🎉

Finishing Touches

  • 📝 Generate Docstrings

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 Jan 8, 2025

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

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/proof-of-humanity-v2/deploys/677f89ad7bd20f0b980e09f5
😎 Deploy Preview https://deploy-preview-181--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.

@madhurMongia madhurMongia self-requested a review January 9, 2025 08:30
@madhurMongia madhurMongia marked this pull request as ready for review January 9, 2025 08:53
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: 2

🧹 Nitpick comments (3)
env.d.ts (1)

8-11: Consider adding URL format validation for subgraph endpoints

While the type definitions are correct, consider adding runtime validation to ensure these URLs are properly formatted and accessible. This could prevent runtime issues if environment variables are misconfigured.

next.config.js (1)

8-8: Maintain consistent quote style

There's inconsistent use of single and double quotes. Consider using double quotes throughout to match the project's style:

-      use: ['@svgr/webpack'],
+      use: ["@svgr/webpack"],
-        protocol: 'https',
+        protocol: "https",
-        port: '',
+        port: "",
-        pathname: '/ipfs/**',
+        pathname: "/ipfs/**",

Also applies to: 29-29, 31-31, 32-32

package.json (1)

86-90: Consider documenting the Volta setup in README.

The transition from packageManager to Volta for version management is a significant change. Consider adding documentation about the Volta setup requirements for other developers.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e4ac1a and 840c480.

⛔ 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 (2 hunks)
  • package.json (1 hunks)
  • src/config/subgraph.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .yarnrc
🔇 Additional comments (4)
next.config.js (1)

Line range hint 39-45: Review and address ESLint and TypeScript errors

The configuration is currently ignoring both ESLint and TypeScript build errors. This could hide potential issues:

  eslint: {
    ignoreDuringBuilds: true,
  },
  typescript: {
    ignoreBuildErrors: true,
  },

Consider addressing the underlying errors instead of ignoring them.

Would you like me to help identify and fix these errors?

✅ Verification successful

Consider enabling build-time type checking for production builds

While the codebase appears well-typed with proper ESLint and TypeScript configurations (strict mode and recommended rules enabled), ignoring build errors could hide future issues. Consider:

  • Enabling error checking for production builds
  • Keeping it disabled only for development to speed up iterations
🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Find TypeScript and JavaScript files
echo "=== TypeScript and JavaScript files ==="
fd -e ts -e tsx -e js -e jsx

# Look for ESLint configuration files
echo -e "\n=== ESLint configuration files ==="
fd -g '.eslintrc*'

# Look for tsconfig files
echo -e "\n=== TypeScript configuration files ==="
fd -g 'tsconfig*.json'

# Check for potential type assertions and 'any' usage which might indicate type issues
echo -e "\n=== Potential type issues ==="
rg "as any|: any" -t typescript

Length of output: 4928


Script:

#!/bin/bash
# Look for ESLint configuration with hidden files
echo "=== ESLint configuration files ==="
fd -H -g '.eslintrc*'

# Check TypeScript configuration
echo -e "\n=== TypeScript configuration content ==="
cat tsconfig.json

# Search for potential type issues (using proper file extensions)
echo -e "\n=== Potential type issues ==="
rg "as any|: any" -t ts -t tsx

# Check for strict mode and other important compiler options
echo -e "\n=== TypeScript error patterns ==="
rg "noImplicitAny|strictNullChecks|strict" tsconfig.json

Length of output: 1717


Script:

#!/bin/bash
# Check ESLint configuration
echo "=== ESLint configuration content ==="
cat .eslintrc.js

# Look for common TypeScript error patterns
echo -e "\n=== TypeScript errors ==="
rg "Type.*'.*' is not assignable to type|Property.*does not exist on type|Cannot find name|Object is possibly 'undefined'|Type.*must have a '\[Symbol.iterator\]'" -g "*.{ts,tsx}"

Length of output: 924

codegen.yml (1)

2-2: Verify schema compatibility with new subgraph endpoint

The schema URL has changed significantly:

  • Organization: 64099 -> 61738
  • Project: proof-of-humanity-mainnet -> poh-origin-mainnet

Please verify:

  1. Schema compatibility between old and new endpoints
  2. Data consistency and availability
  3. Access permissions for the new organization

Run this script to compare schemas:

✅ Verification successful

Schema compatibility verified - Safe to proceed

The new subgraph endpoint maintains full backward compatibility with the previous schema, with a minor enhancement:

  • Added withdrawn field to fund-related types to track withdrawal status
  • All existing queries and functionality remain intact
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Compare GraphQL schemas between old and new endpoints

# Fetch and compare schemas
curl -X POST -H "Content-Type: application/json" \
  -d '{"query":"query { __schema { types { name fields { name type { name kind ofType { name kind } } } } } }"}' \
  https://api.studio.thegraph.com/query/64099/proof-of-humanity-mainnet/version/latest > old_schema.json

curl -X POST -H "Content-Type: application/json" \
  -d '{"query":"query { __schema { types { name fields { name type { name kind ofType { name kind } } } } } }"}' \
  https://api.studio.thegraph.com/query/61738/poh-origin-mainnet/version/latest > new_schema.json

diff -u old_schema.json new_schema.json

Length of output: 54921

.gitignore (1)

40-47: LGTM! Yarn gitignore patterns follow best practices.

The added Yarn configuration follows the official recommendations for Zero-installs setup, properly tracking necessary Yarn files while ignoring temporary ones.

package.json (1)

86-90: Verify Yarn version consistency across configuration files.

Please ensure the Yarn version (1.22.22) is consistent across:

  • package.json (Volta config)
  • .yarnrc (if present)
  • Any other Yarn-related configuration files
✅ Verification successful

Yarn version is consistent across all configuration files

The version 1.22.22 is correctly specified in:

  • package.json (packageManager and volta config)
  • .yarnrc (yarn-path)
  • Actual release file present at .yarn/releases/yarn-1.22.22.cjs
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for Yarn version consistency across config files

echo "Checking Yarn version in .yarnrc..."
if [ -f ".yarnrc" ]; then
  cat .yarnrc
fi

echo "Checking Yarn version in .yarnrc.yml..."
if [ -f ".yarnrc.yml" ]; then
  cat .yarnrc.yml
fi

echo "Checking actual Yarn release file..."
if [ -f ".yarn/releases/yarn-1.22.22.cjs" ]; then
  echo "Yarn 1.22.22 release file exists"
else
  echo "Yarn 1.22.22 release file not found"
fi

Length of output: 562

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 null checks and default values for environment variables

The direct assignment of environment variables could lead to runtime errors if any of these variables are undefined. Consider adding null checks and default values:

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]: process.env.MAINNET_SUBGRAPH_URL ?? throw new Error('MAINNET_SUBGRAPH_URL not set'),
+  [gnosis.id]: process.env.GNOSIS_SUBGRAPH_URL ?? throw new Error('GNOSIS_SUBGRAPH_URL not set'),
+  [sepolia.id]: process.env.SEPOLIA_SUBGRAPH_URL ?? throw new Error('SEPOLIA_SUBGRAPH_URL not set'),
+  [gnosisChiado.id]: process.env.CHIADO_SUBGRAPH_URL ?? throw new Error('CHIADO_SUBGRAPH_URL not set'),
};
📝 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
[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]: process.env.MAINNET_SUBGRAPH_URL ?? throw new Error('MAINNET_SUBGRAPH_URL not set'),
[gnosis.id]: process.env.GNOSIS_SUBGRAPH_URL ?? throw new Error('GNOSIS_SUBGRAPH_URL not set'),
[sepolia.id]: process.env.SEPOLIA_SUBGRAPH_URL ?? throw new Error('SEPOLIA_SUBGRAPH_URL not set'),
[gnosisChiado.id]: process.env.CHIADO_SUBGRAPH_URL ?? throw new Error('CHIADO_SUBGRAPH_URL not set'),

"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 is invalid as it doesn't exist. The latest version in the v18 series was 18.20.0.

-    "node": "18.20.5",
+    "node": "18.20.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.20.0",

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.

3 participants