Skip to content

Commit 4e397da

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-redirect-service-restart-containers
2 parents c7e7956 + acd677a commit 4e397da

File tree

370 files changed

+9168
-4477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+9168
-4477
lines changed

.codecov.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ flag_management:
1010
statuses:
1111
- type: project
1212
target: auto
13-
threshold: 1%
13+
threshold: 2%
1414
- type: patch
1515
target: auto
16-
threshold: 1%
16+
threshold: 2%
1717

1818

1919
component_management:
@@ -22,7 +22,7 @@ component_management:
2222
statuses:
2323
- type: project
2424
target: auto
25-
threshold: 1%
25+
threshold: 2%
2626
branches:
2727
- "!master"
2828
individual_components:
@@ -116,12 +116,12 @@ coverage:
116116
project:
117117
default:
118118
informational: true
119-
threshold: 1%
119+
threshold: 2%
120120

121121
patch:
122122
default:
123123
informational: true
124-
threshold: 1%
124+
threshold: 2%
125125

126126
comment:
127127
layout: "header,diff,flags,components,footer"

.github/workflows/ci-testing-deploy.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ jobs:
772772
if: ${{ !cancelled() }}
773773
run: ./ci/github/unit-testing/catalog.bash test
774774
- name: upload failed tests logs
775-
if: ${{ !cancelled() }}
775+
if: ${{ failure() }}
776776
uses: actions/upload-artifact@v4
777777
with:
778778
name: ${{ github.job }}_docker_logs
@@ -879,7 +879,7 @@ jobs:
879879
if: ${{ !cancelled() }}
880880
run: ./ci/github/unit-testing/datcore-adapter.bash test
881881
- name: upload failed tests logs
882-
if: ${{ !cancelled() }}
882+
if: ${{ failure() }}
883883
uses: actions/upload-artifact@v4
884884
with:
885885
name: ${{ github.job }}_docker_logs
@@ -930,7 +930,7 @@ jobs:
930930
if: ${{ !cancelled() }}
931931
run: ./ci/github/unit-testing/director.bash test
932932
- name: upload failed tests logs
933-
if: ${{ !cancelled() }}
933+
if: ${{ failure() }}
934934
uses: actions/upload-artifact@v4
935935
with:
936936
name: ${{ github.job }}_docker_logs
@@ -981,7 +981,7 @@ jobs:
981981
if: ${{ !cancelled() }}
982982
run: ./ci/github/unit-testing/director-v2.bash test
983983
- name: upload failed tests logs
984-
if: ${{ !cancelled() }}
984+
if: ${{ failure() }}
985985
uses: actions/upload-artifact@v4
986986
with:
987987
name: ${{ github.job }}_docker_logs
@@ -1910,7 +1910,7 @@ jobs:
19101910
- name: test
19111911
run: ./ci/github/integration-testing/webserver.bash test 01
19121912
- name: upload failed tests logs
1913-
if: ${{ !cancelled() }}
1913+
if: ${{ failure() }}
19141914
uses: actions/upload-artifact@v4
19151915
with:
19161916
name: ${{ github.job }}_docker_logs
@@ -1974,7 +1974,7 @@ jobs:
19741974
- name: test
19751975
run: ./ci/github/integration-testing/webserver.bash test 02
19761976
- name: upload failed tests logs
1977-
if: ${{ !cancelled() }}
1977+
if: ${{ failure() }}
19781978
uses: actions/upload-artifact@v4
19791979
with:
19801980
name: ${{ github.job }}_docker_logs
@@ -2038,7 +2038,7 @@ jobs:
20382038
- name: test
20392039
run: ./ci/github/integration-testing/director-v2.bash test 01
20402040
- name: upload failed tests logs
2041-
if: ${{ !cancelled() }}
2041+
if: ${{ failure() }}
20422042
uses: actions/upload-artifact@v4
20432043
with:
20442044
name: ${{ github.job }}_docker_logs
@@ -2111,7 +2111,7 @@ jobs:
21112111
- name: test
21122112
run: ./ci/github/integration-testing/director-v2.bash test 02
21132113
- name: upload failed tests logs
2114-
if: ${{ !cancelled() }}
2114+
if: ${{ failure() }}
21152115
uses: actions/upload-artifact@v4
21162116
with:
21172117
name: ${{ github.job }}_docker_logs
@@ -2177,7 +2177,7 @@ jobs:
21772177
- name: test
21782178
run: ./ci/github/integration-testing/dynamic-sidecar.bash test 01
21792179
- name: upload failed tests logs
2180-
if: ${{ !cancelled() }}
2180+
if: ${{ failure() }}
21812181
uses: actions/upload-artifact@v4
21822182
with:
21832183
name: ${{ github.job }}_docker_logs
@@ -2241,7 +2241,7 @@ jobs:
22412241
- name: test
22422242
run: ./ci/github/integration-testing/simcore-sdk.bash test
22432243
- name: upload failed tests logs
2244-
if: ${{ !cancelled() }}
2244+
if: ${{ failure() }}
22452245
uses: actions/upload-artifact@v4
22462246
with:
22472247
name: ${{ github.job }}_docker_logs
@@ -2330,7 +2330,7 @@ jobs:
23302330
- name: test
23312331
run: ./ci/github/system-testing/public-api.bash test
23322332
- name: upload failed tests logs
2333-
if: ${{ !cancelled() }}
2333+
if: ${{ failure() }}
23342334
uses: actions/upload-artifact@v4
23352335
with:
23362336
name: ${{ github.job }}_docker_logs
@@ -2395,7 +2395,7 @@ jobs:
23952395
name: ${{ github.job }}_services_settings_schemas
23962396
path: ./services/**/settings-schema.json
23972397
- name: upload failed tests logs
2398-
if: ${{ !cancelled() }}
2398+
if: ${{ failure() }}
23992399
uses: actions/upload-artifact@v4
24002400
with:
24012401
name: ${{ github.job }}_docker_logs

