Skip to content

Commit

Permalink
Merge branch 'master' into fix-file-deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo authored Dec 11, 2024
2 parents 51bc021 + 3960405 commit 27c9462
Show file tree
Hide file tree
Showing 62 changed files with 3,936 additions and 2,457 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci-testing-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
jobs:
api-specs:
timeout-minutes: 10
name: "check oas' are up to date"
name: "check OAS' are up to date"
runs-on: ubuntu-latest
steps:
- name: setup python environment
Expand All @@ -35,11 +35,13 @@ jobs:
run: |
uv venv .venv && source .venv/bin/activate
make openapi-specs
./ci/github/helpers/openapi-specs-diff.bash diff \
if ! ./ci/github/helpers/openapi-specs-diff.bash diff \
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
.
.; then \
echo "::error:: OAS are not up to date. Run 'make openapi-specs' to update them"; exit 1; \
fi
api-server-backwards-compatibility:
api-server-oas-breaking:
needs: api-specs
timeout-minutes: 10
name: "api-server backwards compatibility"
Expand All @@ -62,11 +64,11 @@ jobs:
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 \
/specs/services/api-server/openapi.json
oas-backwards-compatibility:
all-oas-breaking:
needs: api-specs
continue-on-error: true
timeout-minutes: 10
name: "oas backwards compatibility"
name: "OAS backwards compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
Expand Down
34 changes: 17 additions & 17 deletions api/specs/web-server/_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
GroupCreate,
GroupGet,
GroupUpdate,
GroupUserAdd,
GroupUserGet,
GroupUserUpdate,
MyGroupsGet,
)
from models_library.generics import Envelope
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.groups._handlers import (
GroupUserAdd,
GroupUserUpdate,
_ClassifiersQuery,
_GroupPathParams,
_GroupUserPathParams,
from simcore_service_webserver.groups._common.schemas import (
GroupsClassifiersQuery,
GroupsPathParams,
GroupsUsersPathParams,
)
from simcore_service_webserver.scicrunch.models import ResearchResource, ResourceHit

Expand Down Expand Up @@ -58,7 +58,7 @@ async def create_group(_body: GroupCreate):
"/groups/{gid}",
response_model=Envelope[GroupGet],
)
async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
async def get_group(_path: Annotated[GroupsPathParams, Depends()]):
"""
Get an organization group
"""
Expand All @@ -69,7 +69,7 @@ async def get_group(_path: Annotated[_GroupPathParams, Depends()]):
response_model=Envelope[GroupGet],
)
async def update_group(
_path: Annotated[_GroupPathParams, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_body: GroupUpdate,
):
"""
Expand All @@ -81,7 +81,7 @@ async def update_group(
"/groups/{gid}",
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
async def delete_group(_path: Annotated[GroupsPathParams, Depends()]):
"""
Deletes organization groups
"""
Expand All @@ -91,7 +91,7 @@ async def delete_group(_path: Annotated[_GroupPathParams, Depends()]):
"/groups/{gid}/users",
response_model=Envelope[list[GroupUserGet]],
)
async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
async def get_all_group_users(_path: Annotated[GroupsPathParams, Depends()]):
"""
Gets users in organization groups
"""
Expand All @@ -102,11 +102,11 @@ async def get_all_group_users(_path: Annotated[_GroupPathParams, Depends()]):
status_code=status.HTTP_204_NO_CONTENT,
)
async def add_group_user(
_path: Annotated[_GroupPathParams, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_body: GroupUserAdd,
):
"""
Adds a user to an organization group
Adds a user to an organization group using their username, user ID, or email (subject to privacy settings)
"""


Expand All @@ -115,7 +115,7 @@ async def add_group_user(
response_model=Envelope[GroupUserGet],
)
async def get_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
):
"""
Gets specific user in an organization group
Expand All @@ -127,7 +127,7 @@ async def get_group_user(
response_model=Envelope[GroupUserGet],
)
async def update_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
_body: GroupUserUpdate,
):
"""
Expand All @@ -140,7 +140,7 @@ async def update_group_user(
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group_user(
_path: Annotated[_GroupUserPathParams, Depends()],
_path: Annotated[GroupsUsersPathParams, Depends()],
):
"""
Removes a user from an organization group
Expand All @@ -157,8 +157,8 @@ async def delete_group_user(
response_model=Envelope[dict[str, Any]],
)
async def get_group_classifiers(
_path: Annotated[_GroupPathParams, Depends()],
_query: Annotated[_ClassifiersQuery, Depends()],
_path: Annotated[GroupsPathParams, Depends()],
_query: Annotated[GroupsClassifiersQuery, Depends()],
):
...

Expand Down
8 changes: 4 additions & 4 deletions api/specs/web-server/_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Annotated

from fastapi import APIRouter, Depends, status
from models_library.api_schemas_webserver.users import ProfileGet, ProfileUpdate
from models_library.api_schemas_webserver.users import MyProfileGet, MyProfilePatch
from models_library.api_schemas_webserver.users_preferences import PatchRequestBody
from models_library.generics import Envelope
from models_library.user_preferences import PreferenceIdentifier
Expand All @@ -34,7 +34,7 @@

@router.get(
"/me",
response_model=Envelope[ProfileGet],
response_model=Envelope[MyProfileGet],
)
async def get_my_profile():
...
Expand All @@ -44,7 +44,7 @@ async def get_my_profile():
"/me",
status_code=status.HTTP_204_NO_CONTENT,
)
async def update_my_profile(_profile: ProfileUpdate):
async def update_my_profile(_profile: MyProfilePatch):
...


Expand All @@ -54,7 +54,7 @@ async def update_my_profile(_profile: ProfileUpdate):
deprecated=True,
description="Use PATCH instead",
)
async def replace_my_profile(_profile: ProfileUpdate):
async def replace_my_profile(_profile: MyProfilePatch):
...


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class InputSchemaWithoutCamelCase(BaseModel):

class InputSchema(BaseModel):
model_config = ConfigDict(
**InputSchemaWithoutCamelCase.model_config, alias_generator=snake_to_camel
**InputSchemaWithoutCamelCase.model_config,
alias_generator=snake_to_camel,
)


Expand All @@ -50,7 +51,7 @@ def data(
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
**kwargs
**kwargs,
)

def data_json(
Expand All @@ -67,5 +68,5 @@ def data_json(
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
**kwargs
**kwargs,
)
Loading

0 comments on commit 27c9462

Please sign in to comment.