Skip to content

Conversation

@bramp
Copy link

@bramp bramp commented Oct 18, 2025

Summary by CodeRabbit

  • New Features

    • YunExpress is now a supported courier for package tracking, including recognition of its 18-character serial numbers.
  • Documentation

    • Updated the supported carriers list to include YunExpress.
    • Added top-level guidance for courier definition JSON files, describing expected fields and examples for defining couriers and tracking number formats.

@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

Walkthrough

Adds YunExpress as a supported courier by introducing couriers/yunexpress.json and updates README.md with a YunExpress entry and new top-level guidance about couriers/*.json JSON format.

Changes

Cohort / File(s) Summary
Documentation Update
README.md
Added YunExpress to the "Supported Tracking Numbers" table (mentions an 18-character SerialNumber) and added a new top-level bullet under "JSON Format" describing couriers/*.json fields and guidance.
YunExpress Courier Configuration
couriers/yunexpress.json
New courier definition: name: "YunExpress", courier_code: "yunexpress", tracking_numbers: array with one entry (id: "yunexpress", name: "YunExpress"), tracking_url: https://www.yuntrack.com/parcelTracking?id=%s, regex: pattern capturing a 16-digit serial (with optional spaces), empty validation object, and test_numbers including valid (with/without spaces) and an invalid example.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A parcel hops, a json gleams,
YunExpress joins our tracking dreams.
Regex neat and test cases bright,
Docs updated, ready for flight.
Hooray — small change, big delight! ✨📦

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 pull request title "feat: Added support for YunExpress tracking numbers" directly and clearly reflects the main changes in the changeset. The primary modifications include adding a new YunExpress courier definition file (couriers/yunexpress.json) and updating the README to document this new supported tracking number. The title is concise, specific, and uses clear language without vague terms or noise. A teammate scanning the commit history would immediately understand that YunExpress tracking support was added to the project.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85895e1 and 9bae43b.

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • couriers/yunexpress.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • couriers/yunexpress.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

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.

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: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

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

📒 Files selected for processing (2)
  • README.md (1 hunks)
  • couriers/yunexpress.json (1 hunks)
🔇 Additional comments (3)
couriers/yunexpress.json (2)

13-22: Test numbers validation looks correct.

The test numbers align well with the regex pattern:

  • Valid examples have exactly 16 digits (plus YT prefix = 18 total)
  • Spaced variant correctly shows optional spaces are handled
  • Invalid example with only 15 digits correctly fails the pattern

9-12: YunExpress regex follows existing pattern but conflicts with documented requirement—requires developer decision.

The regex indeed lacks a CheckDigit named group, which contradicts the README requirement at line 61. However, this violation is not unique: three other courier files already deployed lack CheckDigit:

  • amazon.json
  • landmark.json
  • lasership.json

Additionally, the README's own tracking number table (lines 14–33) lists many couriers with only SerialNumber, contradicting the stated requirement. No code-level validation was found enforcing this requirement.

Decide whether to:

  1. Remove/relax the requirement from README line 61 (reflecting actual codebase reality)
  2. Add CheckDigit groups to all four files (yunexpress, amazon, landmark, lasership)
  3. Document that CheckDigit is optional for carriers without checksums
README.md (1)

48-48: Formatting change appears reasonable.

The blank line after "## JSON Format" separates the section header from the content, improving readability.

| **UPS** | UPS | 18 | `1Z5R89390357567127` | `SerialNumber` `CheckDigit` `ShipperId` `ServiceType` `PackageId` |
| | UPS Waybill | 11 | `K2479825491` `V0490119172` | `ServiceType` `SerialNumber` `CheckDigit` |
| **USPS** | USPS 20 | 20 | `0307 1790 0005 2348 3741` | `ServiceType` `ShipperId` `PackageId` `CheckDigit` |
| **YunExpress** | YunExpress | 18 | `YT2229521272164446` | `SerialNumber` |
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

YunExpress table entry is in the wrong position.

The entry is currently inserted between "UPS Waybill" (line 41) and "USPS 22" (line 43), breaking the alphabetical carrier grouping. YunExpress should be added after all USPS entries (which end at line 45), not in the middle of them.

The carrier order should be: ...UPS Waybill | USPS 20 | USPS 22 | USPS 34v2 | USPS 91 | YunExpress.

Move the YunExpress row to follow the USPS entries. The correct insertion point is after line 45 (USPS 91 entry):

| **USPS**         | USPS 91 (IMpb)            | 25–34  | `420221539101026837331000039521` `9361289878700317633795` | `RoutingApplicationId` `DestinationZip` `ApplicationIdentifier` `SCNC` `ServiceType` `ShipperId` `PackageId` `CheckDigit` |
+| **YunExpress**   | YunExpress                | 18     | `YT2229521272164446`                                      | `SerialNumber`                                                                                                            |

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In README.md around lines 42 to 45, the YunExpress table row is misplaced
between "UPS Waybill" and "USPS 22"; move the entire YunExpress row (the line
currently at 42) so it appears after the USPS entries (i.e., insert it
immediately after line 45 where the USPS 91 entry ends) to restore correct
alphabetical carrier grouping.

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