Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr-osparc-redirec…
Browse files Browse the repository at this point in the history
…t-service-restart-containers
  • Loading branch information
Andrei Neagu committed Dec 17, 2024
2 parents c7e7956 + acd677a commit 4e397da
Show file tree
Hide file tree
Showing 370 changed files with 9,168 additions and 4,477 deletions.
10 changes: 5 additions & 5 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ flag_management:
statuses:
- type: project
target: auto
threshold: 1%
threshold: 2%
- type: patch
target: auto
threshold: 1%
threshold: 2%


component_management:
Expand All @@ -22,7 +22,7 @@ component_management:
statuses:
- type: project
target: auto
threshold: 1%
threshold: 2%
branches:
- "!master"
individual_components:
Expand Down Expand Up @@ -116,12 +116,12 @@ coverage:
project:
default:
informational: true
threshold: 1%
threshold: 2%

patch:
default:
informational: true
threshold: 1%
threshold: 2%

comment:
layout: "header,diff,flags,components,footer"
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ jobs:
if: ${{ !cancelled() }}
run: ./ci/github/unit-testing/catalog.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -879,7 +879,7 @@ jobs:
if: ${{ !cancelled() }}
run: ./ci/github/unit-testing/datcore-adapter.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -930,7 +930,7 @@ jobs:
if: ${{ !cancelled() }}
run: ./ci/github/unit-testing/director.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -981,7 +981,7 @@ jobs:
if: ${{ !cancelled() }}
run: ./ci/github/unit-testing/director-v2.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -1910,7 +1910,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/webserver.bash test 01
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -1974,7 +1974,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/webserver.bash test 02
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2038,7 +2038,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/director-v2.bash test 01
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2111,7 +2111,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/director-v2.bash test 02
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2177,7 +2177,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/dynamic-sidecar.bash test 01
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2241,7 +2241,7 @@ jobs:
- name: test
run: ./ci/github/integration-testing/simcore-sdk.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2330,7 +2330,7 @@ jobs:
- name: test
run: ./ci/github/system-testing/public-api.bash test
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down Expand Up @@ -2395,7 +2395,7 @@ jobs:
name: ${{ github.job }}_services_settings_schemas
path: ./services/**/settings-schema.json
- name: upload failed tests logs
if: ${{ !cancelled() }}
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}_docker_logs
Expand Down
2 changes: 1 addition & 1 deletion api/specs/web-server/_projects_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
ServiceResourcesDict,
)
from models_library.generics import Envelope
from models_library.groups import GroupID
from models_library.projects import ProjectID
from models_library.projects_nodes_io import NodeID
from models_library.users import GroupID
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.projects._crud_handlers import ProjectPathParams
from simcore_service_webserver.projects._nodes_handlers import (
Expand Down
46 changes: 23 additions & 23 deletions api/specs/web-server/_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
from typing import Annotated

from fastapi import APIRouter, Depends, status
from models_library.api_schemas_webserver.users import MyProfileGet, MyProfilePatch
from models_library.api_schemas_webserver.users import (
MyPermissionGet,
MyProfileGet,
MyProfilePatch,
MyTokenCreate,
MyTokenGet,
UserGet,
UsersSearchQueryParams,
)
from models_library.api_schemas_webserver.users_preferences import PatchRequestBody
from models_library.generics import Envelope
from models_library.user_preferences import PreferenceIdentifier
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.users._handlers import PreUserProfile, _SearchQueryParams
from simcore_service_webserver.users._common.schemas import PreRegisteredUserGet
from simcore_service_webserver.users._notifications import (
UserNotification,
UserNotificationCreate,
UserNotificationPatch,
)
from simcore_service_webserver.users._notifications_handlers import (
_NotificationPathParams,
)
from simcore_service_webserver.users._schemas import UserProfile
from simcore_service_webserver.users._tokens_handlers import _TokenPathParams
from simcore_service_webserver.users.schemas import (
PermissionGet,
ThirdPartyToken,
TokenCreate,
)
from simcore_service_webserver.users._notifications_rest import _NotificationPathParams
from simcore_service_webserver.users._tokens_rest import _TokenPathParams

router = APIRouter(prefix=f"/{API_VTAG}", tags=["user"])

Expand Down Expand Up @@ -63,32 +63,32 @@ async def replace_my_profile(_profile: MyProfilePatch):
status_code=status.HTTP_204_NO_CONTENT,
)
async def set_frontend_preference(
preference_id: PreferenceIdentifier, # noqa: ARG001
body_item: PatchRequestBody, # noqa: ARG001
preference_id: PreferenceIdentifier,
body_item: PatchRequestBody,
):
...


