Skip to content

Conversation

@michaelyork
Copy link

@michaelyork michaelyork commented Dec 23, 2025

Updates regex to accept 12 in addition to 10 as a valid prefix for FedEx Express (34). Checksums are still valid.

Summary by CodeRabbit

  • Bug Fixes
    • Improved FedEx Express tracking number validation to recognize an expanded range of valid tracking number formats. This update enhances shipment identification accuracy during lookups and ensures more reliable package tracking results for users.

✏️ Tip: You can customize this high-level summary in your review settings.

Updates regex to accept 12 in addition to 10 as a valid prefix for FedEx Express (34). Checksums are still valid.
@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
FedEx configuration
couriers/fedex.json
Updated FedEx Express (34) regex pattern to accept "1[02]" prefix instead of "10", allowing both "10" and "12" as valid starting digits for tracking number validation

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A pattern tweak, both nimble and neat,
From one single path to digits that repeat,
Ten or twelve now pass through the gate,
FedEx shipments match their new fate,
A regex update, simple yet great!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the FedEx regex pattern to support additional tracking numbers, which aligns with the PR objective of accepting '12' in addition to '10' as a valid prefix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@michaelyork michaelyork changed the title Update FedEx regex pattern in fedex.json Update FedEx regex pattern in fedex.json to support additional FedEx Express (34) tracking numbers Dec 23, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 802d8a5 and ce38c6c.

📒 Files selected for processing (1)
  • couriers/fedex.json

"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*",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n couriers/fedex.json | head -100

Repository: 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 json

Repository: 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 -A5

Repository: 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 || true

Repository: jkeen/tracking_number_data

Length of output: 92


🏁 Script executed:

cat README.md | head -100

Repository: jkeen/tracking_number_data

Length of output: 12181


🏁 Script executed:

cat CHANGELOG.md | grep -i "fedex\|12.*prefix" -B3 -A3 | head -50

Repository: 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 -A2

Repository: jkeen/tracking_number_data

Length of output: 52


🏁 Script executed:

rg -i "fedex.*express.*34|12.*prefix" --type json --type md -B3 -A3

Repository: 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 -20

Repository: jkeen/tracking_number_data

Length of output: 1431


🏁 Script executed:

git show ce38c6c --stat

Repository: jkeen/tracking_number_data

Length of output: 2121


🏁 Script executed:

git show ce38c6c

Repository: 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:

  1. The regex correctly matches "12" prefixed tracking numbers
  2. The checksum algorithm validates these numbers correctly
  3. 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.

@michaelyork michaelyork closed this by deleting the head repository Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant