Skip to content

Commit 1026a50

Browse files
committed
fix(metadata): update libphonenumber metadata to v9.0.31
- Regenerate main and short-number metadata from Google libphonenumber v9.0.31 - Add an issue #447 regression test for the Uganda +25679(4) mobile input - Document the metadata freshness check and verification results
1 parent ff86381 commit 1026a50

6 files changed

Lines changed: 5176 additions & 5131 deletions

File tree

docs/METADATA_UPDATE_LOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@ This file records upstream comparison results for metadata updates. Keep entries
44

55
Metadata-only updates should ship as patch releases. Use a minor release only when the update also adds public API, new modules, or additive behavior beyond metadata freshness.
66

7+
## 2026-05-23: Google libphonenumber v9.0.31
8+
9+
### Scope
10+
11+
- Previous local main, testing, and short-number metadata matched Google libphonenumber `v9.0.30`.
12+
- Updated main phone-number metadata to `v9.0.31`.
13+
- Updated short-number metadata to `v9.0.31`.
14+
- Testing metadata was unchanged between `v9.0.30` and `v9.0.31`.
15+
- Verified issue #447 with a bundled-metadata regression test using the issue-style Uganda mobile input `+25679(4)123456`.
16+
17+
### Issue #447 Verification
18+
19+
The Uganda mobile pattern changed from `9[0-3589]` to `9[0-589]`, which includes the `794` range.
20+
21+
The new regression test failed against the previous `v9.0.30` metadata because the parsed number was not valid for `UG` and its type was `UNKNOWN`. After regenerating from `v9.0.31`, the same issue-style input passed and classified the number as `MOBILE`.
22+
23+
### Commands
24+
25+
```bash
26+
swift scripts/checkMetadataFreshness.swift --output .build/metadata-freshness
27+
swift test --filter PhoneNumberSwiftCoreTests/testUganda794MobileRangeFromIssue447
28+
swift scripts/metadataGenerator.swift v9.0.31 --pretty
29+
swift test --filter PhoneNumberSwiftCoreTests/testUganda794MobileRangeFromIssue447
30+
swift test
31+
git diff --check
32+
swift scripts/checkMetadataFreshness.swift --current-ref v9.0.31 --output .build/metadata-freshness-v9.0.31
33+
```
34+
35+
### Results
36+
37+
- Freshness check found Google libphonenumber `v9.0.31` as the latest upstream tag.
38+
- Main phone-number metadata changed.
39+
- Short-number metadata changed.
40+
- Testing metadata was unchanged.
41+
- Issue #447 regression test: failed before the metadata update and passed after the metadata update.
42+
- SwiftPM tests: passed, 230 tests.
43+
- Whitespace check: passed.
44+
- Freshness re-check with `--current-ref v9.0.31`: metadata is up to date.
45+
746
## 2026-05-12: Google libphonenumber v9.0.30
847

948
### Scope

