Skip to content

Commit 4646526

Browse files
committed
add missing services handling in project services response
1 parent fe07925 commit 4646526

File tree

2 files changed

+11
-4
lines changed
  • packages/models-library/src/models_library/api_schemas_webserver
  • services/web/server/src/simcore_service_webserver/projects/_controller

2 files changed

+11
-4
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# mypy: disable-error-code=truthy-function
22
from typing import Annotated, Any, Literal, TypeAlias
33

4+
from models_library.services_base import ServiceKeyVersion
45
from pydantic import ConfigDict, Field
56
from pydantic.config import JsonDict
67

@@ -225,3 +226,9 @@ class NodeServiceGet(OutputSchema):
225226
class ProjectNodeServicesGet(OutputSchema):
226227
project_uuid: ProjectID
227228
services: list[NodeServiceGet]
229+
missing: Annotated[
230+
list[ServiceKeyVersion] | None,
231+
Field(
232+
description="List of services in defined in the project but that were not found in the catalog"
233+
),
234+
] = None

services/web/server/src/simcore_service_webserver/projects/_controller/nodes_rest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,17 +553,17 @@ async def get_project_services(request: web.Request) -> web.Response:
553553
services_ids=services_in_project,
554554
)
555555

556-
#
557-
# FIXME: in "data" we return list[ProjectNodeServiceGet] that were found
558-
# in "error" we return list[ServiceKeyVersion] that were not found!
559-
# returned lists should keep the order of services_in_project
560556
return envelope_json_response(
561557
ProjectNodeServicesGet(
562558
project_uuid=path_params.project_id,
563559
services=[
564560
NodeServiceGet.model_validate(sv, from_attributes=True)
565561
for sv in batch_got.found_items
566562
],
563+
missing=[
564+
ServiceKeyVersion(key=skey, version=sver)
565+
for skey, sver in batch_got.missing_identifiers
566+
],
567567
)
568568
)
569569

0 commit comments

Comments
 (0)