Skip to content

Commit 27c9462

Browse files
Merge branch 'master' into fix-file-deletion
2 parents 51bc021 + 3960405 commit 27c9462

File tree

62 files changed

+3936
-2457
lines changed

Some content is hidden

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

62 files changed

+3936
-2457
lines changed

.github/workflows/ci-testing-pull-request.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
jobs:
1818
api-specs:
1919
timeout-minutes: 10
20-
name: "check oas' are up to date"
20+
name: "check OAS' are up to date"
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: setup python environment
@@ -35,11 +35,13 @@ jobs:
3535
run: |
3636
uv venv .venv && source .venv/bin/activate
3737
make openapi-specs
38-
./ci/github/helpers/openapi-specs-diff.bash diff \
38+
if ! ./ci/github/helpers/openapi-specs-diff.bash diff \
3939
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
40-
.
40+
.; then \
41+
echo "::error:: OAS are not up to date. Run 'make openapi-specs' to update them"; exit 1; \
42+
fi
4143
42-
api-server-backwards-compatibility:
44+
api-server-oas-breaking:
4345
needs: api-specs
4446
timeout-minutes: 10
4547
name: "api-server backwards compatibility"
@@ -62,11 +64,11 @@ jobs:
6264
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \
6365
/specs/services/api-server/openapi.json
6466
65-
oas-backwards-compatibility:
67+
all-oas-breaking:
6668
needs: api-specs
6769
continue-on-error: true
6870
timeout-minutes: 10
69-
name: "oas backwards compatibility"
71+
name: "OAS backwards compatibility"
7072
runs-on: ubuntu-latest
7173
steps:
7274
- name: setup python environment

api/specs/web-server/_groups.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
GroupCreate,
1212
GroupGet,
1313
GroupUpdate,
14+
GroupUserAdd,
1415
GroupUserGet,
16+
GroupUserUpdate,
1517
MyGroupsGet,
1618
)
1719
from models_library.generics import Envelope
1820
from simcore_service_webserver._meta import API_VTAG
19-
from simcore_service_webserver.groups._handlers import (
20-
GroupUserAdd,
21-
GroupUserUpdate,
22-
_ClassifiersQuery,
23-
_GroupPathParams,
24-
_GroupUserPathParams,
21+
from simcore_service_webserver.groups._common.schemas import (
22+
GroupsClassifiersQuery,
23+
GroupsPathParams,
24+
GroupsUsersPathParams,
2525
)
2626
from simcore_service_webserver.scicrunch.models import ResearchResource, ResourceHit
2727

@@ -58,7 +58,7 @@ async def create_group(_body: GroupCreate):
5858
"/groups/{gid}",
5959
response_model=Envelope[GroupGet],
6060
)
61-
async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
61+
async def get_group(_path: Annotated[GroupsPathParams, Depends()]):
6262
"""
6363
Get an organization group
6464
"""
@@ -69,7 +69,7 @@ async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
6969
response_model=Envelope[GroupGet],
7070
)
7171
async def update_group(
72-
_path: Annotated[_GroupPathParams, Depends()],
72+
_path: Annotated[GroupsPathParams, Depends()],
7373
_body: GroupUpdate,
7474
):
7575
"""
@@ -81,7 +81,7 @@ async def update_group(
8181
"/groups/{gid}",
8282
status_code=status.HTTP_204_NO_CONTENT,
8383
)
84-
async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
84+
async def delete_group(_path: Annotated[GroupsPathParams, Depends()]):
8585
"""
8686
Deletes organization groups
8787
"""
@@ -91,7 +91,7 @@ async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
9191
"/groups/{gid}/users",
9292
response_model=Envelope[list[GroupUserGet]],
9393
)
94-
async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
94+
async def get_all_group_users(_path: Annotated[GroupsPathParams, Depends()]):
9595
"""
9696
Gets users in organization groups
9797
"""
@@ -102,11 +102,11 @@ async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
102102
status_code=status.HTTP_204_NO_CONTENT,
103103
)
104104
async def add_group_user(
105-
_path: Annotated[_GroupPathParams, Depends()],
105+
_path: Annotated[GroupsPathParams, Depends()],
106106
_body: GroupUserAdd,
107107
):
108108
"""
109-
Adds a user to an organization group
109+
Adds a user to an organization group using their username, user ID, or email (subject to privacy settings)
110110
"""
111111

112112

@@ -115,7 +115,7 @@ async def add_group_user(
115115
response_model=Envelope[GroupUserGet],
116116
)
117117
async def get_group_user(
118-
_path: Annotated[_GroupUserPathParams, Depends()],
118+
_path: Annotated[GroupsUsersPathParams, Depends()],
119119
):
120120
"""
121121
Gets specific user in an organization group
@@ -127,7 +127,7 @@ async def get_group_user(
127127
response_model=Envelope[GroupUserGet],
128128
)
129129
async def update_group_user(
130-
_path: Annotated[_GroupUserPathParams, Depends()],
130+
_path: Annotated[GroupsUsersPathParams, Depends()],
131131
_body: GroupUserUpdate,
132132
):
133133
"""
@@ -140,7 +140,7 @@ async def update_group_user(
140140
status_code=status.HTTP_204_NO_CONTENT,
141141
)
142142
async def delete_group_user(
143-
_path: Annotated[_GroupUserPathParams, Depends()],
143+
_path: Annotated[GroupsUsersPathParams, Depends()],
144144
):
145145
"""
146146
Removes a user from an organization group
@@ -157,8 +157,8 @@ async def delete_group_user(
157157
response_model=Envelope[dict[str, Any]],
158158
)
159159
async def get_group_classifiers(
160-
_path: Annotated[_GroupPathParams, Depends()],
161-
_query: Annotated[_ClassifiersQuery, Depends()],
160+
_path: Annotated[GroupsPathParams, Depends()],
161+
_query: Annotated[GroupsClassifiersQuery, Depends()],
162162
):
163163
...
164164