@router.get(
"/me/tokens",
response_model=Envelope[list[ThirdPartyToken]],
response_model=Envelope[list[MyTokenGet]],
)
async def list_tokens():
...


@router.post(
"/me/tokens",
response_model=Envelope[ThirdPartyToken],
response_model=Envelope[MyTokenGet],
status_code=status.HTTP_201_CREATED,
)
async def create_token(_token: TokenCreate):
async def create_token(_token: MyTokenCreate):
...


@router.get(
"/me/tokens/{service}",
response_model=Envelope[ThirdPartyToken],
response_model=Envelope[MyTokenGet],
)
async def get_token(_params: Annotated[_TokenPathParams, Depends()]):
...
Expand Down Expand Up @@ -131,30 +131,30 @@ async def mark_notification_as_read(

@router.get(
"/me/permissions",
response_model=Envelope[list[PermissionGet]],
response_model=Envelope[list[MyPermissionGet]],
)
async def list_user_permissions():
...


@router.get(
"/users:search",
response_model=Envelope[list[UserProfile]],
response_model=Envelope[list[UserGet]],
tags=[
"po",
],
)
async def search_users(_params: Annotated[_SearchQueryParams, Depends()]):
async def search_users(_params: Annotated[UsersSearchQueryParams, Depends()]):
# NOTE: see `Search` in `Common Custom Methods` in https://cloud.google.com/apis/design/custom_methods
...


@router.post(
"/users:pre-register",
response_model=Envelope[UserProfile],
response_model=Envelope[UserGet],
tags=[
"po",
],
)
async def pre_register_user(_body: PreUserProfile):
async def pre_register_user(_body: PreRegisteredUserGet):
...
2 changes: 1 addition & 1 deletion api/specs/web-server/_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
WalletPaymentInitiated,
)
from models_library.generics import Envelope
from models_library.groups import GroupID
from models_library.rest_pagination import Page, PageQueryParameters
from models_library.users import GroupID
from models_library.wallets import WalletID
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.wallets._groups_api import WalletGroupGet
Expand Down
3 changes: 2 additions & 1 deletion packages/aws-library/src/aws_library/ec2/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ async def launch_instances(
)
instance_ids = [i["InstanceId"] for i in instances["Instances"]]
_logger.info(
"New instances launched: %s, waiting for them to start now...",
"%s New instances launched: %s, waiting for them to start now...",
len(instance_ids),
instance_ids,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
""" Utils to operate with dicts """
""" A collection of free functions to manipulate dicts
"""

from copy import deepcopy
from typing import Any, Mapping
from collections.abc import Mapping
from copy import copy, deepcopy
from typing import Any

ConfigDict = dict[str, Any]

def remap_keys(data: dict, rename: dict[str, str]) -> dict[str, Any]:
"""A new dict that renames the keys of a dict while keeping the values unchanged
NOTE: Does not support renaming of nested keys
"""
return {rename.get(k, k): v for k, v in data.items()}


def get_from_dict(obj: Mapping[str, Any], dotted_key: str, default=None) -> Any:
Expand All @@ -28,10 +36,10 @@ def copy_from_dict(
#

if include is None:
return deepcopy(data) if deep else data.copy()
return deepcopy(data) if deep else copy(data)

if include == ...:
return deepcopy(data) if deep else data.copy()
return deepcopy(data) if deep else copy(data)

if isinstance(include, set):
return {key: data[key] for key in include}
Expand All @@ -46,7 +54,7 @@ def copy_from_dict(

def update_dict(obj: dict, **updates):
for key, update_value in updates.items():
if callable(update_value):
update_value = update_value(obj[key])
obj.update({key: update_value})
obj.update(
{key: update_value(obj[key]) if callable(update_value) else update_value}
)
return obj
13 changes: 13 additions & 0 deletions packages/common-library/src/common_library/groups_enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import enum


class GroupType(enum.Enum):
"""
standard: standard group, e.g. any group that is not a primary group or special group such as the everyone group
primary: primary group, e.g. the primary group is the user own defined group that typically only contain the user (same as in linux)
everyone: the only group for all users
"""

STANDARD = "standard"
PRIMARY = "primary"
EVERYONE = "everyone"
Loading

0 comments on commit 4e397da

Please sign in to comment.