-
Notifications
You must be signed in to change notification settings - Fork 38
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
Old Dominion support #103
base: main
Are you sure you want to change the base?
Old Dominion support #103
Conversation
…zing them Maybe the third digit is irrelevant and just coincidental that our existing data always had 777?
The old URL redirects to something new, but not that actually offers the tracking you'd be looking for.
…zing them This does introduce a conflict with DHL, however.
WalkthroughThe changes introduce new configurations for Old Dominion Freight Line tracking numbers and add a Luhn algorithm validation method to Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- couriers/old_dominion.json (1 hunks)
- spec/spec_helper.rb (2 hunks)
Additional comments not posted (5)
couriers/old_dominion.json (4)
2-19
: Configuration for "Old Dominion" looks good.The regex pattern, validation method, and tracking URL are correctly defined.
36-49
: Configuration for "Old Dominion Guaranteed Shipment" looks good.The regex pattern, validation method, and tracking URL are correctly defined.
21-32
: Verify test numbers for "Old Dominion".Ensure that the provided test numbers adequately cover various scenarios, including edge cases.
Verification successful
Test numbers for "Old Dominion" verified.
The
couriers/old_dominion.json
file contains both valid and invalid test numbers, covering various formats and scenarios.
- File:
couriers/old_dominion.json
- Lines: 21-32
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that test numbers cover various scenarios for "Old Dominion". # Test: Check the presence of valid and invalid test numbers. rg --type json -A 5 $'\"valid\": \[ \"07209562763\", \" 0 7 2 0 9 5 6 2 7 6 3 \", \"77767553207\", \"77806528897\", \"78045768393\" \]'Length of output: 326
Script:
#!/bin/bash # Description: Verify that test numbers cover various scenarios for "Old Dominion". # Test: Check the presence of valid and invalid test numbers with multiline mode enabled. rg --type json --multiline -A 5 $'\"valid\": \[ \"07209562763\", \" 0 7 2 0 9 5 6 2 7 6 3 \", \"77767553207\", \"77806528897\", \"78045768393\" \]'Length of output: 146
Script:
#!/bin/bash # Description: Verify the presence of the `valid` and `invalid` keys and their values in the `old_dominion.json` file. # Search for the `valid` key in the file and display its context. rg --type json --multiline -A 10 '"valid": \[' # Search for the `invalid` key in the file and display its context. rg --type json --multiline -A 5 '"invalid": \['Length of output: 21486
51-59
: Verify test numbers for "Old Dominion Guaranteed Shipment".Ensure that the provided test numbers adequately cover various scenarios, including edge cases.
spec/spec_helper.rb (1)
18-37
: Implementation ofvalidates_luhn?
looks correct.The method correctly implements the Luhn algorithm for checksum validation.
I've been maintaining this for a while privately, but figured it was worth trying to upstream.
I'm not confident on the actual regex for the tracking numbers, as this is largely based just on some example tracking (pro) numbers I've seen. I've gradually had to tweak the regex to accommodate new tracking numbers.
One of the valid tracking numbers I included (78045768393) does match both Old Dominion and DHL, however DHL's website doesn't recognize the tracking number, so maybe DHL is too loose (or maybe it's a possible DHL number, they just haven't used it yet).
Summary by CodeRabbit
New Features
Enhancements