api/specs/web-server/_projects_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
ServiceResourcesDict,
2222
)
2323
from models_library.generics import Envelope
24+
from models_library.groups import GroupID
2425
from models_library.projects import ProjectID
2526
from models_library.projects_nodes_io import NodeID
26-
from models_library.users import GroupID
2727
from simcore_service_webserver._meta import API_VTAG
2828
from simcore_service_webserver.projects._crud_handlers import ProjectPathParams
2929
from simcore_service_webserver.projects._nodes_handlers import (

api/specs/web-server/_users.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77
from typing import Annotated
88

99
from fastapi import APIRouter, Depends, status
10-
from models_library.api_schemas_webserver.users import MyProfileGet, MyProfilePatch
10+
from models_library.api_schemas_webserver.users import (
11+
MyPermissionGet,
12+
MyProfileGet,
13+
MyProfilePatch,
14+
MyTokenCreate,
15+
MyTokenGet,
16+
UserGet,
17+
UsersSearchQueryParams,
18+
)
1119
from models_library.api_schemas_webserver.users_preferences import PatchRequestBody
1220
from models_library.generics import Envelope
1321
from models_library.user_preferences import PreferenceIdentifier
1422
from simcore_service_webserver._meta import API_VTAG
15-
from simcore_service_webserver.users._handlers import PreUserProfile, _SearchQueryParams
23+
from simcore_service_webserver.users._common.schemas import PreRegisteredUserGet
1624
from simcore_service_webserver.users._notifications import (
1725
UserNotification,
1826
UserNotificationCreate,
1927
UserNotificationPatch,
2028
)
21-
from simcore_service_webserver.users._notifications_handlers import (
22-
_NotificationPathParams,
23-
)
24-
from simcore_service_webserver.users._schemas import UserProfile
25-
from simcore_service_webserver.users._tokens_handlers import _TokenPathParams
26-
from simcore_service_webserver.users.schemas import (
27-
PermissionGet,
28-
ThirdPartyToken,
29-
TokenCreate,
30-
)
29+
from simcore_service_webserver.users._notifications_rest import _NotificationPathParams
30+
from simcore_service_webserver.users._tokens_rest import _TokenPathParams
3131

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

@@ -63,32 +63,32 @@ async def replace_my_profile(_profile: MyProfilePatch):
6363
status_code=status.HTTP_204_NO_CONTENT,
6464
)
6565
async def set_frontend_preference(
66-
preference_id: PreferenceIdentifier, # noqa: ARG001
67-
body_item: PatchRequestBody, # noqa: ARG001
66+
preference_id: PreferenceIdentifier,
67+
body_item: PatchRequestBody,
6868
):
6969
...
7070

7171

7272
@router.get(
7373
"/me/tokens",
74-
response_model=Envelope[list[ThirdPartyToken]],
74+
response_model=Envelope[list[MyTokenGet]],
7575
)
7676
async def list_tokens():
7777
...
7878

7979

