-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#2069] Upgrade KvK Zoeken API to v2 #1016
Conversation
src/open_inwoner/kvk/validators.py
Outdated
regexes = ( | ||
re.compile(r"^https://api.kvk.nl/api$"), | ||
re.compile(r"^https://api.kvk.nl/api/$"), | ||
re.compile(r"^https://api.kvk.nl/test/api$"), | ||
re.compile(r"^https://api.kvk.nl/test/api/$"), | ||
) |
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.
If we're going to restrict the API root to these values, I think it's better to define choices
for the field and let people select one of these four.
I'm trying to think of a case where we'd want to use something else but can't really come up with one, is it necessary though to restrict the API root to these four values? It would be a hassle if we have to do a new release just to allow a different value here 🤔
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 made the validation more general. I couldn't think of any reason for supporting other roots, but better safe than sorry.
7fc50e9
to
ae0d71a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1016 +/- ##
===========================================
+ Coverage 94.83% 94.90% +0.06%
===========================================
Files 880 885 +5
Lines 30704 30766 +62
===========================================
+ Hits 29119 29197 +78
+ Misses 1585 1569 -16 ☔ View full report in Codecov by Sentry. |
9323f16
to
9dcc55a
Compare
* Add validation for api root (exclude version number + endpoint) * Fix tests to ensure that api endpoints are constructed properly
* strip version number from existing API roots
9dcc55a
to
814b815
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.
Minor remark regarding mocks.simple
. Looks good otherwise 👍
It might be useful for us at some point in the future to look into adding VCR.py (https://vcrpy.readthedocs.io/en/latest/), to deal with mocks and to make them more realistic instead of having to maintain them manually. Open Forms uses this as well
# via | ||
# -r requirements/base.in | ||
# mail-editor |
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 probably from another PR? Doesn't actually change anything though, so it's fine
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.
Double-checked: I branched off upgrade/django-admin-index
instead of develop when starting on this. The PR has been merged though.
814b815
to
2ca5293
Compare
Taiga: #2069