Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.5.9"
version = "2.5.10"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
9 changes: 4 additions & 5 deletions src/uipath/_cli/_utils/_studio_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,21 +485,20 @@ def __init__(self, project_id: str, uipath: Optional[UiPath] = None):
f"/studio_/backend/api/Project/{project_id}/Lock"
)
self._project_id = project_id
self._solution_id_cache: Optional[str] = None
self._resources_cache: Optional[List[dict[str, Any]]] = None
self._project_structure_cache: Optional[ProjectStructure] = None

async def _get_solution_id(self) -> str:
# implement property cache logic as coroutines are not supported
if self._solution_id_cache is not None:
return self._solution_id_cache
if (solution_id := UiPathConfig.studio_solution_id) is not None:
return solution_id
response = await self.uipath.api_client.request_async(
"GET",
url=f"/studio_/backend/api/Project/{self._project_id}",
scoped="org",
)
self._solution_id_cache = response.json()["solutionId"]
return self._solution_id_cache
UiPathConfig.studio_solution_id = response.json()["solutionId"]
return UiPathConfig.studio_solution_id

async def ensure_coded_agent_project_async(self):
structure = await self.get_project_structure_async()
Expand Down
2 changes: 2 additions & 0 deletions src/uipath/_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
ENV_JOB_ID = "UIPATH_JOB_ID"
ENV_ROBOT_KEY = "UIPATH_ROBOT_KEY"
ENV_TENANT_ID = "UIPATH_TENANT_ID"
ENV_TENANT_NAME = "UIPATH_TENANT_NAME"
ENV_ORGANIZATION_ID = "UIPATH_ORGANIZATION_ID"
ENV_TELEMETRY_ENABLED = "UIPATH_TELEMETRY_ENABLED"
ENV_UIPATH_PROJECT_ID = "UIPATH_PROJECT_ID"
ENV_UIPATH_AGENT_ID = "UIPATH_AGENT_ID"
ENV_UIPATH_PROCESS_UUID = "UIPATH_PROCESS_UUID"
ENV_UIPATH_TRACE_ID = "UIPATH_TRACE_ID"
ENV_UIPATH_PROCESS_VERSION = "UIPATH_PROCESS_VERSION"
Expand Down
13 changes: 13 additions & 0 deletions src/uipath/platform/common/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class UiPathApiConfig(BaseModel):

class ConfigurationManager:
_instance = None
studio_solution_id: str | None = None

def __new__(cls):
if cls._instance is None:
Expand Down Expand Up @@ -41,6 +42,18 @@ def project_id(self) -> str | None:

return os.getenv(ENV_UIPATH_PROJECT_ID, None)

@property
def agent_id(self) -> str | None:
from uipath._utils.constants import ENV_UIPATH_AGENT_ID

return os.getenv(ENV_UIPATH_AGENT_ID, None)

@property
def tenant_name(self) -> str | None:
from uipath._utils.constants import ENV_TENANT_NAME

return os.getenv(ENV_TENANT_NAME, None)

@property
def organization_id(self) -> str | None:
from uipath._utils.constants import ENV_ORGANIZATION_ID
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading