Skip to content
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

Handle URL rewriting for ZGW import/export #1395

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

swrichards
Copy link
Contributor

@swrichards swrichards commented Sep 11, 2024

Taiga issues.

Essentially, what this does is rewrite all ZGW URLs in the import file to have the same URL root as the service on the target instance (matched on slug).

This is not an especially pretty or general-purpose fix, but it should solve the specific problem for Groningen (who is the only intended user of the feature thus far).

@swrichards swrichards force-pushed the tasks/2726-zgw-import-fixes branch 5 times, most recently from 5c16d2c to 513be5c Compare September 11, 2024 14:26
@swrichards swrichards marked this pull request as ready for review September 11, 2024 14:45
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 96.22642% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.25%. Comparing base (839dccf) to head (358c9c7).
Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
src/open_inwoner/openzaak/import_export.py 90.90% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1395   +/-   ##
========================================
  Coverage    95.24%   95.25%           
========================================
  Files         1008     1008           
  Lines        37364    37463   +99     
========================================
+ Hits         35589    35684   +95     
- Misses        1775     1779    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
src/open_inwoner/openzaak/import_export.py Outdated Show resolved Hide resolved
self.service = ServiceFactory(slug="service-0")
ServiceFactory(slug="service-1")
self.service = ServiceFactory(
slug="service-0", api_root="https://foo.0.maykinmedia.nl"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slug="service-0", api_root="https://foo.0.maykinmedia.nl"
slug="service-foo", api_root="https://foo.maykinmedia.nl"

I find foo and bar more readable than foo.0 and foo.1. Would need to be changed below as well, though.

slug="service-0", api_root="https://foo.0.maykinmedia.nl"
)
self.other_service = ServiceFactory(
slug="service-1", api_root="https://foo.1.maykinmedia.nl"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slug="service-1", api_root="https://foo.1.maykinmedia.nl"
slug="service-bar", api_root="https://bar.maykinmedia.nl"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit pressed for time in this sprint, will fix this if I have a bit of spare time end-of-sprint (but it might be good to review the other changes).

src/open_inwoner/openzaak/tests/test_import_export.py Outdated Show resolved Hide resolved
@alextreme alextreme merged commit a3fe4be into develop Sep 13, 2024
19 checks passed
@alextreme alextreme deleted the tasks/2726-zgw-import-fixes branch September 13, 2024 14:31
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.

4 participants