Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into update-from-maste…
Browse files Browse the repository at this point in the history
…r-10
  • Loading branch information
sanderegg committed Nov 8, 2024
2 parents 0527b1e + 927319c commit 7d0fbdb
Show file tree
Hide file tree
Showing 247 changed files with 2,793 additions and 1,663 deletions.
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ flag_management:

component_management:
default_rules:
carryforward: true
statuses:
- type: project
target: auto
Expand Down
2 changes: 1 addition & 1 deletion .env-devel
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ COMPUTATIONAL_BACKEND_DEFAULT_FILE_LINK_TYPE=PRESIGNED
COMPUTATIONAL_BACKEND_ON_DEMAND_CLUSTERS_FILE_LINK_TYPE=PRESIGNED
DIRECTOR_V2_DEV_FEATURES_ENABLED=0
DIRECTOR_V2_DYNAMIC_SCHEDULER_CLOSE_SERVICES_VIA_FRONTEND_WHEN_CREDITS_LIMIT_REACHED=1
DIRECTOR_V2_DYNAMIC_SIDECAR_SLEEP_AFTER_CONTAINER_REMOVAL=0
DIRECTOR_V2_DYNAMIC_SIDECAR_SLEEP_AFTER_CONTAINER_REMOVAL=PT0S
DIRECTOR_V2_GENERIC_RESOURCE_PLACEMENT_CONSTRAINTS_SUBSTITUTIONS='{}'
DIRECTOR_V2_HOST=director-v2
DIRECTOR_V2_LOGLEVEL=INFO
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,51 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

unit-test-webserver-04:
needs: changes
if: ${{ needs.changes.outputs.webserver == 'true' || github.event_name == 'push' }}
timeout-minutes: 25 # if this timeout gets too small, then split the tests
name: "[unit] webserver 04"
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.11"]
os: [ubuntu-22.04]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.x"
enable-cache: false
cache-dependency-glob: "**/web/server/requirements/ci.txt"
- name: show system version
run: ./ci/helpers/show_system_versions.bash
- name: install webserver
run: ./ci/github/unit-testing/webserver.bash install
- name: test
run: ./ci/github/unit-testing/webserver.bash test_with_db 04
- uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unittests #optional
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

unit-test-storage:
needs: changes
if: ${{ needs.changes.outputs.storage == 'true' || github.event_name == 'push' }}
Expand Down Expand Up @@ -1920,6 +1965,7 @@ jobs:
unit-test-webserver-01,
unit-test-webserver-02,
unit-test-webserver-03,
unit-test-webserver-04,
]
runs-on: ubuntu-latest
steps:
Expand Down
101 changes: 66 additions & 35 deletions api/specs/web-server/_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@

from fastapi import APIRouter, Depends, status
from models_library.api_schemas_webserver.groups import (
AllUsersGroups,
GroupCreate,
GroupGet,
GroupUpdate,
GroupUserGet,
UsersGroup,
MyGroupsGet,
)
from models_library.generics import Envelope
from models_library.users import GroupID, UserID
from simcore_service_webserver._meta import API_VTAG
from simcore_service_webserver.groups._handlers import _ClassifiersQuery
from simcore_service_webserver.groups._handlers import (
GroupUserAdd,
GroupUserUpdate,
_ClassifiersQuery,
_GroupPathParams,
_GroupUserPathParams,
)
from simcore_service_webserver.scicrunch.models import ResearchResource, ResourceHit

