Skip to content

Commit e824932

Browse files
Merge branch 'master' into is6880/hash-api-key-secret
2 parents b85facd + 4653f36 commit e824932

File tree

508 files changed

+11560
-6074
lines changed

Some content is hidden

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

508 files changed

+11560
-6074
lines changed

.env-devel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ DYNAMIC_SCHEDULER_UI_STORAGE_SECRET=adminadmin
133133

134134
FUNCTION_SERVICES_AUTHORS='{"UN": {"name": "Unknown", "email": "[email protected]", "affiliation": "unknown"}}'
135135

136+
WEBSERVER_LICENSES={}
137+
LICENSES_ITIS_VIP_SYNCER_ENABLED=false
138+
LICENSES_ITIS_VIP_API_URL=https://some-api/{category}
139+
LICENSES_ITIS_VIP_CATEGORIES='{"HumanWholeBody": "Humans", "HumanBodyRegion": "Humans (Region)", "AnimalWholeBody": "Animal"}'
140+
136141
# Can use 'docker run -it itisfoundation/invitations:latest simcore-service-invitations generate-dotenv --auto-password'
137142
INVITATIONS_DEFAULT_PRODUCT=osparc
138143
INVITATIONS_HOST=invitations

.github/mergify.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
queue_rules:
2+
- name: default
3+
queue_conditions: # condtions to be met to add the PR to the queue (manually or automatically)
4+
# general prerequisits fo accept the PR in the queue
5+
- label=🤖-automerge # let Mergify know that the PR can be merged (added manually)
6+
- label!=🤖-do-not-merge # block Mergify from merging the PR (added manually)
7+
- base=master
8+
- -draft # PR is not in draft state
9+
- -conflict # No merge conflicts
10+
11+
# Check for required reviews
12+
- "#approved-reviews-by>=2" # Requires 2 approving reviews
13+
- "#changes-requested-reviews-by=0" # No changes requested
14+
- "#review-threads-unresolved=0" # All review threads resolved
15+
16+
merge_conditions: # conditions to be met before being able to merge
17+
# list of CI checks that need to pass
18+
- check-success=system-test-environment-setup
19+
- check-success=changes
20+
- check-success=build-test-images
21+
- check-success=build-test-images-frontend
22+
- check-success=unit-tests
23+
- check-success=integration-tests
24+
- check-success=system-tests
25+
26+
27+
pull_request_rules:
28+
- name: retry flaky tests (when PR is approved)
29+
conditions:
30+
- label=🤖-automerge
31+
- label!=🤖-do-not-merge
32+
- base=master
33+
34+
- -draft # PR is not in draft state
35+
- -conflict # No merge conflicts
36+
- "#approved-reviews-by>=2" # Requires 2 approving reviews
37+
- "#changes-requested-reviews-by=0" # No changes requested
38+
- "#review-threads-unresolved=0" # All review threads resolved
39+
40+
- or:
41+
- check-failure=system-test-environment-setup
42+
- check-failure=changes
43+
- check-failure=build-test-images
44+
- check-failure=build-test-images-frontend
45+
- check-failure=unit-tests
46+
- check-failure=integration-tests
47+
- check-failure=system-tests
48+
actions:
49+
comment:
50+
message: "Restarted CI due to failing tests"
51+
github_actions:
52+
workflow:
53+
dispatch:
54+
- workflow: ci-testing-deploy.yml
55+
56+
- name: Automatically add PR to queue if it meets conditions
57+
conditions:
58+
- "label=🤖-automerge"
59+
- "label!=🤖-do-not-merge"
60+
- "base=master"
61+
62+
- "-draft" # PR is not in draft state
63+
- "-conflict" # PR has no conflicts
64+
- "#approved-reviews-by>=2" # Requires 2 approvals
65+
- "#changes-requested-reviews-by=0" # No requested changes
66+
- "#review-threads-unresolved=0" # All review threads resolved
67+
actions:
68+
queue:
69+
name: default

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ jobs:
3131
enable-cache: false
3232
- name: checkout source branch
3333
uses: actions/checkout@v4
34-
- name: Regenerate specs and check
34+
- name: Generate openapi specs
3535
run: |
3636
make devenv
3737
source .venv/bin/activate
3838
make openapi-specs
39+
- name: Check openapi specs are up to date
40+
run: |
3941
if ! ./ci/github/helpers/openapi-specs-diff.bash diff \
40-
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
42+
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.after }} \
4143
.; then \
4244
echo "::error:: OAS are not up to date. Run 'make openapi-specs' to update them"; exit 1; \
4345
fi
@@ -57,7 +59,7 @@ jobs:
5759
- name: check api-server backwards compatibility
5860
run: |
5961
./scripts/openapi-diff.bash breaking --fail-on ERR\
60-
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 \
62+
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/${{ github.event.after }}/services/api-server/openapi.json \
6163
/specs/services/api-server/openapi.json
6264
6365
all-oas-breaking:
@@ -76,5 +78,5 @@ jobs:
7678
- name: Check openapi-specs backwards compatibility
7779
run: |
7880
./ci/github/helpers/openapi-specs-diff.bash breaking \
79-
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \
81+
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/${{ github.event.after }} \
8082
.

