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

⬆️ Upgrade Web Server service (Pydantic v2) #6584

Conversation

giancarloromeo
Copy link
Contributor

@giancarloromeo giancarloromeo commented Oct 23, 2024

What do these changes do?

Upgrade the Web Server service to Pydantic v2.

Related issue/s

How to test

make devenv
source .venv/bin/activate
cd services/web/server
make install-dev
make mypy
make test-dev-unit

Dev-ops checklist

@giancarloromeo giancarloromeo changed the base branch from master to pydantic_v2_migration_do_not_squash_updates October 23, 2024 11:52
@giancarloromeo giancarloromeo self-assigned this Oct 23, 2024
@giancarloromeo giancarloromeo added a:webserver issue related to the webserver service t:maintenance Some planned maintenance work labels Oct 23, 2024
@giancarloromeo giancarloromeo added this to the MartinKippenberger milestone Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 68.83%. Comparing base (24218c1) to head (c7d5f0c).
Report is 2 commits behind head on pydantic_v2_migration_do_not_squash_updates.

Additional details and impacted files
@@                               Coverage Diff                               @@
##           pydantic_v2_migration_do_not_squash_updates    #6584      +/-   ##
===============================================================================
- Coverage                                        71.63%   68.83%   -2.81%     
===============================================================================
  Files                                             1100      954     -146     
  Lines                                            49250    42328    -6922     
  Branches                                          1390     1300      -90     
===============================================================================
- Hits                                             35281    29136    -6145     
+ Misses                                           13736    12968     -768     
+ Partials                                           233      224       -9     
Flag Coverage Δ *Carryforward flag
integrationtests 65.02% <ø> (+0.24%) ⬆️ Carriedforward from 399abc8
unittests 77.96% <0.00%> (-4.98%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.32% <ø> (ø)
pkg_dask_task_models_library 96.61% <ø> (ø)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library 83.79% <ø> (ø)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 70.00% <ø> (ø)
pkg_service_library 76.51% <0.00%> (ø)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.41% <ø> (ø)
agent 97.22% <ø> (ø)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter 93.17% <ø> (ø)
director 58.38% <ø> (ø)
director_v2 76.21% <ø> (ø)
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 59.64% <ø> (ø)
efs_guardian 90.10% <ø> (ø)
invitations 93.49% <ø> (ø)
osparc_gateway_server 79.52% <ø> (ø)
payments ∅ <ø> (∅)
resource_usage_tracker 87.51% <ø> (ø)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 59.88% <ø> (+0.18%) ⬆️

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 24218c1...c7d5f0c. Read the comment docs.

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.

great job! thanks!

Comment on lines 71 to 78
last_page = ceil(total / limit) - 1

data = [item.model_dump() if hasattr(item, "model_dump") else item for item in chunk]

return PageDict(
_meta=PageMetaInfoLimitOffset(
total=total, count=len(chunk), limit=limit, offset=offset
total=total, count=len(data), limit=limit, offset=offset
),
Copy link
Member

Choose a reason for hiding this comment

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

not sure I understand that change. chunk is a list, so why does it need a change?

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.

I have some concerns that might cause issues. Please see them below.

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Thanks!!

@@ -54,7 +63,7 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
# CODE STATICS ---------------------------------------------------------
API_VERSION: str = API_VERSION
APP_NAME: str = APP_NAME
API_VTAG: VersionTag = parse_obj_as(VersionTag, API_VTAG)
API_VTAG: VersionTag = TypeAdapter(VersionTag).validate_python(API_VTAG)
Copy link
Member

Choose a reason for hiding this comment

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

MINOR: in next PRs we can refactor all ApplicationSettings to inherit from settings_library.application.BaseApplicationSettings. That base class includes all env vars expected from the Dockerfile

services/web/server/src/simcore_service_webserver/cli.py Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Nov 6, 2024

@giancarloromeo giancarloromeo merged commit 8402270 into ITISFoundation:pydantic_v2_migration_do_not_squash_updates Nov 6, 2024
52 of 74 checks passed
@giancarloromeo giancarloromeo deleted the is4481/upgrade-web-server-service branch November 6, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants