-
Notifications
You must be signed in to change notification settings - Fork 51
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
Change VITE_PUBLIC_SLOT for landing #2627
Conversation
Hi @bob0005! You need to be added as a user to interact with me. Please ask @ponderingdemocritus to add you on the settings page. You are receiving this comment because I am set to review all PRs. That is configurable here. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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
client/apps/landing/env.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 a new environment variable Changes
Sequence DiagramsequenceDiagram
participant Env as Environment Config
participant Provider as StarknetProvider
participant App as Application
Env->>Provider: Provide VITE_PUBLIC_SLOT
Provider->>App: Use dynamic slot value
Poem
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 (
|
Failed to generate code suggestions for PR |
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
🔭 Outside diff range comments (1)
client/apps/landing/.env.production (1)
Line range hint
1-5
:⚠️ Security: Sensitive data exposed in version controlThis file contains sensitive information that should not be in version control:
- Private keys (VITE_PUBLIC_MASTER_PRIVATE_KEY)
- Contract addresses
- Account class hashes
Consider:
- Moving sensitive data to a secure secret management system
- Using placeholder values in the committed file
- Adding the file to .gitignore
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
client/apps/landing/.env.preview
(1 hunks)client/apps/landing/.env.production
(1 hunks)client/apps/landing/.env.sample
(1 hunks)client/apps/landing/.env.sepolia
(1 hunks)client/apps/landing/env.ts
(1 hunks)client/apps/landing/src/components/providers/starknet-provider.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- client/apps/landing/.env.preview
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Run pr agent on every pull request, respond to user comments
🔇 Additional comments (3)
client/apps/landing/src/components/providers/starknet-provider.tsx (1)
18-18
: Verify the impact of dynamic slot configuration.The change from hardcoded value to environment variable is correct. However, since this affects the cartridge controller configuration:
- Ensure all environments have appropriate slot values configured
- Verify that the cartridge controller handles empty slot values gracefully
Let's verify the cartridge controller's usage of this slot value:
client/apps/landing/.env.sample (1)
18-18
: LGTM! Sample environment variable added correctly.The addition of
VITE_PUBLIC_SLOT
to the sample environment file is appropriate, allowing developers to configure their own slot value.client/apps/landing/.env.production (1)
19-19
: LGTM! Variable addition follows conventions.The new
VITE_PUBLIC_SLOT
variable is properly configured for the production environment and follows the existing naming conventions.
|
||
VITE_PUBLIC_SLOT: z.string(), |
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.
💡 Codebase verification
Environment template files missing for new VITE_PUBLIC_SLOT variable
The new environment variable has been added to the schema, but there are no template files or documentation to guide its setup. This could cause issues for:
- New developer onboarding
- CI/CD pipeline configuration
- Environment setup across different stages (development, production)
Please:
- Create a
.env.example
file inclient/apps/landing
with the expected format - Document the required value and its purpose in the README.md
- Ensure all deployment environments are updated with this new variable
🔗 Analysis chain
LGTM! Verify environment configuration.
The addition of VITE_PUBLIC_SLOT
to the schema is correct. Let's verify its presence across all environment files:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if VITE_PUBLIC_SLOT is present in all environment files
# Expected: VITE_PUBLIC_SLOT should be present in all .env files
echo "Checking .env files for VITE_PUBLIC_SLOT:"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing --exec grep -l "VITE_PUBLIC_SLOT" {} \;
Length of output: 229
Script:
#!/bin/bash
# First, let's see what environment files actually exist
echo "Listing all environment files:"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing
# Then, let's look at their content (excluding any sensitive values)
echo -e "\nChecking environment file contents (showing only VITE_ variables):"
fd -e env -e env.sample -e env.preview -e env.production -e env.sepolia . client/apps/landing --exec sh -c 'echo "\n=== {} ==="; grep "^VITE_" {} || true' \;
Length of output: 476
Script:
#!/bin/bash
# Look for environment template files and documentation
echo "Searching for environment templates and setup instructions:"
fd -e example -e template -e sample . client/apps/landing
echo -e "\nChecking for README files that might contain setup instructions:"
fd README -e md . client/apps/landing
echo -e "\nIf README exists, checking its content for environment setup instructions:"
fd README -e md . client/apps/landing --exec sh -c 'echo "\n=== {} ==="; cat {} | grep -A 5 -i "env" || true' \;
Length of output: 1148
@@ -17,7 +17,7 @@ VITE_REALMS_ADDRESS=0xd2674cc335684896f2b1f942e6929611acab4dc07aa03d0371226812bb | |||
VITE_LORDS_ADDRESS=0x342ad5cc14002c005a5cedcfce2bd3af98d5e7fb79e9bf949b3a91cf145d72e | |||
|
|||
VITE_PUBLIC_CHAIN=sepolia | |||
|
|||
VITE_PUBLIC_SLOT= |
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.
💡 Codebase verification
Empty VITE_PUBLIC_SLOT values need attention
The verification confirms that VITE_PUBLIC_SLOT
is empty in multiple environments:
.env.sepolia
: empty value.env.preview
: empty value.env.sample
: empty value
For reference, production uses the value eternum-prod
, suggesting a naming pattern that could be followed (e.g., eternum-sepolia
for Sepolia environment).
🔗 Analysis chain
Provide a default slot value for Sepolia environment.
The VITE_PUBLIC_SLOT
is currently empty in the Sepolia environment configuration. Since this value is required for the cartridge controller configuration, please provide an appropriate default value.
Let's check the slot values across different environments:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Compare slot values across different environments
# Expected: Each environment should have an appropriate slot value
echo "Checking slot values across environments:"
fd -e env.sepolia -e env.production -e env.preview . client/apps/landing --exec sh -c 'echo "=== {} ==="; grep "VITE_PUBLIC_SLOT" {} || echo "Not found"'
Length of output: 248
Script:
#!/bin/bash
# First, find all environment-related files
echo "=== Finding environment files ==="
fd -t f "^\.env" client/apps/landing
# Then, check content of each file for any SLOT-related variables
echo -e "\n=== Checking SLOT-related variables ==="
fd -t f "^\.env" client/apps/landing --exec sh -c 'echo "=== {} ==="; grep -i "slot" {} || echo "No SLOT variables found"'
Length of output: 751
Script:
#!/bin/bash
# Search for environment files including hidden ones
echo "=== Finding environment files ==="
fd -H -t f "^\.env" client/apps/landing
# Check content with improved error handling
echo -e "\n=== Checking SLOT-related variables ==="
fd -H -t f "^\.env" client/apps/landing --exec sh -c '
echo "=== {} ===";
if [ -f "{}" ]; then
grep -i "slot" "{}" 2>/dev/null || echo "No SLOT variables found"
else
echo "File not readable"
fi
'
Length of output: 811
Summary by CodeRabbit
Configuration
VITE_PUBLIC_SLOT
across multiple environment configuration filesStarknetProvider
to dynamically use theVITE_PUBLIC_SLOT
value instead of a hardcoded slotEnvironment