-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add DHL eCommerce 14-digit format #104
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes involve updating the regex pattern for validating DHL E-Commerce tracking numbers in the Changes
Assessment against linked issues
🐰 In the land of DHL, the numbers now flow, 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 Configuration 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 (1)
- couriers/dhl.json (1 hunks)
Additional comments not posted (3)
couriers/dhl.json (3)
51-54
: LGTM!The changes to the
regex
field enhance the flexibility of the tracking number validation by accommodating a new format. The new regex pattern is correctly implemented.The code changes are approved.
62-64
: LGTM!The addition of new valid tracking numbers helps in validating the new regex pattern. The tracking numbers are correctly formatted.
The code changes are approved.
Line range hint
1-65
: LGTM!The overall structure and consistency of the file are maintained. The changes are well-integrated within the existing configuration.
The code changes are approved.
"regex": "\\s*((GM)|(LX)|(RX)|(UV)|(CN)|(SG)|(TH)|(IN)|(HK)|(MY))\\s*(?<SerialNumber>([0-9]\\s*){10,39})", | ||
"regex": [ | ||
"(\\s*((GM)|(LX)|(RX)|(UV)|(CN)|(SG)|(TH)|(IN)|(HK)|(MY))\\s*(?<SerialNumber>([0-9]\\s*){10,39}))", | ||
"|^(?<SerialNumber>([0-9]){14})$" |
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.
@jkeen this pattern matches USPS 20-digit numbers (and possibly other formats), and apparently there is no validation mechanism (mod7/luhn/etc). So it seems we need to be clever.
As you see here, I tried wrapping it in line start/end syntax (^/$). However, this makes it un-usable for search
blocks of text, and it fails the should_detect_number_variants
test. Seems like the line start/end synax must be removed. Any ideas on how to modify this pattern so it does NOT match USPS 20-digits?
@dan-jensen has this ever made it over the finish line? |
@fthobe no, I wasn't sure how to proceed. My resolution was to stop using DHL eCommerce. |
Did you migrate to regular DHL or to a different carrier entirely |
@fthobe we try to avoid DHL entirely now. Their technology is such a mess it's almost un-usable. For example, their API frequently returns an error saying our account does not allow shipments to be purchased in a specific country, even though our DHL account rep says it should work. We tried to work with them for 18 months and finally gave up. |
They have a tendency to overpromise and underdeliver as all carriers. Any of them you have made better experience? |
@fthobe haven't encountered any that are great, but FedEx and UPS are usable. I'm hopeful Amazon opens up to the public at some point, I think they would be great. |
This is intended to add support for DHL eCommerce tracking numbers that are 14 digits, which exist in Europe if nowhere else. This resolves jkeen/tracking_number#83
WARNING: Do not merge, there is a problem to resolve.
Summary by CodeRabbit
New Features
Bug Fixes