Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
venv
.venv
.venv-test
build
dist
*.build
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = 'socket.dev'
__version__ = '2.2.68'
__version__ = '2.2.69'
USER_AGENT = f'SocketPythonCLI/{__version__}'
28 changes: 26 additions & 2 deletions socketsecurity/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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="Created detailed analysis log file path 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",
Expand Down
19 changes: 15 additions & 4 deletions socketsecurity/core/tools/reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion socketsecurity/socketcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading