From 9e34583703f55b285fc5656edb540b9f78a1bb0f Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:59:14 +0100 Subject: [PATCH 1/3] mark as dev --- .../src/simcore_service_webserver/projects/_trash_handlers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/web/server/src/simcore_service_webserver/projects/_trash_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_trash_handlers.py index 5defa97c927..2995488c562 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_trash_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_trash_handlers.py @@ -14,6 +14,7 @@ from servicelib.status_codes_utils import is_5xx_server_error from .._meta import API_VTAG as VTAG +from ..application_settings_utils import requires_dev_feature_enabled from ..login.decorators import get_user_id, login_required from ..products.api import get_product_name from ..projects._common_models import ProjectPathParams @@ -102,6 +103,7 @@ async def _wrapper(request: web.Request) -> web.StreamResponse: @routes.delete(f"/{VTAG}/trash", name="empty_trash") +@requires_dev_feature_enabled @login_required @permission_required("project.delete") @_handle_request_exceptions @@ -117,6 +119,7 @@ async def empty_trash(request: web.Request): @routes.post(f"/{VTAG}/projects/{{project_id}}:trash", name="trash_project") +@requires_dev_feature_enabled @login_required @permission_required("project.delete") @_handle_request_exceptions @@ -140,6 +143,7 @@ async def trash_project(request: web.Request): @routes.post(f"/{VTAG}/projects/{{project_id}}:untrash", name="untrash_project") +@requires_dev_feature_enabled @login_required @permission_required("project.delete") @_handle_request_exceptions From de55c356e37a6cd300d05ce38ac97d4b96c51a9f Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:00:53 +0100 Subject: [PATCH 2/3] updates tests --- .../web/server/tests/unit/with_dbs/03/test_trash.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/web/server/tests/unit/with_dbs/03/test_trash.py b/services/web/server/tests/unit/with_dbs/03/test_trash.py index e10dc0065f1..5a760d5f9fd 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_trash.py +++ b/services/web/server/tests/unit/with_dbs/03/test_trash.py @@ -18,12 +18,23 @@ from models_library.rest_pagination import Page from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status +from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict +from pytest_simcore.helpers.typing_env import EnvVarsDict from pytest_simcore.helpers.webserver_login import UserInfoDict from servicelib.aiohttp import status from simcore_service_webserver.db.models import UserRole from simcore_service_webserver.projects.models import ProjectDict +@pytest.fixture +def app_environment( + app_environment: EnvVarsDict, monkeypatch: pytest.MonkeyPatch +) -> EnvVarsDict: + return app_environment | setenvs_from_dict( + monkeypatch, {"WEBSERVER_DEV_FEATURES_ENABLED": "1"} + ) + + @pytest.fixture def user_role() -> UserRole: return UserRole.USER From 3e74bb3fccbcf8aabb35ccb9f500b7ca663aabda Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:02:56 +0100 Subject: [PATCH 3/3] updates codecov --- .codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codecov.yml b/.codecov.yml index 6e9caac4b87..341e18a09bd 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -18,6 +18,7 @@ flag_management: component_management: default_rules: + carryforward: true statuses: - type: project target: auto