generatedJSON/PhoneNumberMetaData.json

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,7 +3588,7 @@
35883588
[
35893589
null,
35903590
null,
3591-
"264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",
3591+
"264(?:235|4(?:69|7[67])|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",
35923592
null,
35933593
null,
35943594
null,
@@ -8782,7 +8782,7 @@
87828782
[
87838783
null,
87848784
null,
8785-
"8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",
8785+
"(?:[2-7]\\d\\d|8001)\\d{5}",
87868786
null,
87878787
null,
87888788
null,
@@ -8817,7 +8817,7 @@
88178817
[
88188818
null,
88198819
null,
8820-
"[67]\\d{7}",
8820+
"(?:57|[67]\\d)\\d{6}",
88218821
null,
88228822
null,
88238823
null,
@@ -8917,7 +8917,7 @@
89178917
"(\\d)(\\d{7})",
89188918
"$1 $2",
89198919
[
8920-
"[235]|4[46]"
8920+
"[23]|4[46]|50"
89218921
],
89228922
null,
89238923
"0$CC $1"
@@ -8927,7 +8927,7 @@
89278927
"(\\d{8})",
89288928
"$1",
89298929
[
8930-
"[67]"
8930+
"[5-7]"
89318931
],
89328932
null,
89338933
"0$CC $1"
@@ -16215,7 +16215,7 @@
1621516215
[
1621616216
null,
1621716217
null,
16218-
"9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[013-689])\\d{6}",
16218+
"9619\\d{5}|(?:[1-3]\\d|4[013-689])\\d{6}",
1621916219
null,
1622016220
null,
1622116221
null,
@@ -16224,7 +16224,7 @@
1622416224
[
1622516225
null,
1622616226
null,
16227-
"(?:5(?:4[0-29]|5\\d|6[0-3])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",
16227+
"5(?:4[0-29]|6[0-3])\\d{6}|(?:55|6\\d|7[7-9])\\d{7}",
1622816228
null,
1622916229
null,
1623016230
null,
@@ -17685,7 +17685,7 @@
1768517685
[
1768617686
null,
1768717687
null,
17688-
"(?:11|[2-579]\\d)\\d{7}",
17688+
"(?:11|[2-57-9]\\d)\\d{7}",
1768917689
null,
1769017690
null,
1769117691
null,
@@ -17717,7 +17717,7 @@
1771717717
[
1771817718
null,
1771917719
null,
17720-
"700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|2[1-35-79]|3\\d|77|86|99)|9\\d\\d)\\d{6}",
17720+
"700[1-9]\\d{5}|(?:7(?:0[1-9]|1[0-8]|2[1-35-79]|3\\d|77|86|99)|(?:8[01]|9\\d)\\d)\\d{6}",
1772117721
null,
1772217722
null,
1772317723
null,
@@ -17809,7 +17809,7 @@
1780917809
"(\\d{2})(\\d{3})(\\d{4})",
1781017810
"$1 $2 $3",
1781117811
[
17812-
"[1-579]"
17812+
"[1-57-9]"
1781317813
],
1781417814
"0$1"
1781517815
]
@@ -19831,7 +19831,7 @@
1983119831
[
1983219832
null,
1983319833
null,
19834-
"5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-6])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|444)|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}",
19834+
"5(?:(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d|22252[0-4])\\d\\d|5(?:0(?:0(?:1[09]|70)|505)|1(?:0[01]0|1(?:07|33|51))|2(?:0[02]0|2[25]2)|3(?:0[03]0|3[35]3)|(?:40[04]|900)0|5222)[0-4]\\d{3}|(?:5(?:0(?:0(?:0\\d|1[12]|22|3[0-6]|44|5[05]|77|88|9[09])|(?:[14]\\d|77)\\d|22[02])|1(?:1(?:[03][01]|[124]\\d|5[2-6]|7[0-6])|4\\d\\d)|[23]555|4(?:4\\d\\d|555)|5(?:[0157-9]\\d\\d|200|333|4(?:44|55))|6[89]\\d\\d|7(?:(?:[0147-9]\\d|22)\\d|5(?:00|[57]5))|8(?:0(?:[018]\\d|2[0-4])|5(?:55|8[89])|8(?:55|88))|9(?:090|[1-35-9]\\d\\d))|790\\d\\d)\\d{4}",
1983519835
null,
1983619836
null,
1983719837
null,
@@ -20976,7 +20976,7 @@
2097620976
[
2097720977
null,
2097820978
null,
20979-
"(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-589]\\d\\d)\\d{3}",
20979+
"(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8[0-389]\\d\\d)\\d{3}",
2098020980
null,
2098120981
null,
2098220982
null,
@@ -20985,7 +20985,7 @@
2098520985
[
2098620986
null,
2098720987
null,
20988-
"556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[67])\\d{5}",
20988+
"556\\d{4}|(?:[23679]\\d|4[015]|5[0-489]|8[4-7])\\d{5}",
2098920989
null,
2099020990
null,
2099120991
null,
@@ -24954,9 +24954,6 @@
2495424954
null,
2495524955
[
2495624956
10
24957-
],
24958-
[
24959-
6
2496024957
]
2496124958
],
2496224959
[
@@ -50749,7 +50746,7 @@
5074950746
[
5075050747
null,
5075150748
null,
50752-
"(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",
50749+
"(?:2(?:1[26]|[28][2468]|[3-5][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",
5075350750
null,
5075450751
null,
5075550752
null,
@@ -50763,7 +50760,7 @@
5076350760
[
5076450761
null,
5076550762
null,
50766-
"561(?:011|61\\d)\\d{4}|5(?:[03-5]\\d|1[06]|24|7[45]|9[46])\\d{7}",
50763+
"561(?:011|61\\d)\\d{4}|5(?:[03-5]\\d|1[06]|24|6[24]|7[245]|9[46])\\d{7}",
5076750764
null,
5076850765
null,
5076950766
null,
@@ -50884,9 +50881,7 @@
5088450881
"(\\d{3})(\\d{3})(\\d{2})(\\d{2})",
5088550882
"$1 $2 $3 $4",
5088650883
[
50887-
"5(?:[0-579]|61)",
50888-
"5(?:[0-579]|61[06])",
50889-
"5(?:[0-579]|61[06]1)"
50884+
"5[0-79]"
5089050885
],
5089150886
"0$1",
5089250887
null,
@@ -50932,9 +50927,7 @@
5093250927
"(\\d{3})(\\d{3})(\\d{2})(\\d{2})",
5093350928
"$1 $2 $3 $4",
5093450929
[
50935-
"5(?:[0-579]|61)",
50936-
"5(?:[0-579]|61[06])",
50937-
"5(?:[0-579]|61[06]1)"
50930+
"5[0-79]"
5093850931
],
5093950932
"0$1",
5094050933
null,
@@ -52139,7 +52132,7 @@
5213952132
[
5214052133
null,
5214152134
null,
52142-
"72[48]0\\d{5}|7(?:[014-8]\\d|2[0167]|3[06]|9[0-3589])\\d{6}",
52135+
"72[48]0\\d{5}|7(?:[014-8]\\d|2[0167]|3[06]|9[0-589])\\d{6}",
5214352136
null,
5214452137
null,
5214552138
null,
@@ -53949,7 +53942,7 @@
5394953942
[
5395053943
null,
5395153944
null,
53952-
"(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[1689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",
53945+
"121[0-3]\\d{5}|(?:160|(?:3\\d|7[06-9])\\d|5(?:[1689]\\d|2[238]|59)|8(?:[1-8]\\d|9[6-9])|9(?:[0-8]\\d|9[013-9]))\\d{6}",
5395353946
null,
5395453947
null,
5395553948
null,
@@ -54083,7 +54076,7 @@
5408354076
"(\\d{4})(\\d{4,6})",
5408454077
"$1 $2",
5408554078
[
54086-
"1"
54079+
"1(?:2[02]|[89])"
5408754080
],
5408854081
null,
5408954082
null,
@@ -54094,7 +54087,7 @@
5409454087
"(\\d{2})(\\d{3})(\\d{2})(\\d{2})",
5409554088
"$1 $2 $3 $4",
5409654089
[
54097-
"6"
54090+
"1[26]|6"
5409854091
],
5409954092
"0$1",
5410054093
null,
@@ -54151,7 +54144,7 @@
5415154144
"(\\d{4})(\\d{4,6})",
5415254145
"$1 $2",
5415354146
[
54154-
"1"
54147+
"1(?:2[02]|[89])"
5415554148
],
5415654149
null,
5415754150
null,
@@ -54162,7 +54155,7 @@
5416254155
"(\\d{2})(\\d{3})(\\d{2})(\\d{2})",
5416354156
"$1 $2 $3 $4",
5416454157
[
54165-
"6"
54158+
"1[26]|6"
5416654159
],
5416754160
"0$1",
5416854161
null,

generatedJSON/ShortNumberMetadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14114,7 +14114,7 @@
1411414114
[
1411514115
null,
1411614116
null,
14117-
"1(?:0\\d{2,3}|1(?:[2-57-9]|6(?:000|111))|3[39]|4(?:82|9\\d{1,3})|5(?:00|1[58]|2[25]|3[03]|44|[59])|60|8[67]|9(?:[01]|2[2-9]|4\\d|696))|4(?:2323|5045)|(?:1(?:2|92[01])|4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d",
14117+
"1(?:0\\d{2,3}|1(?:[2-57-9]|6(?:000|111))|3[39]|4(?:82|9\\d{1,3})|5(?:00|1[58]|2[25]|3[03]|44|[59])|60|8[67]|9(?:[01]|2[2-9]|4\\d|696))|4(?:2323|5045)|14\\d|(?:1(?:2|92[01])|4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d",
1411814118
null,
1411914119
null,
1412014120
null,

0 commit comments

Comments
 (0)