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

♻️ Enhanced groups/organizations web-api specs and validation 🚨 #6640

Merged
merged 27 commits into from
Nov 5, 2024

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 30, 2024

What do these changes do?

During a debugging session with @odeimaiz, we observed that the Swagger site was displaying an incorrect interface for the /groups endpoints. The web API lacked properly defined OpenAPI Specifications (OAS) since this plugin hadn’t yet been updated to use Pydantic models.

This PR addresses the problem by updating the OAS generator code and models in api/webserver, ensuring the new OAS correctly represent the interface and is better documented. Additionally, it now introduces input validation in the handler functions through these models, which wasn’t in place before. For now, output validation is enabled only in debug mode.

We also manually verified all client calls to this resource in order to ensure compatibility with the frontend.

image
image

Related issue/s

How to test

  • Driving test
cd services/web/server
make install-dev
pytest -vv tests/unit/with_dbs/*/test_*group*.py
  • 🚨 Review manually front-end using functionality that calls GET /me and GET /group/*** (with @odeimaiz )

Dev-ops

None

@pcrespov pcrespov added a:webserver issue related to the webserver service a:api framework api, data schemas, labels Oct 30, 2024
@pcrespov pcrespov added this to the Caveman milestone Oct 30, 2024
@pcrespov pcrespov self-assigned this Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 88.50575% with 10 lines in your changes missing coverage. Please review.

Project coverage is 87.80%. Comparing base (2f0cfb0) to head (3977a66).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6640      +/-   ##
==========================================
- Coverage   87.93%   87.80%   -0.14%     
==========================================
  Files        1564     1405     -159     
  Lines       62950    59373    -3577     
  Branches     2104     1599     -505     
==========================================
- Hits        55358    52135    -3223     
+ Misses       7267     6979     -288     
+ Partials      325      259      -66     
Flag Coverage Δ
integrationtests 64.81% <25.53%> (-0.04%) ⬇️
unittests 85.65% <88.50%> (-0.26%) ⬇️
Components Coverage Δ
api 79.60% <ø> (ø)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 92.19% <100.00%> (+0.05%) ⬆️
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 71.44% <ø> (ø)
pkg_service_library 76.53% <ø> (ø)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.27% <ø> (ø)
agent 97.17% <ø> (ø)
api_server 89.82% <ø> (ø)
autoscaling 95.26% <ø> (ø)
catalog 89.52% <ø> (ø)
clusters_keeper 98.85% <ø> (ø)
dask_sidecar 91.32% <ø> (ø)
datcore_adapter 94.05% <ø> (ø)
director 58.43% <ø> (+0.04%) ⬆️
director_v2 90.81% <ø> (-0.10%) ⬇️
dynamic_scheduler 96.72% <ø> (ø)
dynamic_sidecar 89.79% <ø> (ø)
efs_guardian 90.00% <ø> (ø)
invitations 93.51% <ø> (ø)
osparc_gateway_server 85.15% <ø> (ø)
payments 93.09% <ø> (ø)
resource_usage_tracker 90.75% <ø> (ø)
storage 89.75% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 89.28% <78.72%> (-0.03%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f0cfb0...3977a66. Read the comment docs.

@pcrespov pcrespov force-pushed the mai/groups-api branch 2 times, most recently from df4cfb5 to 6463267 Compare November 1, 2024 16:59
@pcrespov pcrespov changed the title WIP: Mai/groups api ♻️ Enhanced groups/organizations web-api specs and validation 🚨 Nov 1, 2024
@pcrespov pcrespov mentioned this pull request Nov 1, 2024
3 tasks
@pcrespov pcrespov marked this pull request as ready for review November 1, 2024 18:15
@pcrespov pcrespov enabled auto-merge (squash) November 2, 2024 10:46
@pcrespov pcrespov disabled auto-merge November 2, 2024 10:46
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

thanks

@pcrespov pcrespov requested a review from GitHK November 4, 2024 12:11
Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Very nice! Thanks a lot for the effort

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

commented above

@pcrespov pcrespov requested a review from GitHK November 4, 2024 12:27
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

All good cleared in person

@pcrespov pcrespov enabled auto-merge (squash) November 5, 2024 14:33
Copy link

sonarcloud bot commented Nov 5, 2024

@pcrespov pcrespov merged commit 9c6068d into ITISFoundation:master Nov 5, 2024
97 of 100 checks passed
@pcrespov pcrespov deleted the mai/groups-api branch November 5, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: update the schemas for group resources
4 participants