Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
d2b2e6f
Remove workbench column from projects_table
giancarloromeo Jul 22, 2025
d78aa5c
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 23, 2025
47072ad
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 24, 2025
6cc38ae
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 25, 2025
f6ae1d7
fix: remove workbench from faker factory
giancarloromeo Jul 25, 2025
20cef27
fix: remove workbench references from catalog
giancarloromeo Jul 25, 2025
b9cc19c
Merge branch 'master' into pr/giancarloromeo/8141
pcrespov Jul 28, 2025
e920c1f
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
pcrespov Jul 28, 2025
2637c2c
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
pcrespov Jul 28, 2025
77d26ec
fixes projecst repo
pcrespov Jul 28, 2025
c209c6b
fixes tests modules
pcrespov Jul 28, 2025
5b7935a
faker
pcrespov Jul 28, 2025
019e04b
fixing nodes
pcrespov Jul 28, 2025
9c0640e
fixing fakes
pcrespov Jul 28, 2025
f7cf17b
fixing fakes
pcrespov Jul 28, 2025
17f60de
fixes update
pcrespov Jul 28, 2025
1c9de98
minor
pcrespov Jul 28, 2025
764a386
Merge branch 'master' into pr/giancarloromeo/8141
pcrespov Jul 28, 2025
360dcb4
fixes migration tests
pcrespov Jul 28, 2025
86e02d6
fixes
pcrespov Jul 28, 2025
d1510e5
simplified fixture
pcrespov Jul 28, 2025
791e8b3
comment
pcrespov Jul 28, 2025
00370e5
fix: create_node fixture
giancarloromeo Jul 28, 2025
398866c
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
giancarloromeo Jul 28, 2025
54028fb
fix: move project_exists
giancarloromeo Jul 28, 2025
5f6f274
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
pcrespov Jul 28, 2025
caa2799
rename
pcrespov Jul 28, 2025
6615e9b
rm project dependency
pcrespov Jul 28, 2025
8181580
Updates Node model and cleanup
pcrespov Jul 28, 2025
7e1fb26
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
pcrespov Jul 28, 2025
cce82cb
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
pcrespov Jul 28, 2025
86846a6
Merge remote-tracking branch 'upstream/master' into is5646/use-projec…
giancarloromeo Jul 29, 2025
e33be86
fix: use annotated functional validators
giancarloromeo Jul 29, 2025
5bce45d
fix: fixtures still using workbench
giancarloromeo Jul 29, 2025
a0d89e4
fix: paths with problematic names
giancarloromeo Jul 29, 2025
b58f26f
fix: RPC tests
giancarloromeo Jul 29, 2025
2700ee6
fix: minor
giancarloromeo Jul 29, 2025
14f50e6
fix: frontend data generator
giancarloromeo Jul 29, 2025
43630d5
fix: project_id type
giancarloromeo Jul 29, 2025
243c5e8
fix: unpack created project/nodes
giancarloromeo Jul 29, 2025
427f998
fix: unpack
giancarloromeo Jul 29, 2025
841593d
fix: clone test
giancarloromeo Jul 29, 2025
dbf42b6
fix: project_nodes
giancarloromeo Jul 29, 2025
3b8a3ba
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 29, 2025
1adee7e
fix: node names mapping
giancarloromeo Jul 29, 2025
2961b6f
fix: nullable workbench
giancarloromeo Jul 30, 2025
f5ae1c5
fix: exclude workbench from validation
giancarloromeo Jul 30, 2025
d9881a1
fix: validate ignoring workbench
giancarloromeo Jul 30, 2025
1ceff4d
fix: temp include workbench on a validation
giancarloromeo Jul 30, 2025
a47e4c8
fix: folder body
giancarloromeo Jul 30, 2025
45a07b8
fix: workbench
giancarloromeo Jul 30, 2025
03acbd8
fix: remove workbench
giancarloromeo Jul 30, 2025
b16810c
fix: workbench
giancarloromeo Jul 30, 2025
6558b5a
fix: webserver
giancarloromeo Jul 30, 2025
2bc186d
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 31, 2025
adb9897
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Jul 31, 2025
67c2183
fix: workbench
giancarloromeo Jul 31, 2025
6048085
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
giancarloromeo Jul 31, 2025
4455d50
fix: use batch call
giancarloromeo Jul 31, 2025
2954940
Merge remote-tracking branch 'upstream/master' into is5646/use-projec…
giancarloromeo Aug 4, 2025
0eec938
storage: returns minimal tuple
pcrespov Aug 4, 2025
d52d3e7
proper migration project.workbench
pcrespov Aug 4, 2025
30b2b7f
using insert_and_get_row
pcrespov Aug 4, 2025
38da394
fixes logs
pcrespov Aug 4, 2025
a0b71bb
doc
pcrespov Aug 4, 2025
ab0a810
fix: projects states handlers
giancarloromeo Aug 5, 2025
e86fe27
fix: typecheck
giancarloromeo Aug 5, 2025
ae80167
fix: typecheck
giancarloromeo Aug 5, 2025
5dde879
fix: relative import
giancarloromeo Aug 5, 2025
a2a8a27
fix: typecheck
giancarloromeo Aug 5, 2025
f4fd950
fix: extract workbench
giancarloromeo Aug 5, 2025
3a25b02
fix: use workbench subquery
giancarloromeo Aug 5, 2025
a4cbb9a
fix: use workbench subquery
giancarloromeo Aug 5, 2025
e5de7b1
fix: get project with workbench
giancarloromeo Aug 5, 2025
907708b
fix: imports
giancarloromeo Aug 5, 2025
3156531
fix: inputs required nullability
giancarloromeo Aug 5, 2025
7b07b66
fix: typecheck
giancarloromeo Aug 5, 2025
0a3d8d7
fix: project cancellation
giancarloromeo Aug 5, 2025
4f43294
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
pcrespov Aug 5, 2025
e327c6b
model_dump_as_node
pcrespov Aug 5, 2025
ded3e8d
fixes fixture
pcrespov Aug 5, 2025
9c23c06
cleanup
pcrespov Aug 5, 2025
994cc0d
fixes workbench retrieval
pcrespov Aug 5, 2025
2ce1cc6
fixes insert batch
pcrespov Aug 5, 2025
b0f1626
Merge branch 'master' into pr/giancarloromeo/8141
pcrespov Aug 5, 2025
a9b80b2
no need to restor workbench
pcrespov Aug 5, 2025
087ec30
remove define `_projects_service.get_project_for_user`
pcrespov Aug 5, 2025
7b2639c
fix: validate workbench against nodes
giancarloromeo Aug 5, 2025
1770502
fix: return project with workbench when creating
giancarloromeo Aug 5, 2025
5b213c0
fix: create project fixture
giancarloromeo Aug 5, 2025
ea67751
fix: workbench when share workpace
giancarloromeo Aug 6, 2025
9295602
fix: workbench when getting workspaces
giancarloromeo Aug 6, 2025
58549f7
fix: include None
giancarloromeo Aug 6, 2025
41d4182
fix: extract only not nulls
giancarloromeo Aug 6, 2025
9b892c1
Merge remote-tracking branch 'upstream/master' into is5646/use-projec…
giancarloromeo Aug 6, 2025
6ac876d
Merge remote-tracking branch 'upstream/master' into is5646/use-projec…
giancarloromeo Aug 6, 2025
d4b90ff
Add trigger/function when updating project nodes
giancarloromeo Aug 7, 2025
d95331f
Fix script
giancarloromeo Aug 7, 2025
a797222
fix: delete project_node
giancarloromeo Aug 7, 2025
bf033d2
remove unused
giancarloromeo Aug 7, 2025
c9c6a1e
fix: script downgrade order
giancarloromeo Aug 7, 2025
73e8ca1
fix: test
giancarloromeo Aug 7, 2025
9e0e95f
fix: lastChangeDate assert
giancarloromeo Aug 7, 2025
790feaf
fix: test
giancarloromeo Aug 7, 2025
b81f5b2
fix: node creation
giancarloromeo Aug 7, 2025
f41304c
typecheck
giancarloromeo Aug 7, 2025
86c5a75
typecheck
giancarloromeo Aug 7, 2025
b0b2667
remove old
giancarloromeo Aug 7, 2025
726cdc3
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Aug 7, 2025
0a16f40
remove unused
giancarloromeo Aug 7, 2025
fba3af1
use new repo
giancarloromeo Aug 7, 2025
9a7c654
remove get project
giancarloromeo Aug 7, 2025
725be27
update nodes
giancarloromeo Aug 8, 2025
5e14001
fix document creation
giancarloromeo Aug 8, 2025
0cecabd
fix tests
giancarloromeo Aug 8, 2025
f8fa9e6
fix test
giancarloromeo Aug 8, 2025
8ffa91b
fix tests
giancarloromeo Aug 8, 2025
e5a9b5f
fix
giancarloromeo Aug 8, 2025
42ee9d1
fix deepdiff
giancarloromeo Aug 8, 2025
661b5a5
remove tests
giancarloromeo Aug 8, 2025
325608c
fix model_dump
giancarloromeo Aug 8, 2025
127e90a
fix
giancarloromeo Aug 8, 2025
df2e204
fix test
giancarloromeo Aug 8, 2025
824200a
fix int test
giancarloromeo Aug 8, 2025
c69df79
tests: ignore order
giancarloromeo Aug 11, 2025
6c0431f
fix: inputs required
giancarloromeo Aug 11, 2025
ee01c01
fix: node outputs
giancarloromeo Aug 11, 2025
6a51b9a
fix: more efficient get product
giancarloromeo Aug 11, 2025
77762b3
refactor: remove access to workbench
giancarloromeo Aug 12, 2025
289544c
Fix bug
matusdrobuliak66 Aug 12, 2025
c8d26b5
Merge remote-tracking branch 'matusdrobuliak66/fix-access-rights-work…
giancarloromeo Aug 12, 2025
7db6618
fix: project node states
giancarloromeo Aug 12, 2025
9fb1220
fix: project states
giancarloromeo Aug 13, 2025
5757eb8
fix: validator
giancarloromeo Aug 13, 2025
19834d2
fix: get project with None
giancarloromeo Aug 13, 2025
bbc6560
fix: get project
giancarloromeo Aug 13, 2025
393e7db
fix: tags
giancarloromeo Aug 13, 2025
546003f
fix: workbench
giancarloromeo Aug 13, 2025
21a4ed0
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Aug 13, 2025
e2df3dd
fix: get project response
giancarloromeo Aug 13, 2025
2f611c3
Merge branch 'is5646/use-project-nodes-table-instead-of-workbench' of…
giancarloromeo Aug 13, 2025
20f70f6
fix: workbench
giancarloromeo Aug 13, 2025
1319020
fix: node state
giancarloromeo Aug 13, 2025
bfa1685
remove workbench
giancarloromeo Aug 13, 2025
044edc5
fix: repo
giancarloromeo Aug 14, 2025
de831c4
fix: new syntax
giancarloromeo Aug 14, 2025
9dada93
fix: include unset
giancarloromeo Aug 14, 2025
d453f76
tests: prettify deepdiff
giancarloromeo Aug 14, 2025
f29cf8c
fix: test
giancarloromeo Aug 14, 2025
7928dfb
fix: model dump without aliases
giancarloromeo Aug 14, 2025
88c3159
typecheck
giancarloromeo Aug 14, 2025
d01e3c3
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Aug 14, 2025
5dd1c82
fix: node creation
giancarloromeo Aug 14, 2025
c1826f8
fix: typecheck
giancarloromeo Aug 14, 2025
ae75ac1
fix: node creation
giancarloromeo Aug 14, 2025
3547a21
typecheck
giancarloromeo Aug 14, 2025
6104f45
fix: response
giancarloromeo Aug 15, 2025
994adda
fix: match
giancarloromeo Aug 15, 2025
f6ba587
fix: nullability
giancarloromeo Aug 15, 2025
da63986
fix test
giancarloromeo Aug 15, 2025
0df85db
remove workbench
giancarloromeo Aug 15, 2025
e9793e1
fix: project creation with nodes
giancarloromeo Aug 15, 2025
198bb4b
clean
giancarloromeo Aug 15, 2025
2748c5a
remove unused
giancarloromeo Aug 15, 2025
f4655a9
remove fixme
giancarloromeo Aug 15, 2025
b8c966e
fix: streams
giancarloromeo Aug 15, 2025
8eabd50
fix relative
giancarloromeo Aug 15, 2025
a415e87
fix: revert casing
giancarloromeo Aug 15, 2025
13bbe34
fix random
giancarloromeo Aug 15, 2025
99c2eb7
rename
giancarloromeo Aug 15, 2025
7e3bbe9
fix helper
giancarloromeo Aug 15, 2025
7d71e9f
fix
giancarloromeo Aug 15, 2025
c946376
fix
giancarloromeo Aug 15, 2025
6972a84
fix
giancarloromeo Aug 15, 2025
3bf0399
fix
giancarloromeo Aug 15, 2025
6f2dbf3
fix warnings logs
giancarloromeo Aug 15, 2025
f325339
remove position
giancarloromeo Aug 15, 2025
3464789
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
giancarloromeo Aug 15, 2025
bb16e26
fix
giancarloromeo Aug 15, 2025
e918dce
Merge branches 'is5646/use-project-nodes-table-instead-of-workbench' …
giancarloromeo Aug 15, 2025
df073b1
fix tests
giancarloromeo Aug 15, 2025
89404b9
fix
giancarloromeo Aug 15, 2025
669b4a8
fix
giancarloromeo Aug 15, 2025
6105bda
fix logs
giancarloromeo Aug 15, 2025
22d39ed
fix
giancarloromeo Aug 15, 2025
1b53a30
fix
giancarloromeo Aug 15, 2025
75d7e55
fix
giancarloromeo Aug 15, 2025
b82302f
fix
giancarloromeo Aug 15, 2025
e12c40b
fix
giancarloromeo Aug 15, 2025
9dfe2df
revert models
giancarloromeo Aug 15, 2025
88f91f5
fix: improve listing
giancarloromeo Aug 18, 2025
db156e4
fix: script
giancarloromeo Aug 18, 2025
6e17b80
fix: connection
giancarloromeo Aug 18, 2025
c5a12a0
Merge remote-tracking branch 'upstream/master' into is5646/use-projec…
giancarloromeo Aug 18, 2025
b7bb036
fix
giancarloromeo Aug 18, 2025
ec1d762
fix: model dump
giancarloromeo Aug 19, 2025
5718e92
try to fix
giancarloromeo Aug 19, 2025
260c4ab
try to fix 2.0
giancarloromeo Aug 19, 2025
cc86d53
fix: workbench nulls
giancarloromeo Aug 19, 2025
413f4dc
fix: test
giancarloromeo Aug 19, 2025
6780a88
Merge branch 'master' into pr/giancarloromeo/8141
pcrespov Aug 22, 2025
fb3179e
fix: alembic
giancarloromeo Aug 22, 2025
ed060af
fix: typecheck
giancarloromeo Aug 22, 2025
ac12cba
fix: duplicate by_alias
giancarloromeo Aug 22, 2025
eafc2d3
updates webserver OAS
pcrespov Aug 22, 2025
f9483cb
fixes update node's states
pcrespov Aug 22, 2025
6b0048f
fixes mypy
pcrespov Aug 22, 2025
c93168a
fixes test listerner
pcrespov Aug 22, 2025
c66590d
fixes test helper
pcrespov Aug 22, 2025
f3512b3
db returns None. sa.func.json_strip_nulls -> sa.func.json
pcrespov Aug 22, 2025
08f1138
Merge branch 'master' into is5646/use-project-nodes-table-instead-of-…
pcrespov Aug 22, 2025
fb73d03
type
pcrespov Aug 22, 2025
4217743
Merge branch 'master' into pr/giancarloromeo/8141
pcrespov Sep 4, 2025
7c6197d
Adapts revisitons
pcrespov Sep 4, 2025
4b70868
fix
pcrespov Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ProjectGet(OutputSchema):

