Skip to content

Commit 9f13c75

Browse files
authored
Merge branch 'master' into fix/public-api-solvers-pagination
2 parents 5a7b63d + 5028e5a commit 9f13c75

File tree

9 files changed

+26
-13
lines changed

9 files changed

+26
-13
lines changed

.env-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ WEBSERVER_EMAIL={}
379379
WEBSERVER_EXPORTER={}
380380
WEBSERVER_FOLDERS=1
381381
WEBSERVER_FRONTEND={}
382+
WEBSERVER_FUNCTIONS=1
382383
WEBSERVER_GARBAGE_COLLECTOR=null
383384
WEBSERVER_GROUPS=1
384385
WEBSERVER_GUNICORN_CMD_ARGS=--timeout=180

services/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ services:
847847
WEBSERVER_ANNOUNCEMENTS: ${WEBSERVER_ANNOUNCEMENTS}
848848
WEBSERVER_NOTIFICATIONS: ${WEBSERVER_NOTIFICATIONS}
849849
WEBSERVER_CLUSTERS: ${WEBSERVER_CLUSTERS}
850+
WEBSERVER_FUNCTIONS: 0
850851
WEBSERVER_GROUPS: ${WEBSERVER_GROUPS}
851852
WEBSERVER_PRODUCTS: ${WEBSERVER_PRODUCTS}
852853
WEBSERVER_PUBLICATIONS: ${WEBSERVER_PUBLICATIONS}
@@ -892,6 +893,8 @@ services:
892893
WEBSERVER_HOST: ${WB_API_WEBSERVER_HOST}
893894
WEBSERVER_PORT: ${WB_API_WEBSERVER_PORT}
894895
WEBSERVER_STATICWEB: "null"
896+
WEBSERVER_FUNCTIONS: ${WEBSERVER_FUNCTIONS}
897+
895898

896899
networks: *webserver_networks
897900

@@ -937,6 +940,7 @@ services:
937940
WEBSERVER_EXPORTER: ${WB_DB_EL_EXPORTER}
938941
WEBSERVER_FOLDERS: ${WB_DB_EL_FOLDERS}
939942
WEBSERVER_FRONTEND: ${WB_DB_EL_FRONTEND}
943+
WEBSERVER_FUNCTIONS: 0
940944
WEBSERVER_GARBAGE_COLLECTOR: ${WB_DB_EL_GARBAGE_COLLECTOR}
941945
WEBSERVER_GROUPS: ${WB_DB_EL_GROUPS}
942946
WEBSERVER_INVITATIONS: ${WB_DB_EL_INVITATIONS}
@@ -1049,6 +1053,7 @@ services:
10491053
WEBSERVER_EXPORTER: ${WB_GC_EXPORTER}
10501054
WEBSERVER_FOLDERS: ${WB_GC_FOLDERS}
10511055
WEBSERVER_FRONTEND: ${WB_GC_FRONTEND}
1056+
WEBSERVER_FUNCTIONS: 0
10521057
WEBSERVER_GARBAGE_COLLECTOR: ${WB_GC_GARBAGE_COLLECTOR}
10531058
WEBSERVER_GROUPS: ${WB_GC_GROUPS}
10541059
WEBSERVER_HOST: ${WEBSERVER_HOST}

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
108108
WEBSERVER_FUNCTIONS: Annotated[
109109
bool,
110110
Field(
111-
json_schema_extra={_X_FEATURE_UNDER_DEVELOPMENT: True},
111+
description="Metamodeling functions plugin",
112112
),
113-
] = True
113+
] = False
114114

115115
WEBSERVER_LOGLEVEL: Annotated[
116116
LogLevel,

services/web/server/src/simcore_service_webserver/exception_handling/_factory.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
_logger = logging.getLogger(__name__)
1515

1616

17-
_STATUS_CODE_TO_HTTP_ERRORS: dict[
18-
int, type[web.HTTPError]
19-
] = get_all_aiohttp_http_exceptions(web.HTTPError)
17+
_STATUS_CODE_TO_HTTP_ERRORS: dict[int, type[web.HTTPError]] = (
18+
get_all_aiohttp_http_exceptions(web.HTTPError)
19+
)
2020

2121

2222
class _DefaultDict(dict):
@@ -40,7 +40,8 @@ def create_error_response(error: ErrorGet, status_code: int) -> web.Response:
4040
return web.json_response(
4141
data={"error": error.model_dump(exclude_unset=True, mode="json")},
4242
dumps=json_dumps,
43-
reason=error.message,
43+
# NOTE: Multiline not allowed in HTTP reason attribute (aiohttp now raises ValueError)
44+
reason=error.message.replace("\n", " ") if error.message else None,
4445
status=status_code,
4546
)
4647

services/web/server/src/simcore_service_webserver/exporter/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ class SDSException(HTTPBadRequest): # pylint: disable=too-many-ancestors
66
"""Basic exception for errors raised inside the module"""
77

88
def __init__(self, message: str):
9-
super().__init__(reason=message)
9+
# Multiline not allowed in HTTP reason attribute
10+
super().__init__(reason=message.replace("\n", " ") if message else None)

services/web/server/tests/unit/isolated/test_application_settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,11 @@ class DevSettings(ApplicationSettings):
141141

142142
if is_dev_feature_enabled:
143143
assert settings.WEBSERVER_DEV_FEATURES_ENABLED is True
144-
assert settings.WEBSERVER_FUNCTIONS is True
145144

146145
assert settings.TEST_FOO is True
147146
assert settings.TEST_BAR == 42
148147
else:
149148
assert settings.WEBSERVER_DEV_FEATURES_ENABLED is False
150-
assert settings.WEBSERVER_FUNCTIONS is False
151149

152150
assert settings.TEST_FOO is False
153151
assert settings.TEST_BAR is None

services/web/server/tests/unit/with_dbs/04/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44

55

66
import pytest
7+
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
78

89

910
@pytest.fixture
1011
def app_environment(
1112
app_environment: dict[str, str], monkeypatch: pytest.MonkeyPatch
1213
) -> dict[str, str]:
1314
# NOTE: overrides app_environment
14-
monkeypatch.setenv("WEBSERVER_GARBAGE_COLLECTOR", "null")
15-
return app_environment | {"WEBSERVER_GARBAGE_COLLECTOR": "null"}
15+
return setenvs_from_dict(
16+
monkeypatch,
17+
{
18+
**app_environment,
19+
"WEBSERVER_GARBAGE_COLLECTOR": "null",
20+
"WEBSERVER_FUNCTIONS": "0", # needs rabbitmq
21+
},
22+
)

services/web/server/tests/unit/with_dbs/04/functions_rpc/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def app_environment(
2222
monkeypatch,
2323
{
2424
**app_environment, # WARNING: AFTER env_devel_dict because HOST are set to 127.0.0.1 in here
25-
"WEBSERVER_DEV_FEATURES_ENABLED": "1",
2625
"WEBSERVER_FUNCTIONS": "1",
2726
},
2827
)

services/web/server/tests/unit/with_dbs/04/studies_dispatcher/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ def app_environment(app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatc
2222
{
2323
"WEBSERVER_ACTIVITY": "null",
2424
"WEBSERVER_CATALOG": "null",
25-
"WEBSERVER_NOTIFICATIONS": "0",
2625
"WEBSERVER_DIAGNOSTICS": "null",
2726
"WEBSERVER_EXPORTER": "null",
27+
"WEBSERVER_FUNCTIONS": "0",
2828
"WEBSERVER_GROUPS": "1",
29+
"WEBSERVER_NOTIFICATIONS": "0",
2930
"WEBSERVER_PRODUCTS": "1",
3031
"WEBSERVER_PUBLICATIONS": "0",
3132
"WEBSERVER_RABBITMQ": "null",

0 commit comments

Comments
 (0)