api/specs/web-server/_users.py

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

99
from fastapi import APIRouter, Depends, status
10-
from models_library.api_schemas_webserver.users import ProfileGet, ProfileUpdate
10+
from models_library.api_schemas_webserver.users import MyProfileGet, MyProfilePatch
1111
from models_library.api_schemas_webserver.users_preferences import PatchRequestBody
1212
from models_library.generics import Envelope
1313
from models_library.user_preferences import PreferenceIdentifier
@@ -34,7 +34,7 @@
3434

3535
@router.get(
3636
"/me",
37-
response_model=Envelope[ProfileGet],
37+
response_model=Envelope[MyProfileGet],
3838
)
3939
async def get_my_profile():
4040
...
@@ -44,7 +44,7 @@ async def get_my_profile():
4444
"/me",
4545
status_code=status.HTTP_204_NO_CONTENT,
4646
)
47-
async def update_my_profile(_profile: ProfileUpdate):
47+
async def update_my_profile(_profile: MyProfilePatch):
4848
...
4949

5050

@@ -54,7 +54,7 @@ async def update_my_profile(_profile: ProfileUpdate):
5454
deprecated=True,
5555
description="Use PATCH instead",
5656
)
57-
async def replace_my_profile(_profile: ProfileUpdate):
57+
async def replace_my_profile(_profile: MyProfilePatch):
5858
...
5959

6060

packages/models-library/src/models_library/api_schemas_webserver/_base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class InputSchemaWithoutCamelCase(BaseModel):
2424

2525
class InputSchema(BaseModel):
2626
model_config = ConfigDict(
27-
**InputSchemaWithoutCamelCase.model_config, alias_generator=snake_to_camel
27+
**InputSchemaWithoutCamelCase.model_config,
28+
alias_generator=snake_to_camel,
2829
)
2930

3031

@@ -50,7 +51,7 @@ def data(
5051
exclude_unset=exclude_unset,
5152
exclude_defaults=exclude_defaults,
5253
exclude_none=exclude_none,
53-
**kwargs
54+
**kwargs,
5455
)
5556

5657
def data_json(
@@ -67,5 +68,5 @@ def data_json(
6768
exclude_unset=exclude_unset,
6869
exclude_defaults=exclude_defaults,
6970
exclude_none=exclude_none,
70-
**kwargs
71+
**kwargs,
7172
)

0 commit comments

Comments
 (0)