# display
name: str
description: str
description: Annotated[str, BeforeValidator(none_to_empty_str_pre_validator)]
thumbnail: HttpUrl | Literal[""]

type: ProjectType
Expand All @@ -144,7 +144,7 @@ class ProjectGet(OutputSchema):
trashed_at: datetime | None
trashed_by: Annotated[
GroupID | None, Field(description="The primary gid of the user who trashed")
]
] = None

# labeling
tags: list[int]
Expand All @@ -166,10 +166,6 @@ class ProjectGet(OutputSchema):
workspace_id: WorkspaceID | None
folder_id: FolderID | None

_empty_description = field_validator("description", mode="before")(
none_to_empty_str_pre_validator
)

@staticmethod
def _update_json_schema_extra(schema: JsonDict) -> None:
schema.update(
Expand Down
14 changes: 5 additions & 9 deletions packages/models-library/src/models_library/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from common_library.basic_types import DEFAULT_FACTORY
from pydantic import (
BaseModel,
BeforeValidator,
ConfigDict,
Field,
HttpUrl,
Expand Down Expand Up @@ -85,13 +86,17 @@ class BaseProjectModel(BaseModel):
]
description: Annotated[
str,
BeforeValidator(none_to_empty_str_pre_validator),
Field(
description="longer one-line description about the project",
examples=["Dabbling in temporal transitions ..."],
),
]
thumbnail: Annotated[
HttpUrl | None,
BeforeValidator(
empty_str_to_none_pre_validator,
),
Field(
description="url of the project thumbnail",
examples=["https://placeimg.com/171/96/tech/grayscale/?0.jpg"],
Expand All @@ -104,15 +109,6 @@ class BaseProjectModel(BaseModel):
# Pipeline of nodes (SEE projects_nodes.py)
workbench: Annotated[NodesDict, Field(description="Project's pipeline")]

# validators
_empty_thumbnail_is_none = field_validator("thumbnail", mode="before")(
empty_str_to_none_pre_validator
)

_none_description_is_empty = field_validator("description", mode="before")(
none_to_empty_str_pre_validator
)


class ProjectAtDB(BaseProjectModel):
# Model used to READ from database
Expand Down
38 changes: 29 additions & 9 deletions packages/models-library/src/models_library/projects_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,22 @@ class NodeState(BaseModel):

model_config = ConfigDict(
extra="forbid",
populate_by_name=True,
validate_by_alias=True,
validate_by_name=True,
json_schema_extra={
"examples": [
# example with alias name
{
"modified": True,
"dependencies": [],
"currentStatus": "NOT_STARTED",
},
# example with field name
{
"modified": True,
"dependencies": [],
"current_status": "NOT_STARTED",
},
{
"modified": True,
"dependencies": ["42838344-03de-4ce2-8d93-589a5dcdfd05"],
Expand Down Expand Up @@ -230,7 +238,7 @@ class Node(BaseModel):
Field(description="The short name of the node", examples=["JupyterLab"]),
]
progress: Annotated[
float | None,
int | None,
Field(
ge=0,
le=100,
Expand Down Expand Up @@ -302,22 +310,28 @@ class Node(BaseModel):
Field(default_factory=dict, description="values of output properties"),
] = DEFAULT_FACTORY

output_node: Annotated[bool | None, Field(deprecated=True, alias="outputNode")] = (
None # <-- (DEPRECATED) Can be removed
)
output_node: Annotated[
bool | None,
Field(
deprecated=True,
alias="outputNode",
),
] = None # <-- (DEPRECATED) Can be removed

output_nodes: Annotated[ # <-- (DEPRECATED) Can be removed
list[NodeID] | None,
Field(
description="Used in group-nodes. Node IDs of those connected to the output",
alias="outputNodes",
deprecated=True,
),
Comment on lines +313 to 327
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about removing these?

] = None

parent: Annotated[ # <-- (DEPRECATED) Can be removed
NodeID | None,
Field(
description="Parent's (group-nodes') node ID s. Used to group",
deprecated=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

),
] = None

Expand All @@ -334,6 +348,10 @@ class Node(BaseModel):
Field(default_factory=NodeState, description="The node's state object"),
] = DEFAULT_FACTORY

required_resources: Annotated[
dict[str, Any] | None, Field(default_factory=dict)
] = DEFAULT_FACTORY

boot_options: Annotated[
dict[EnvVarKey, str] | None,
Field(
Expand Down Expand Up @@ -453,12 +471,14 @@ def _update_json_schema_extra(schema: JsonDict) -> None:

model_config = ConfigDict(
extra="forbid",
populate_by_name=True,
validate_by_name=True,
validate_by_alias=True,
json_schema_extra=_update_json_schema_extra,
)


class PartialNode(Node):
key: Annotated[ServiceKey, Field(default=None)]
version: Annotated[ServiceVersion, Field(default=None)]
label: Annotated[str, Field(default=None)]
# NOTE: `type: ignore[assignment]` is needed because mypy gets confused when overriding the types by adding the Union with None
key: ServiceKey | None = None # type: ignore[assignment]
version: ServiceVersion | None = None # type: ignore[assignment]
label: str | None = None # type: ignore[assignment]
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
UUID_RE,
)

NodeID = UUID

UUIDStr: TypeAlias = Annotated[str, StringConstraints(pattern=UUID_RE)]

NodeID: TypeAlias = UUID
NodeIDStr: TypeAlias = UUIDStr

LocationID: TypeAlias = int
Expand Down
19 changes: 17 additions & 2 deletions packages/models-library/tests/test_services_types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import pytest
from models_library.projects import ProjectID
from models_library.projects_nodes import NodeID
from models_library.services_types import ServiceRunID
from models_library.services_types import ServiceKey, ServiceRunID, ServiceVersion
from models_library.users import UserID
from pydantic import PositiveInt
from pydantic import PositiveInt, TypeAdapter
from pytest_simcore.helpers.faker_factories import (
random_service_key,
random_service_version,
)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -38,3 +42,14 @@ def test_get_resource_tracking_run_id_for_dynamic():
assert isinstance(
ServiceRunID.get_resource_tracking_run_id_for_dynamic(), ServiceRunID
)


@pytest.mark.parametrize(
"service_key, service_version",
[(random_service_key(), random_service_version()) for _ in range(10)],
)
def test_faker_factory_service_key_and_version_are_in_sync(
service_key: ServiceKey, service_version: ServiceVersion
):
TypeAdapter(ServiceKey).validate_python(service_key)
TypeAdapter(ServiceVersion).validate_python(service_version)
Loading
Loading