-
Notifications
You must be signed in to change notification settings - Fork 47
Update FedEx regex pattern in fedex.json to support additional FedEx Express (34) tracking numbers #114
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
Conversation
Updates regex to accept 12 in addition to 10 as a valid prefix for FedEx Express (34). Checksums are still valid.
📝 WalkthroughWalkthroughThe FedEx Express regex pattern in the couriers configuration was updated to accept tracking numbers beginning with either "10" or "12" instead of only "10", expanding the range of valid prefixes recognized for this carrier. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
| "id": "fedex_34", | ||
| "regex": [ | ||
| "\\s*1\\s*0\\s*[0-9]\\s*[0-9]\\s*[0-9]\\s*", | ||
| "\\s*1\\s*[02]\\s*[0-9]\\s*[0-9]\\s*[0-9]\\s*", |
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.
🧩 Analysis chain
🏁 Script executed:
cat -n couriers/fedex.json | head -100Repository: jkeen/tracking_number_data
Length of output: 3333
🏁 Script executed:
# Search for any "12" prefix references related to FedEx
rg -i "fedex.*12|12.*fedex" -B2 -A2 --type jsonRepository: jkeen/tracking_number_data
Length of output: 380
🏁 Script executed:
# Search for FedEx Express tracking number format documentation or references
rg -i "express.*34|34.*express" --type json -B5 -A5Repository: jkeen/tracking_number_data
Length of output: 550
🏁 Script executed:
# Check if there are any test or documentation files mentioning FedEx format
fd -e md -e txt -e rst | xargs rg -l "fedex" -i 2>/dev/null || trueRepository: jkeen/tracking_number_data
Length of output: 92
🏁 Script executed:
cat README.md | head -100Repository: jkeen/tracking_number_data
Length of output: 12181
🏁 Script executed:
cat CHANGELOG.md | grep -i "fedex\|12.*prefix" -B3 -A3 | head -50Repository: jkeen/tracking_number_data
Length of output: 744
🏁 Script executed:
# Search for any tracking numbers with "12" prefix in test data
rg "\"12[0-9]{32}\"" -B2 -A2Repository: jkeen/tracking_number_data
Length of output: 52
🏁 Script executed:
rg -i "fedex.*express.*34|12.*prefix" --type json --type md -B3 -A3Repository: jkeen/tracking_number_data
Length of output: 2130
🏁 Script executed:
# Check git history to see if there's context about this change
git log --oneline --all | grep -i "fedex\|12" | head -20Repository: jkeen/tracking_number_data
Length of output: 1431
🏁 Script executed:
git show ce38c6c --statRepository: jkeen/tracking_number_data
Length of output: 2121
🏁 Script executed:
git show ce38c6cRepository: jkeen/tracking_number_data
Length of output: 50385
Add test numbers with "12" prefix to validate the regex expansion.
The regex now accepts tracking numbers beginning with "12" in addition to "10", but all test numbers (lines 78-85) start with "10". Without test coverage for the "12" prefix, the following cannot be verified:
- The regex correctly matches "12" prefixed tracking numbers
- The checksum algorithm validates these numbers correctly
- FedEx actually uses "12" as a valid prefix for Express (34) service
Add at least one valid test number starting with "12" to demonstrate that this prefix is legitimate and that checksum validation works correctly.
🤖 Prompt for AI Agents
In couriers/fedex.json around line 48 the regex was expanded to accept tracking
numbers beginning with "12" but the test vectors (lines ~78-85) only include
"10" prefixed numbers; add at least one valid test tracking number that starts
with "12" into the test array so the regex and checksum path are exercised.
Ensure the added "12..." value is a correctly formatted FedEx Express (34)
number that passes the existing checksum algorithm and include it alongside the
existing test numbers so CI verifies the new prefix end-to-end.
Updates regex to accept 12 in addition to 10 as a valid prefix for FedEx Express (34). Checksums are still valid.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.