-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: testnets
Are you sure you want to change the base?
Conversation
…d node and yarn version
Moved subgraph config to env variables (except codegen)
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
env.d.tsOops! 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. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by WalkthroughThe 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 Changes
Poem
Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for proof-of-humanity-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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 endpointsWhile 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 styleThere'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
⛔ 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 errorsThe 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 typescriptLength 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.jsonLength 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 endpointThe schema URL has changed significantly:
- Organization: 64099 -> 61738
- Project: proof-of-humanity-mainnet -> poh-origin-mainnet
Please verify:
- Schema compatibility between old and new endpoints
- Data consistency and availability
- 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.jsonLength 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" fiLength of output: 562
[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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
[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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
"node": "18.20.5", | |
"node": "18.20.0", |
Summary by CodeRabbit
Configuration Updates
.gitignore
to improve Yarn file trackingDevelopment Improvements