8080
@router.post(
8181
"/me/tokens",
82-
response_model=Envelope[ThirdPartyToken],
82+
response_model=Envelope[MyTokenGet],
8383
status_code=status.HTTP_201_CREATED,
8484
)
85-
async def create_token(_token: TokenCreate):
85+
async def create_token(_token: MyTokenCreate):
8686
...
8787

8888

8989
@router.get(
9090
"/me/tokens/{service}",
91-
response_model=Envelope[ThirdPartyToken],
91+
response_model=Envelope[MyTokenGet],
9292
)
9393
async def get_token(_params: Annotated[_TokenPathParams, Depends()]):
9494
...
@@ -131,30 +131,30 @@ async def mark_notification_as_read(
131131

132132
@router.get(
133133
"/me/permissions",
134-
response_model=Envelope[list[PermissionGet]],
134+
response_model=Envelope[list[MyPermissionGet]],
135135
)
136136
async def list_user_permissions():
137137
...
138138

139139

140140
@router.get(
141141
"/users:search",
142-
response_model=Envelope[list[UserProfile]],
142+
response_model=Envelope[list[UserGet]],
143143
tags=[
144144
"po",
145145
],
146146
)
147-
async def search_users(_params: Annotated[_SearchQueryParams, Depends()]):
147+
async def search_users(_params: Annotated[UsersSearchQueryParams, Depends()]):
148148
# NOTE: see `Search` in `Common Custom Methods` in https://cloud.google.com/apis/design/custom_methods
149149
...
150150

151151

152152
@router.post(
153153
"/users:pre-register",
154-
response_model=Envelope[UserProfile],
154+
response_model=Envelope[UserGet],
155155
tags=[
156156
"po",
157157
],
158158
)
159-
async def pre_register_user(_body: PreUserProfile):
159+
async def pre_register_user(_body: PreRegisteredUserGet):
160160
...

api/specs/web-server/_wallets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
WalletPaymentInitiated,
2828
)
2929
from models_library.generics import Envelope
30+
from models_library.groups import GroupID
3031
from models_library.rest_pagination import Page, PageQueryParameters
31-
from models_library.users import GroupID
3232
from models_library.wallets import WalletID
3333
from simcore_service_webserver._meta import API_VTAG
3434
from simcore_service_webserver.wallets._groups_api import WalletGroupGet

packages/aws-library/src/aws_library/ec2/_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ async def launch_instances(
181181
)
182182
instance_ids = [i["InstanceId"] for i in instances["Instances"]]
183183
_logger.info(
184-
"New instances launched: %s, waiting for them to start now...",
184+
"%s New instances launched: %s, waiting for them to start now...",
185+
len(instance_ids),
185186
instance_ids,
186187
)
187188

packages/pytest-simcore/src/pytest_simcore/helpers/dict_tools.py renamed to packages/common-library/src/common_library/dict_tools.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
""" Utils to operate with dicts """
1+
""" A collection of free functions to manipulate dicts
2+
"""
23

3-
from copy import deepcopy
4-
from typing import Any, Mapping
4+
from collections.abc import Mapping
5+
from copy import copy, deepcopy
6+
from typing import Any
57

6-
ConfigDict = dict[str, Any]
8+
9+
def remap_keys(data: dict, rename: dict[str, str]) -> dict[str, Any]:
10+
"""A new dict that renames the keys of a dict while keeping the values unchanged
11+
12+
NOTE: Does not support renaming of nested keys
13+
"""
14+
return {rename.get(k, k): v for k, v in data.items()}
715

816

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

3038
if include is None:
31-
return deepcopy(data) if deep else data.copy()
39+
return deepcopy(data) if deep else copy(data)
3240

3341
if include == ...:
34-
return deepcopy(data) if deep else data.copy()
42+
return deepcopy(data) if deep else copy(data)
3543

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

4755
def update_dict(obj: dict, **updates):
4856
for key, update_value in updates.items():
49-
if callable(update_value):
50-
update_value = update_value(obj[key])
51-
obj.update({key: update_value})
57+
obj.update(
58+
{key: update_value(obj[key]) if callable(update_value) else update_value}
59+
)
5260
return obj
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import enum
2+
3+
4+
class GroupType(enum.Enum):
5+
"""
6+
standard: standard group, e.g. any group that is not a primary group or special group such as the everyone group
7+
primary: primary group, e.g. the primary group is the user own defined group that typically only contain the user (same as in linux)
8+
everyone: the only group for all users
9+
"""
10+
11+
STANDARD = "standard"
12+
PRIMARY = "primary"
13+
EVERYONE = "everyone"

0 commit comments

Comments
 (0)