-
Notifications
You must be signed in to change notification settings - Fork 35
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
Remove old phonenumber validation #5294
Conversation
07014d8
to
f096108
Compare
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.
Hey, nice work!
I think we just need to look into there 3-digit numbers for service contact details - as we probably still want to support these?
@pytest.mark.parametrize( | ||
"short_number, allowed", | ||
( | ||
("119", True), |
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.
I think the question should be - are there valid cases where service's contact number is a three-digit number?
It looks like it might be from this list? https://www.inyourarea.co.uk/news/10-three-digit-phone-numbers-and-what-theyre-for
For example Track and Trace had a 3-digit number, and there are some other ones.
I wonder how we previously validated this?
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.
This is an easy fix, and it's an exception to pure libphonenumber
validation I'm okay with adding. We can either have an allow list, or just say "any 3 digit number that successfully parses to a "possible" UK number, we are just going to say is valid"
bf3a83f
to
6fa938c
Compare
requirements.in
Outdated
@@ -17,7 +17,7 @@ notifications-python-client==10.0.0 | |||
fido2==1.1.3 | |||
|
|||
# Run `make bump-utils` to update to the latest version | |||
notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@f676a72f212ba9d8b1e8cc4dc5fd3211a2214960 | |||
notifications-utils @ git+https://github.com/alphagov/notifications-utils.git@de4d6573a0dfb5969156b5a7595f00c54f492cc0 |
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.
needs updating to semver'd tag once that has been merged
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.
Looks great, nicely done with contact phone numbers validation 🙌🏼
Ready to merge when utils are merged and requirements updated 👍🏼
6f49f33
to
2e3ef21
Compare
2e3ef21
to
b951ef6
Compare
145b99f
to
b2787c3
Compare
4b47593
to
d1bbfb0
Compare
d1bbfb0
to
965511a
Compare
…ed code utils 95.0.0 removes the old custom phone number validation code and replaces it with a rich class backed against libphonenumbe. This makes our phone number validation more readable and more robust.
Some of the numbers used in our unit tests are actually invalid when validated against libphonenumbers metadata catalogues. These have been changed to actually valid numbers to make sure our tests pass. Also adds a test for non-emergency numbers with extensions as libphonenumber does not natively accept extensions and these need to be supported for emergency contact lists.
legacy emergency contact lists are known to contain invalid numbers. We do not want this to cause sending to the entire list to fail, so this will bypass validation against libphonenumber entirely for emergency contact lists while ensuring new uploads of all CSVs are validated properly
965511a
to
5c45eb0
Compare
No description provided.