.ruff.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
select = [
2+
lint.select = [
33
"A", # [https://pypi.org/project/flake8-builtins/]
44
"ARG", # [https://pypi.org/project/flake8-unused-arguments/]
55
"ASYNC", # [https://pypi.org/project/flake8-async/]
@@ -40,7 +40,7 @@ select = [
4040
"W", # [https://pypi.org/project/pycodestyle/] warnings
4141
"YTT", # [https://pypi.org/project/flake8-2020/]
4242
]
43-
ignore = [
43+
lint.ignore = [
4444
"E501", # line too long, handled by black
4545
"S101", # use of `assert` detected hanbled by pylance, does not support noseq
4646
"TID252", # [*] Relative imports from parent modules are banned
@@ -50,7 +50,7 @@ ignore = [
5050
target-version = "py311"
5151

5252

53-
[per-file-ignores]
53+
[lint.per-file-ignores]
5454
"**/{tests,pytest_simcore}/**" = [
5555
"T201", # print found
5656
"ARG001", # unused function argument
@@ -64,10 +64,10 @@ target-version = "py311"
6464
"FBT001", # Boolean positional arg in function definition
6565
]
6666

67-
[flake8-pytest-style]
67+
[lint.flake8-pytest-style]
6868
fixture-parentheses = false
6969
parametrize-names-type = "csv"
7070

7171

72-
[pylint]
72+
[lint.pylint]
7373
max-args = 10

api/specs/web-server/_licensed_items.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010

1111
from _common import as_query
1212
from fastapi import APIRouter, Depends, status
13-
from models_library.api_schemas_webserver.licensed_items import LicensedItemGet
13+
from models_library.api_schemas_webserver.licensed_items import LicensedItemRestGet
1414
from models_library.generics import Envelope
1515
from models_library.rest_error import EnvelopedError
16+
from models_library.rest_pagination import Page
1617
from simcore_service_webserver._meta import API_VTAG
17-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
18-
from simcore_service_webserver.licenses._models import (
18+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
19+
_TO_HTTP_ERROR_MAP,
20+
)
21+
from simcore_service_webserver.licenses._common.models import (
1922
LicensedItemsBodyParams,
2023
LicensedItemsListQueryParams,
2124
LicensedItemsPathParams,
@@ -35,7 +38,7 @@
3538

3639
@router.get(
3740
"/catalog/licensed-items",
38-
response_model=Envelope[list[LicensedItemGet]],
41+
response_model=Page[LicensedItemRestGet],
3942
)
4043
async def list_licensed_items(
4144
_query: Annotated[as_query(LicensedItemsListQueryParams), Depends()],
@@ -45,7 +48,7 @@ async def list_licensed_items(
4548

4649
@router.get(
4750
"/catalog/licensed-items/{licensed_item_id}",
48-
response_model=Envelope[LicensedItemGet],
51+
response_model=Envelope[LicensedItemRestGet],
4952
)
5053
async def get_licensed_item(
5154
_path: Annotated[LicensedItemsPathParams, Depends()],

api/specs/web-server/_licensed_items_checkouts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
from models_library.rest_error import EnvelopedError
1818
from models_library.rest_pagination import Page
1919
from simcore_service_webserver._meta import API_VTAG
20-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
20+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
21+
_TO_HTTP_ERROR_MAP,
22+
)
2123
from simcore_service_webserver.licenses._licensed_items_checkouts_models import (
2224
LicensedItemCheckoutPathParams,
2325
LicensedItemsCheckoutsListQueryParams,

api/specs/web-server/_licensed_items_purchases.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
from models_library.rest_error import EnvelopedError
1818
from models_library.rest_pagination import Page
1919
from simcore_service_webserver._meta import API_VTAG
20-
from simcore_service_webserver.licenses._exceptions_handlers import _TO_HTTP_ERROR_MAP
21-
from simcore_service_webserver.licenses._models import (
20+
from simcore_service_webserver.licenses._common.exceptions_handlers import (
21+
_TO_HTTP_ERROR_MAP,
22+
)
23+
from simcore_service_webserver.licenses._common.models import (
2224
LicensedItemsPurchasesListQueryParams,
2325
LicensedItemsPurchasesPathParams,
2426
)

api/specs/web-server/_resource_usage.py

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
CreatePricingPlanBodyParams,
2222
CreatePricingUnitBodyParams,
2323
PricingPlanAdminGet,
24+
PricingPlanGet,
2425
PricingPlanToServiceAdminGet,
2526
PricingUnitAdminGet,
2627
PricingUnitGet,
@@ -29,15 +30,16 @@
2930
UpdatePricingUnitBodyParams,
3031
)
3132
from models_library.generics import Envelope
33+
from models_library.rest_pagination import Page, PageQueryParameters
3234
from simcore_service_webserver._meta import API_VTAG
33-
from simcore_service_webserver.resource_usage._pricing_plans_admin_handlers import (
35+
from simcore_service_webserver.resource_usage._pricing_plans_admin_rest import (
3436
PricingPlanGetPathParams,
3537
PricingUnitGetPathParams,
3638
)
37-
from simcore_service_webserver.resource_usage._pricing_plans_handlers import (
39+
from simcore_service_webserver.resource_usage._pricing_plans_rest import (
3840
PricingPlanUnitGetPathParams,
3941
)
40-
from simcore_service_webserver.resource_usage._service_runs_handlers import (
42+
from simcore_service_webserver.resource_usage._service_runs_rest import (
4143
ServicesAggregatedUsagesListQueryParams,
4244
ServicesResourceUsagesListQueryParams,
4345
ServicesResourceUsagesReportQueryParams,
@@ -48,7 +50,7 @@
4850

4951
@router.get(
5052
"/services/-/resource-usages",
51-
response_model=Envelope[list[ServiceRunGet]],
53+
response_model=Page[ServiceRunGet],
5254
summary="Retrieve finished and currently running user services"
5355
" (user and product are taken from context, optionally wallet_id parameter might be provided).",
5456
tags=["usage"],
@@ -61,7 +63,7 @@ async def list_resource_usage_services(
6163

6264
@router.get(
6365
"/services/-/aggregated-usages",
64-
response_model=Envelope[list[OsparcCreditsAggregatedByServiceGet]],
66+
response_model=Page[OsparcCreditsAggregatedByServiceGet],
6567
summary="Used credits based on aggregate by type, currently supported `services`"
6668
". (user and product are taken from context, optionally wallet_id parameter might be provided).",
6769
tags=["usage"],
@@ -93,7 +95,6 @@ async def export_resource_usage_services(
9395
@router.get(
9496
"/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}",
9597
response_model=Envelope[PricingUnitGet],
96-
summary="Retrieve detail information about pricing unit",
9798
tags=["pricing-plans"],
9899
)
99100
async def get_pricing_plan_unit(
@@ -102,27 +103,50 @@ async def get_pricing_plan_unit(
102103
...
103104

104105

106+
@router.get(
107+
"/pricing-plans",
108+
response_model=Page[PricingPlanGet],
109+
tags=["pricing-plans"],
110+
description="To keep the listing lightweight, the pricingUnits field is None.",
111+
)
112+
async def list_pricing_plans(
113+
_query: Annotated[as_query(PageQueryParameters), Depends()]
114+
):
115+
...
116+
117+
118+
@router.get(
119+
"/pricing-plans/{pricing_plan_id}",
120+
response_model=Envelope[PricingPlanGet],
121+
tags=["pricing-plans"],
122+
)
123+
async def get_pricing_plan(
124+
_path: Annotated[PricingPlanGetPathParams, Depends()],
125+
):
126+
...
127+
128+
105129
## Pricing plans for Admin panel
106130

107131

108132
@router.get(
109133
"/admin/pricing-plans",
110-
response_model=Envelope[list[PricingPlanAdminGet]],
111-
summary="List pricing plans",
134+
response_model=Page[PricingPlanAdminGet],
112135
tags=["admin"],
113136
description="To keep the listing lightweight, the pricingUnits field is None.",
114137
)
115-
async def list_pricing_plans():
138+
async def list_pricing_plans_for_admin_user(
139+
_query: Annotated[as_query(PageQueryParameters), Depends()]
140+
):
116141
...
117142

118143

119144
@router.get(
120145
"/admin/pricing-plans/{pricing_plan_id}",
121146
response_model=Envelope[PricingPlanAdminGet],
122-
summary="Retrieve detail information about pricing plan",
123147
tags=["admin"],
124148
)
125-
async def get_pricing_plan(
149+
async def get_pricing_plan_for_admin_user(
126150
_path: Annotated[PricingPlanGetPathParams, Depends()],
127151
):
128152
...
@@ -131,7 +155,6 @@ async def get_pricing_plan(
131155
@router.post(
132156
"/admin/pricing-plans",
133157
response_model=Envelope[PricingPlanAdminGet],
134-
summary="Create pricing plan",
135158
tags=["admin"],
136159
)
137160
async def create_pricing_plan(
@@ -143,7 +166,6 @@ async def create_pricing_plan(
143166
@router.put(
144167
"/admin/pricing-plans/{pricing_plan_id}",
145168
response_model=Envelope[PricingPlanAdminGet],
146-
summary="Update detail information about pricing plan",
147169
tags=["admin"],
148170
)
149171
async def update_pricing_plan(
@@ -159,7 +181,6 @@ async def update_pricing_plan(
159181
@router.get(
160182
"/admin/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}",
161183
response_model=Envelope[PricingUnitAdminGet],
162-
summary="Retrieve detail information about pricing unit",
163184
tags=["admin"],
164185
)
165186
async def get_pricing_unit(
@@ -171,7 +192,6 @@ async def get_pricing_unit(
171192
@router.post(
172193
"/admin/pricing-plans/{pricing_plan_id}/pricing-units",
173194
response_model=Envelope[PricingUnitAdminGet],
174-
summary="Create pricing unit",
175195
tags=["admin"],
176196
)
177197
async def create_pricing_unit(
@@ -184,7 +204,6 @@ async def create_pricing_unit(
184204
@router.put(
185205
"/admin/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}",
186206
response_model=Envelope[PricingUnitAdminGet],
187-
summary="Update detail information about pricing plan",
188207
tags=["admin"],
189208
)
190209
async def update_pricing_unit(
@@ -200,7 +219,6 @@ async def update_pricing_unit(
200219
@router.get(
201220
"/admin/pricing-plans/{pricing_plan_id}/billable-services",
202221
response_model=Envelope[list[PricingPlanToServiceAdminGet]],
203-
summary="List services that are connected to the provided pricing plan",
204222
tags=["admin"],
205223
)
206224
async def list_connected_services_to_pricing_plan(
@@ -212,7 +230,6 @@ async def list_connected_services_to_pricing_plan(
212230
@router.post(
213231
"/admin/pricing-plans/{pricing_plan_id}/billable-services",
214232
response_model=Envelope[PricingPlanToServiceAdminGet],
215-
summary="Connect service with pricing plan",
216233
tags=["admin"],
217234
)
218235
async def connect_service_to_pricing_plan(

0 commit comments

Comments
 (0)