-
Notifications
You must be signed in to change notification settings - Fork 189
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
fix(torii-grpc-server): adjust regex to support variable len correctly #2803
Conversation
WalkthroughOhayo, sensei! This pull request introduces several enhancements to the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🔇 Additional comments (1)crates/torii/grpc/src/server/mod.rs (1)
Ohayo, sensei! Verify the correctness of the regex pattern The updated regex pattern may not match the intended keys correctly. Please ensure that the regex accurately captures variable-length keys and that any special characters are properly escaped. Run the following script to test the regex pattern against sample keys: ✅ Verification successfulLet me check the actual regex pattern being constructed in the code to ensure it matches our test pattern. Ohayo! The regex pattern is perfectly valid, sensei! The code constructs a correct regex pattern that:
Our test results confirmed that it successfully matches various key patterns:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Test the updated regex pattern against sample keys
# Sample keys to test
sample_keys=(
"0x1/"
"0x1/0x2/"
"0x1/0x2/0x3/"
"0x1/0x2/0x3/0x4/"
)
# Regex pattern generated by the code
regex_pattern='^0x[0-9a-fA-F]+(\/0x[0-9a-fA-F]+)*\/$'
echo "Testing regex pattern: $regex_pattern"
for key in "${sample_keys[@]}"; do
if [[ "$key" =~ $regex_pattern ]]; then
echo "Matched: $key"
else
echo "Did not match: $key"
fi
done
Length of output: 822 Script: #!/bin/bash
# Find the KEY_PATTERN definition and the context around the regex construction
rg "KEY_PATTERN\s*=\s*" -A 5 -B 5
Length of output: 35 Script: #!/bin/bash
# Let's try a broader search for KEY_PATTERN
rg "KEY_PATTERN" -B 5 -A 5
# Also search for the specific line we're reviewing
rg "keys_pattern \+= &format!" -B 5 -A 5
Length of output: 2756 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
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2803 +/- ##
=======================================
Coverage 55.75% 55.75%
=======================================
Files 439 439
Lines 55572 55572
=======================================
Hits 30982 30982
Misses 24590 24590 ☔ View full report in Codecov by Sentry. |
Use correct regex to have
VariableLen
correctly retrieving the entities.Summary by CodeRabbit