router = APIRouter(
Expand All @@ -28,106 +35,130 @@

@router.get(
"/groups",
response_model=Envelope[AllUsersGroups],
response_model=Envelope[MyGroupsGet],
)
async def list_groups():
...
"""
List all groups (organizations, primary, everyone and products) I belong to
"""


@router.post(
"/groups",
response_model=Envelope[UsersGroup],
response_model=Envelope[GroupGet],
status_code=status.HTTP_201_CREATED,
)
async def create_group():
...
async def create_group(_b: GroupCreate):
"""
Creates an organization group
"""


@router.get(
"/groups/{gid}",
response_model=Envelope[UsersGroup],
response_model=Envelope[GroupGet],
)
async def get_group(gid: GroupID):
...
async def get_group(_p: Annotated[_GroupPathParams, Depends()]):
"""
Get an organization group
"""


@router.patch(
"/groups/{gid}",
response_model=Envelope[UsersGroup],
response_model=Envelope[GroupGet],
)
async def update_group(gid: GroupID, _update: UsersGroup):
...
async def update_group(
_p: Annotated[_GroupPathParams, Depends()],
_b: GroupUpdate,
):
"""
Updates organization groups
"""


@router.delete(
"/groups/{gid}",
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group(gid: GroupID):
...
async def delete_group(_p: Annotated[_GroupPathParams, Depends()]):
"""
Deletes organization groups
"""


@router.get(
"/groups/{gid}/users",
response_model=Envelope[list[GroupUserGet]],
)
async def get_group_users(gid: GroupID):
...
async def get_all_group_users(_p: Annotated[_GroupPathParams, Depends()]):
"""
Gets users in organization groups
"""


@router.post(
"/groups/{gid}/users",
status_code=status.HTTP_204_NO_CONTENT,
)
async def add_group_user(
gid: GroupID,
_new: GroupUserGet,
_p: Annotated[_GroupPathParams, Depends()],
_b: GroupUserAdd,
):
...
"""
Adds a user to an organization group
"""


@router.get(
"/groups/{gid}/users/{uid}",
response_model=Envelope[GroupUserGet],
)
async def get_group_user(
gid: GroupID,
uid: UserID,
_p: Annotated[_GroupUserPathParams, Depends()],
):
...
"""
Gets specific user in an organization group
"""


@router.patch(
"/groups/{gid}/users/{uid}",
response_model=Envelope[GroupUserGet],
)
async def update_group_user(
gid: GroupID,
uid: UserID,
_update: GroupUserGet,
_p: Annotated[_GroupUserPathParams, Depends()],
_b: GroupUserUpdate,
):
# FIXME: update type
...
"""
Updates user (access-rights) to an organization group
"""


@router.delete(
"/groups/{gid}/users/{uid}",
status_code=status.HTTP_204_NO_CONTENT,
)
async def delete_group_user(
gid: GroupID,
uid: UserID,
_p: Annotated[_GroupUserPathParams, Depends()],
):
...
"""
Removes a user from an organization group
"""


#
# Classifiers
#


@router.get(
"/groups/{gid}/classifiers",
response_model=Envelope[dict[str, Any]],
)
async def get_group_classifiers(
gid: GroupID,
_query: Annotated[_ClassifiersQuery, Depends()],
_p: Annotated[_GroupPathParams, Depends()],
_q: Annotated[_ClassifiersQuery, Depends()],
):
...

Expand Down
1 change: 1 addition & 0 deletions packages/aws-library/requirements/_base.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ aiocache
arrow
pydantic[email]
types-aiobotocore[ec2,s3,ssm]
opentelemetry-instrumentation-botocore
sh
19 changes: 18 additions & 1 deletion packages/aws-library/requirements/_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ arrow==1.3.0
# -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in
# -r requirements/../../../packages/service-library/requirements/_base.in
# -r requirements/_base.in
async-timeout==4.0.3
# via redis
attrs==24.2.0
# via
# aiohttp
Expand Down Expand Up @@ -141,7 +143,10 @@ opentelemetry-api==1.27.0
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-instrumentation
# opentelemetry-instrumentation-botocore
# opentelemetry-instrumentation-redis
# opentelemetry-instrumentation-requests
# opentelemetry-propagator-aws-xray
# opentelemetry-sdk
# opentelemetry-semantic-conventions
opentelemetry-exporter-otlp==1.27.0
Expand All @@ -155,9 +160,18 @@ opentelemetry-exporter-otlp-proto-grpc==1.27.0
opentelemetry-exporter-otlp-proto-http==1.27.0
# via opentelemetry-exporter-otlp
opentelemetry-instrumentation==0.48b0
# via opentelemetry-instrumentation-requests
# via
# opentelemetry-instrumentation-botocore
# opentelemetry-instrumentation-redis
# opentelemetry-instrumentation-requests
opentelemetry-instrumentation-botocore==0.48b0
# via -r requirements/_base.in
opentelemetry-instrumentation-redis==0.48b0
# via -r requirements/../../../packages/service-library/requirements/_base.in
opentelemetry-instrumentation-requests==0.48b0
# via -r requirements/../../../packages/service-library/requirements/_base.in
opentelemetry-propagator-aws-xray==1.0.2
# via opentelemetry-instrumentation-botocore
opentelemetry-proto==1.27.0
# via
# opentelemetry-exporter-otlp-proto-common
Expand All @@ -170,6 +184,8 @@ opentelemetry-sdk==1.27.0
# opentelemetry-exporter-otlp-proto-http
opentelemetry-semantic-conventions==0.48b0
# via
# opentelemetry-instrumentation-botocore
# opentelemetry-instrumentation-redis
# opentelemetry-instrumentation-requests
# opentelemetry-sdk
opentelemetry-util-http==0.48b0
Expand Down Expand Up @@ -376,6 +392,7 @@ wrapt==1.16.0
# aiobotocore
# deprecated
# opentelemetry-instrumentation
# opentelemetry-instrumentation-redis
yarl==1.12.1
# via
# aio-pika
Expand Down
Loading

0 comments on commit 7d0fbdb

Please sign in to comment.