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

Delete zds-client usage #89

Merged
merged 10 commits into from
Mar 26, 2024
Merged

Conversation

sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Mar 25, 2024

Closes #88

This removes the library code that uses zds_client library in some form. Lots of breaking changes here!

Tested against Open Forms via open-formulieren/open-forms#4059 and the test suite as good as passes (failures need to be addressed internally).

I wanted to test this against the following projects too, but they either depend on notifications-api-common (which uses gemma-zds-client) or need to address the breaking changes :/

  • Open Inwoner
  • Open Zaak
  • Archiefbeheercomponent

get_catalogi and get_informatieobjecttypen appear to not be used
in any of our projects. Users who do make use of this are advised
to copy the code from 0.31.0 to their own projects or libraries.
Downstream projects/libraries should implement this functionality
themselves, as it turns out it is not as common as initially
anticipated.
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 91.93548% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 76.07%. Comparing base (323f50a) to head (50429dd).

Files Patch % Lines
zgw_consumers/legacy/__init__.py 40.00% 3 Missing ⚠️
zgw_consumers/cache.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   74.22%   76.07%   +1.85%     
==========================================
  Files          40       40              
  Lines        1575     1513      -62     
  Branches      223      218       -5     
==========================================
- Hits         1169     1151      -18     
+ Misses        337      296      -41     
+ Partials       69       66       -3     

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

We're dropping the zds_client dependency, which removes our requirement to
handle OpenAPI specifications, thus we can/should also remove our cache
handling for schemas.
Removed because it's unused in our own projects. If you do make use of this,
you can instead use the equivalent code:

```py
client = Service.get_client(some_resource_url)
```
Better typing support and still emits the runtime warning.
Added a check for the legacy module that zds-client is installed,
since the dependency is now moved into an optional group.

TODO: vendor the ClientAuth in zgw-consumers directly instead
of relying on zds-client.
These are tightly coupled to zds-client. Rather than changing their
signature, we opt to deprecate them and provide the alternatives
to use.
This allows us to drop the dependency on zds-client entirely
@sergei-maertens sergei-maertens force-pushed the refactor/remove-zds-client-usage branch from dad0227 to 16a4011 Compare March 25, 2024 14:02
…model

Environments/projects that don't use zds-client anymore already
do not need to be burdened with these fields. This approach makes
it safe to not break on run-time and allows opt-in for project
that know what they're doing.
@sergei-maertens sergei-maertens force-pushed the refactor/remove-zds-client-usage branch from 1352e9b to 50429dd Compare March 25, 2024 15:16
@sergei-maertens sergei-maertens marked this pull request as ready for review March 25, 2024 15:56
@sergei-maertens sergei-maertens requested a review from Viicos March 25, 2024 15:56
zgw_consumers/cache.py Show resolved Hide resolved
zgw_consumers/admin.py Show resolved Hide resolved
@sergei-maertens sergei-maertens merged commit cff5c29 into main Mar 26, 2024
10 checks passed
@sergei-maertens sergei-maertens deleted the refactor/remove-zds-client-usage branch March 26, 2024 12:00
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.

Remove zds-client usage
2 participants