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

♻️ Maintenance/new settings (2nd round) #2739

Merged
merged 33 commits into from
Jan 14, 2022

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 13, 2022

What do these changes do?

This is the second of a series of PR that will progressively introduce the new-settings (i.e. move from trafaret to settings_library ) in the entire repo.

In previous PR #2736 we mainly extended the settings-library with new settings classes and utils.

Instead, this PR will focus on replacing trafaret from the web-server. There are over 20 plugins affected by the configuration so the goal of the PR is only to isolate dependencies without breaking the app.

The trafaret-based configuration of the webserver is based on the composition of schemas for each plugin, typically individually defined in *_config.py, into a single application schema in application_config. In order to isolate the dependences, we will split each configuration module into two: *_schema and *settings, such that

  • *_schema: keeps trafaret's schema only. This way trafaret import is isolated here.
  • *config.py: keeps constants and helper functions to access config section stored in app.
  • *settings: placeholder for future service-settings library based settings (some already contain some pydantic settings).

Therefore, after this refactoring every plugin will look either

  • folder-like plugin
plugin/
     _schema.py
     config.py
     ...
     module_setup.py
     settings.py
  • or analogously for flat plugin:
plugin__schema.py
plugin_config.py
...
plugin_settings.py
plugin.py

Next PR in the series will include the settings-library in the webserver and create settings for each of the library in the *settings.py module.

NOTE: @mrnicegyu11 , @Surfict : in the next rounds, the env vars to configure osparc-simcore might be affected so I will start adding you as reviewers.

Related issue/s

How to test

all webserver tests affected

@pcrespov pcrespov self-assigned this Jan 13, 2022
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #2739 (616ad26) into master (102d185) will increase coverage by 0.2%.
The diff coverage is 97.5%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2739     +/-   ##
========================================
+ Coverage    78.0%   78.3%   +0.2%     
========================================
  Files         652     677     +25     
  Lines       26963   27011     +48     
  Branches     2617    2617             
========================================
+ Hits        21051   21160    +109     
+ Misses       5197    5144     -53     
+ Partials      715     707      -8     
Flag Coverage Δ
integrationtests 65.6% <95.0%> (+0.7%) ⬆️
unittests 74.1% <95.9%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...server/src/simcore_service_webserver/_resources.py 100.0% <ø> (ø)
...r/src/simcore_service_webserver/activity/config.py 100.0% <ø> (ø)
...rc/simcore_service_webserver/application_config.py 85.0% <ø> (-4.6%) ⬇️
...er/src/simcore_service_webserver/catalog_config.py 100.0% <ø> (ø)
...rc/simcore_service_webserver/computation_config.py 88.8% <ø> (-5.9%) ⬇️
.../server/src/simcore_service_webserver/db_config.py 100.0% <ø> (ø)
.../simcore_service_webserver/diagnostics_settings.py 100.0% <ø> (ø)
...rver/src/simcore_service_webserver/email_config.py 100.0% <ø> (ø)
...r/src/simcore_service_webserver/projects/config.py 100.0% <ø> (ø)
...mcore_service_webserver/resource_manager/config.py 100.0% <ø> (ø)
... and 73 more

@pcrespov pcrespov added a:webserver issue related to the webserver service t:maintenance Some planned maintenance work labels Jan 13, 2022
@pcrespov pcrespov marked this pull request as ready for review January 13, 2022 19:08
@pcrespov pcrespov added this to the Rudolph milestone Jan 13, 2022
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.

None yet

3 participants