Skip to content
Merged
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.8.48"
version = "2.8.49"
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
15 changes: 14 additions & 1 deletion src/uipath/_cli/_push/sw_file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,25 @@ async def upload_source_files(
remote_files = self._get_remote_files(structure)

# Get files to upload and process them
local_files = files_to_include(
local_files, skipped_files = files_to_include(
pack_options,
self.directory,
self.include_uv_lock,
)

# Log skipped files from root evals folder
if skipped_files:
evals_folder_path = os.path.join(self.directory, "evals")
logger.info(
f"Skipping {len(skipped_files)} file(s) in evals folder ({evals_folder_path}): {', '.join(skipped_files)}"
)
for skipped_file in skipped_files:
yield UpdateEvent(
file_path=skipped_file,
status="skipped",
message=f"Skipping '{skipped_file}' (evals folder)",
)

updates = await self._process_file_uploads(local_files, remote_files)

# Yield all updates
Expand Down
18 changes: 15 additions & 3 deletions src/uipath/_cli/_utils/_project_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def files_to_include(
directory: str,
include_uv_lock: bool = True,
directories_to_ignore: list[str] | None = None,
) -> list[FileInfo]:
) -> tuple[list[FileInfo], list[str]]:
"""Get list of files to include in the project based on configuration.

Walks through the directory tree and identifies files to include based on extensions
Expand All @@ -386,7 +386,7 @@ def files_to_include(
directories_to_ignore: List of directories to ignore

Returns:
list[FileInfo]: List of file information objects for included files
tuple[list[FileInfo], list[str]]: Tuple of (included files, skipped file paths)
"""
file_extensions_included = [".py", ".mermaid", ".json", ".yaml", ".yml", ".md"]
files_included = ["pyproject.toml"]
Expand Down Expand Up @@ -422,8 +422,15 @@ def is_venv_dir(d: str) -> bool:
)

extra_files: list[FileInfo] = []
skipped_files: list[str] = []

# Walk through directory and return all files in the allowlist
for root, dirs, files in os.walk(directory):
# Determine if we're in the root evals folder
root_rel_path = os.path.relpath(root, directory)
normalized_root_rel_path = root_rel_path.replace(os.sep, "/")
is_root_evals_folder = normalized_root_rel_path == "evals"

# Skip all directories that start with . or are a venv or are excluded
included_dirs = []
for d in dirs:
Expand Down Expand Up @@ -461,6 +468,11 @@ def is_venv_dir(d: str) -> bool:
# Normalize the path
normalized_rel_path = rel_path.replace(os.sep, "/")

# Skip files in the root evals folder (but allow eval-set and evaluators subdirectories)
if is_root_evals_folder:
skipped_files.append(normalized_rel_path)
continue

# Check inclusion: by extension, by filename (for base directory), or by relative path
should_include = (
file_extension in file_extensions_included
Expand Down Expand Up @@ -489,7 +501,7 @@ def is_venv_dir(d: str) -> bool:
is_binary=is_binary_file(file_extension),
)
)
return extra_files
return extra_files, skipped_files


def compute_normalized_hash(content: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/uipath/_cli/cli_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def pack_fn(
z.writestr(f"{project_name}.nuspec", nuspec_content)
z.writestr("_rels/.rels", rels_content)

files = files_to_include(
files, skipped_files = files_to_include(
config_data.pack_options,
directory,
include_uv_lock,
Expand Down
33 changes: 20 additions & 13 deletions src/uipath/telemetry/_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ def _initialize() -> None:

# Set application version
_AppInsightsEventClient._client.context.application.ver = version("uipath")
except Exception:
# Silently fail - telemetry should never break the main application
pass
except Exception as e:
# Log but don't raise - telemetry should never break the main application
_logger.warning(f"Failed to initialize Application Insights client: {e}")
_logger.debug("Application Insights initialization error", exc_info=True)

@staticmethod
def track_event(
Expand Down Expand Up @@ -193,18 +194,21 @@ def track_event(
)
# Note: We don't flush after every event to avoid blocking.
# Events will be sent in batches by the SDK.
except Exception:
# Telemetry should never break the main application
pass
except Exception as e:
# Log but don't raise - telemetry should never break the main application
_logger.warning(f"Failed to track event '{name}': {e}")
_logger.debug(f"Event tracking error for '{name}'", exc_info=True)

@staticmethod
def flush() -> None:
"""Flush any pending telemetry events."""
if _AppInsightsEventClient._client:
try:
_AppInsightsEventClient._client.flush()
except Exception:
pass
except Exception as e:
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

# Log but don't raise - telemetry should never break the main application
_logger.warning(f"Failed to flush telemetry events: {e}")
_logger.debug("Telemetry flush error", exc_info=True)


class _TelemetryClient:
Expand Down Expand Up @@ -238,8 +242,10 @@ def _initialize():
_logger.setLevel(INFO)

_TelemetryClient._initialized = True
except Exception:
pass
except Exception as e:
# Log but don't raise - telemetry should never break the main application
_logger.warning(f"Failed to initialize telemetry client: {e}")
_logger.debug("Telemetry initialization error", exc_info=True)

@staticmethod
def _track_method(name: str, attrs: Optional[Dict[str, Any]] = None):
Expand Down Expand Up @@ -278,9 +284,10 @@ def track_event(

try:
_AppInsightsEventClient.track_event(name, properties)
except Exception:
# Telemetry should never break the main application
pass
except Exception as e:
# Log but don't raise - telemetry should never break the main application
_logger.warning(f"Failed to track event '{name}': {e}")
_logger.debug(f"Event tracking error for '{name}'", exc_info=True)


def track_event(
Expand Down
Loading