diff --git a/.gitignore b/.gitignore index d6408eb..06780f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea venv .venv +.venv-test build dist *.build diff --git a/CHANGELOG.md b/CHANGELOG.md index 62aaae7..b8ba70e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 2.2.69 + +- Added `--reach-enable-analysis-splitting` flag to enable analysis splitting (disabled by default). +- Added `--reach-detailed-analysis-log-file` flag to print detailed analysis log file path. +- Added `--reach-lazy-mode` flag to enable lazy mode for reachability analysis. +- Changed default behavior: analysis splitting is now disabled by default. The old `--reach-disable-analysis-splitting` flag is kept as a hidden no-op for backwards compatibility. + ## 2.2.64 - Included PyPy in the Docker image. diff --git a/pyproject.toml b/pyproject.toml index 7d4f6e2..f9eacab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.2.68" +version = "2.2.69" requires-python = ">= 3.10" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 766405e..8736004 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,3 +1,3 @@ __author__ = 'socket.dev' -__version__ = '2.2.68' +__version__ = '2.2.69' USER_AGENT = f'SocketPythonCLI/{__version__}' diff --git a/socketsecurity/config.py b/socketsecurity/config.py index ea78382..5105281 100644 --- a/socketsecurity/config.py +++ b/socketsecurity/config.py @@ -72,7 +72,10 @@ class CliConfig: reach_analysis_memory_limit: Optional[int] = None reach_analysis_timeout: Optional[int] = None reach_disable_analytics: bool = False - reach_disable_analysis_splitting: bool = False + reach_disable_analysis_splitting: bool = False # Deprecated, kept for backwards compatibility + reach_enable_analysis_splitting: bool = False + reach_detailed_analysis_log_file: bool = False + reach_lazy_mode: bool = False reach_ecosystems: Optional[List[str]] = None reach_exclude_paths: Optional[List[str]] = None reach_skip_cache: bool = False @@ -148,6 +151,9 @@ def from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig': 'reach_analysis_memory_limit': args.reach_analysis_memory_limit, 'reach_disable_analytics': args.reach_disable_analytics, 'reach_disable_analysis_splitting': args.reach_disable_analysis_splitting, + 'reach_enable_analysis_splitting': args.reach_enable_analysis_splitting, + 'reach_detailed_analysis_log_file': args.reach_detailed_analysis_log_file, + 'reach_lazy_mode': args.reach_lazy_mode, 'reach_ecosystems': args.reach_ecosystems.split(',') if args.reach_ecosystems else None, 'reach_exclude_paths': args.reach_exclude_paths.split(',') if args.reach_exclude_paths else None, 'reach_skip_cache': args.reach_skip_cache, @@ -642,7 +648,25 @@ def create_argument_parser() -> argparse.ArgumentParser: "--reach-disable-analysis-splitting", dest="reach_disable_analysis_splitting", action="store_true", - help="Disable analysis splitting/bucketing for reachability analysis" + help=argparse.SUPPRESS # Deprecated, kept for backwards compatibility (no-op) + ) + reachability_group.add_argument( + "--reach-enable-analysis-splitting", + dest="reach_enable_analysis_splitting", + action="store_true", + help="Enable analysis splitting/bucketing for reachability analysis (disabled by default). This is a legacy feature for improving performance" + ) + reachability_group.add_argument( + "--reach-detailed-analysis-log-file", + dest="reach_detailed_analysis_log_file", + action="store_true", + help="Create a detailed analysis log file for reachability analysis. The output path is written to stdout" + ) + reachability_group.add_argument( + "--reach-lazy-mode", + dest="reach_lazy_mode", + action="store_true", + help="Enable lazy mode for reachability analysis. This is an experimental feature for improving performance" ) reachability_group.add_argument( "--reach-output-file", diff --git a/socketsecurity/core/tools/reachability.py b/socketsecurity/core/tools/reachability.py index f757a17..581ea70 100644 --- a/socketsecurity/core/tools/reachability.py +++ b/socketsecurity/core/tools/reachability.py @@ -93,7 +93,9 @@ def run_reachability_analysis( min_severity: Optional[str] = None, skip_cache: bool = False, disable_analytics: bool = False, - disable_analysis_splitting: bool = False, + enable_analysis_splitting: bool = False, + detailed_analysis_log_file: bool = False, + lazy_mode: bool = False, repo_name: Optional[str] = None, branch_name: Optional[str] = None, version: Optional[str] = None, @@ -118,7 +120,9 @@ def run_reachability_analysis( min_severity: Minimum severity level (info, low, moderate, high, critical) skip_cache: Skip cache usage disable_analytics: Disable analytics sharing - disable_analysis_splitting: Disable analysis splitting + enable_analysis_splitting: Enable analysis splitting (disabled by default) + detailed_analysis_log_file: Print detailed analysis log file path + lazy_mode: Enable lazy mode for analysis repo_name: Repository name branch_name: Branch name version: Specific version of @coana-tech/cli to use @@ -156,9 +160,16 @@ def run_reachability_analysis( if disable_analytics: cmd.append("--disable-analytics-sharing") - - if disable_analysis_splitting: + + # Analysis splitting is disabled by default; only omit the flag if explicitly enabled + if not enable_analysis_splitting: cmd.append("--disable-analysis-splitting") + + if detailed_analysis_log_file: + cmd.append("--print-analysis-log-file") + + if lazy_mode: + cmd.append("--lazy-mode") # KEY POINT: Only add manifest tar hash if we have one if tar_hash: diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index a92b34b..86367f4 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -291,7 +291,9 @@ def main_code(): min_severity=config.reach_min_severity, skip_cache=config.reach_skip_cache or False, disable_analytics=config.reach_disable_analytics or False, - disable_analysis_splitting=config.reach_disable_analysis_splitting or False, + enable_analysis_splitting=config.reach_enable_analysis_splitting or False, + detailed_analysis_log_file=config.reach_detailed_analysis_log_file or False, + lazy_mode=config.reach_lazy_mode or False, repo_name=config.repo, branch_name=config.branch, version=config.reach_version,