Repository navigation
Fix the Checkout block rejecting 4-digit Argentine postcodes - #69658
Conversation
The 3.10.22 bump that came with the postcode unification made the province letter mandatory for Argentina, so the Checkout block started rejecting legacy codes like 1213 that the Store API still accepts. Argentina is not in the shared rules file, so the block falls back to the package regex. Every shared-rule country that differs between the two versions is overridden, so the regenerated artifact only changes its generatedFrom version. Jest now pins the Argentine fallback.
Testing GuidelinesHi @jorgeatorres @senadir @woocommerce/rubik @woocommerce/monorepo, Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a commit that changes plugin code. |
|
Size Change: 0 B 🆕 Total Size: 0 B |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Checkout block’s ChangesArgentine postcode validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No concrete merge-blocking risk is established. The change targets acceptance of legacy Argentine postcodes, and the review found no supported additional country mismatch. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
IMPORTANT: Merging this PR to the appropriate branches is critical to the release process and ensures that the bug does not cause regressions in the future releases. Cherry picking was successful for |
Submission Review Guidelines:
Changes proposed in this Pull Request:
A shopper in Argentina who types a four-digit postcode such as
1213in the Checkout block sees "Please enter a valid postcode" and cannot place the order. It happens since 11.2.0, while the Store API accepts the same value.The Checkout block accepts the legacy four-digit Argentine codes again, as it did in 11.1.
postcode-validatorpackage. Unify postcode validation between PHP and Checkout blocks #67780 bumped it from 3.9.2 to 3.10.22, where the Argentina regex made the province letter mandatory. The server has no rule for Argentina.Closes #69643
Closes WOOPLUG-7949
Bug introduced in PR #67780.
How to test the changes in this Pull Request:
1213in Postcode / ZIP and leave the field. On trunk the field shows "Please enter a valid postcode"; with this PR there is no error and the order goes through.C1213ABCis accepted on both;142still shows the error.Testing that has already taken place:
1213,7540rejected) and pass on 3.9.2; the validation and checkout form suites pass (291 tests).generatedFrom.versionline.pnpm install --frozen-lockfilepasses. ESLint clean.1213shows no error, the shipping options load, and the order is placed with postcode1213on both addresses.142shows "Please enter a valid postcode".Milestone
Changelog entry
Automatically create a changelog entry from the details below.
This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment
Comment
Created manually.
Use of AI Tools
I used Claude Code for the investigation and the change, and I reviewed the diff.