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

zgw-consumers refactor #38

Merged
merged 39 commits into from
Nov 22, 2024
Merged

zgw-consumers refactor #38

merged 39 commits into from
Nov 22, 2024

Conversation

SonnyBA
Copy link

@SonnyBA SonnyBA commented Oct 24, 2024

Fixes #7
Partially fixes maykinmedia/open-api-framework#66

Upgrading zgw-consumers to ensure we can upgrade zgw consumers in Open Zaak: open-zaak/open-zaak#1800

docs/ref/client.rst Outdated Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
vng_api_common/migrations/0006_delete_apicredential.py Outdated Show resolved Hide resolved
vng_api_common/models.py Outdated Show resolved Hide resolved
vng_api_common/oas.py Show resolved Hide resolved
vng_api_common/models.py Outdated Show resolved Hide resolved
vng_api_common/models.py Outdated Show resolved Hide resolved
vng_api_common/notifications/models.py Outdated Show resolved Hide resolved
vng_api_common/utils.py Outdated Show resolved Hide resolved
@SonnyBA
Copy link
Author

SonnyBA commented Oct 25, 2024

Also tackles #7

stevenbal and others added 25 commits October 25, 2024 17:04
notifications-api-common has changed its underlying client to ape_pie.APIClient due to a zgw-consumers update (maykinmedia/notifications-api-common#15)
To make them match with notifications-api-common>=0.3.0
This can be useful for Openzaak instances where these paths are used
These definitions are included in `notifications-api-common`
AuthorizationsConfig model

Removed models should be imported from notifications-api-common
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 62.13592% with 39 lines in your changes missing coverage. Please review.

Project coverage is 55.51%. Comparing base (9563533) to head (d73f24c).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
vng_api_common/client.py 53.84% 16 Missing and 2 partials ⚠️
vng_api_common/authorizations/middleware.py 16.66% 10 Missing ⚠️
vng_api_common/notifications/handlers.py 0.00% 6 Missing ⚠️
vng_api_common/routers.py 0.00% 3 Missing ⚠️
vng_api_common/mocks.py 0.00% 1 Missing ⚠️
vng_api_common/views.py 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   54.95%   55.51%   +0.55%     
==========================================
  Files          79       80       +1     
  Lines        3632     3599      -33     
  Branches      590      470     -120     
==========================================
+ Hits         1996     1998       +2     
+ Misses       1533     1499      -34     
+ Partials      103      102       -1     

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


🚨 Try these New Features:

@stevenbal stevenbal force-pushed the feature/update-notifs-client branch from 23015e8 to f3fe4ee Compare November 8, 2024 10:21
@stevenbal stevenbal marked this pull request as ready for review November 8, 2024 10:40
Copy link
Author

@SonnyBA SonnyBA left a comment

Choose a reason for hiding this comment

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

Github won't let me approve (because I'm the owner of the PR), but this looks good 👍

docs/ref/client.rst Outdated Show resolved Hide resolved
vng_api_common/models.py Show resolved Hide resolved
return auth


class ClientConfig(SingletonModel):

Choose a reason for hiding this comment

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

Why is this abstract model deleted? I'm pretty sure it's used in Open Zaak. Maybe just change api_root to be a FK to Service model instead of the url

Copy link

@stevenbal stevenbal Nov 14, 2024

Choose a reason for hiding this comment

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

I've replaced the usage of it in Open Zaak with a regular SingletonModel with a service, it feels a bit unnecessary to have an abstract model that only contains a FK to Service imo

vng_api_common/notifications/constants.py Show resolved Hide resolved
vng_api_common/notifications/models.py Show resolved Hide resolved
vng_api_common/validators.py Outdated Show resolved Hide resolved
vng_api_common/utils.py Outdated Show resolved Hide resolved
vng_api_common/oas.py Show resolved Hide resolved
Comment on lines +41 to +42
blank=True,
null=True,

Choose a reason for hiding this comment

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

I do think it should not be nullable.

Choose a reason for hiding this comment

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

I've added a migration to remove null=True

Copy link

@stevenbal stevenbal Nov 14, 2024

Choose a reason for hiding this comment

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

Hmm upon second thought, this does make calling .get_solo() problematic (in tests for example), because you cannot add a default value for this, so we might have to keep it nullable :/

Used for the ResourceValidator, which verifies if objects have the
correct shape as defined in an OAS.
@SonnyBA
Copy link
Author

SonnyBA commented Nov 13, 2024

@stevenbal I added 44a4032 today, as I noticed the configuration view was broken (incorrectly stated services were reachable) by the changes made in this PR. They were not picked up by the tests though, so I also added/updated some tests.

@stevenbal stevenbal force-pushed the feature/update-notifs-client branch from 6bd8cfe to 5d331a6 Compare November 14, 2024 15:23
Copy link

@annashamray annashamray left a comment

Choose a reason for hiding this comment

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

Looks good!

setup.cfg Outdated Show resolved Hide resolved
stevenbal and others added 2 commits November 22, 2024 10:05
this checked for vng_api_common.notifications, but should check notifications_api_common since the notifications code moved there
@stevenbal stevenbal self-requested a review November 22, 2024 10:18
@stevenbal stevenbal merged commit 9e81e1e into main Nov 22, 2024
6 checks passed
@stevenbal stevenbal deleted the feature/update-notifs-client branch November 22, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ZGW Consumers must be updated in all projects Remove APICredential-based machinery
4 participants