Compare commits

...

3 Commits

Author SHA1 Message Date
Jonathon Broughton 89280acf53 Update fixtures.py
Minor upgrade of ruff breaks without this fix
2025-02-10 14:57:26 +00:00
Chuck Driesler 78c55b787f chore(automate): improve error message when automate fails to receive a model version (#376)
Co-authored-by: Björn Steinhagen <steinhagen.bjoern@gmail.com>
2025-01-24 11:28:15 +00:00
Jedd Morgan 34f2dc2ab6 author now optional (#377) 2025-01-24 11:01:09 +00:00
3 changed files with 16 additions and 7 deletions
+11 -2
View File
@@ -101,8 +101,17 @@ class AutomationContext:
commit = self.speckle_client.commit.get(
self.automation_run_data.project_id, version_id
)
if not commit.referencedObject:
raise ValueError("The commit has no referencedObject, cannot receive it.")
if not commit or not commit.referencedObject:
raise ValueError(
f"""\
Could not receive specified version.
{"The commit has no referencedObject." if not commit.referencedObject else ""}
Is your environment configured correctly?
project_id: {self.automation_run_data.project_id}
model_id: {self.automation_run_data.triggers[0].payload.model_id}
version_id: {self.automation_run_data.triggers[0].payload.version_id}
"""
)
base = operations.receive(
commit.referencedObject, self._server_transport, self._memory_transport
)
+4 -4
View File
@@ -22,10 +22,10 @@ class TestAutomationEnvironment(BaseSettings):
extra="ignore",
)
token: str = Field()
server_url: str = Field()
project_id: str = Field()
automation_id: str = Field()
token: str = Field(default="")
server_url: str = Field(default="")
project_id: str = Field(default="")
automation_id: str = Field(default="")
@pytest.fixture()
+1 -1
View File
@@ -126,7 +126,7 @@ class Version(BaseModel):
class Model(BaseModel):
author: LimitedUser
author: Optional[LimitedUser]
createdAt: datetime
description: Optional[str]
displayName: str