From 42bbbed14932f473ddc0bb7cdb5114599aae20ce Mon Sep 17 00:00:00 2001 From: Martin Torp Date: Mon, 23 Nov 2026 12:07:34 +0100 Subject: [PATCH 1/2] Retire --reach-enable-analysis-splitting The Coana CLI no longer splits analyses, so the flag has nothing left to turn on. It is now a hidden no-op, like --reach-disable-analysis-splitting. It still parses, so existing CI scripts keep working. Reachability now always passes --disable-analysis-splitting to Coana. A version picked with --reach-version that still splits by default runs a single analysis too, and newer versions ignore the flag. Bump to 2.13.3. --- CHANGELOG.md | 14 ++++++++++++++ docs/cli-reference.md | 3 +-- pyproject.toml | 2 +- socketsecurity/__init__.py | 2 +- socketsecurity/config.py | 4 +--- socketsecurity/core/tools/reachability.py | 7 ++----- socketsecurity/socketcli.py | 1 - tests/unit/test_config.py | 9 +++++++++ tests/unit/test_reachability.py | 4 ++++ uv.lock | 2 +- 10 files changed, 34 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165e42c5..f6976819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 2.13.3 + +### Deprecated + +- `--reach-enable-analysis-splitting` is now a hidden no-op, since the Coana + CLI no longer splits analyses. The flag still parses, so existing CI scripts + keep working. Remove it when convenient. + +### Changed + +- Reachability always passes `--disable-analysis-splitting` to the Coana CLI, + so a version picked with `--reach-version` that still splits by default + runs a single analysis too. + ## 2.13.2 ### Added diff --git a/docs/cli-reference.md b/docs/cli-reference.md index 3a9ebab6..c050ea6e 100644 --- a/docs/cli-reference.md +++ b/docs/cli-reference.md @@ -218,7 +218,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [-- [--ignore-commit-files] [--disable-blocking] [--disable-ignore] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders] [--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT] [--reach-analysis-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-concurrency REACH_CONCURRENCY] [--reach-ecosystems REACH_ECOSYSTEMS] - [--reach-min-severity ] [--reach-skip-cache] [--reach-disable-analytics] [--reach-enable-analysis-splitting] [--reach-detailed-analysis-log-file] + [--reach-min-severity ] [--reach-skip-cache] [--reach-disable-analytics] [--reach-detailed-analysis-log-file] [--reach-use-only-pregenerated-sboms] [--reach-debug] [--reach-disable-external-tool-checks] [--reach-disable-dependency-downloads] [--reach-output-file REACH_OUTPUT_FILE] [--only-facts-file] [--version] ```` @@ -362,7 +362,6 @@ docs.socket.dev use `SOCKET_SECURITY_API_KEY`. Either works. If both are set, | `--reach-min-severity` | False | info | Minimum severity of vulnerabilities to analyze (info, low, moderate, high, critical). Omitted by default, so coana analyzes all severities — equivalent to `info`, the lowest. | | `--reach-skip-cache` | False | False | Skip cache and force fresh reachability analysis | | `--reach-disable-analytics` | False | False | Disable analytics collection during reachability analysis | -| `--reach-enable-analysis-splitting` | False | False | Enable analysis splitting/bucketing (a legacy performance feature). Splitting is disabled by default. | | `--reach-detailed-analysis-log-file` | False | False | Write a detailed analysis log file; its path is printed to stdout | | `--reach-use-only-pregenerated-sboms` | False | False | Build the scan only from pre-generated CycloneDX (CDX) and SPDX files in your project (requires --reach) | | `--reach-debug` | False | False | Enable coana debug output (`--debug`) for the analysis, independent of the global `--enable-debug` | diff --git a/pyproject.toml b/pyproject.toml index 5c88c152..82c5bbf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "socketsecurity" -version = "2.13.2" +version = "2.13.3" requires-python = ">= 3.11" license = {"file" = "LICENSE"} dependencies = [ diff --git a/socketsecurity/__init__.py b/socketsecurity/__init__.py index 7ba49e1b..0871adeb 100644 --- a/socketsecurity/__init__.py +++ b/socketsecurity/__init__.py @@ -1,4 +1,4 @@ __author__ = 'socket.dev' -__version__ = '2.13.2' +__version__ = '2.13.3' USER_AGENT_NAME = 'socket-python-cli' USER_AGENT = f'{USER_AGENT_NAME}/{__version__}' diff --git a/socketsecurity/config.py b/socketsecurity/config.py index a11ad252..8320d086 100644 --- a/socketsecurity/config.py +++ b/socketsecurity/config.py @@ -229,7 +229,6 @@ class CliConfig: reach_analysis_timeout: Optional[str] = None reach_disable_analytics: 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 # Deprecated, kept for backwards compatibility reach_ecosystems: Optional[List[str]] = None @@ -399,7 +398,6 @@ 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, @@ -1203,7 +1201,7 @@ def create_argument_parser() -> argparse.ArgumentParser: "--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" + help=argparse.SUPPRESS # Deprecated, kept for backwards compatibility (no-op) ) reachability_group.add_argument( "--reach-detailed-analysis-log-file", diff --git a/socketsecurity/core/tools/reachability.py b/socketsecurity/core/tools/reachability.py index 01af52dd..e0561003 100644 --- a/socketsecurity/core/tools/reachability.py +++ b/socketsecurity/core/tools/reachability.py @@ -109,7 +109,6 @@ def run_reachability_analysis( min_severity: Optional[str] = None, skip_cache: bool = False, disable_analytics: bool = False, - enable_analysis_splitting: bool = False, detailed_analysis_log_file: bool = False, repo_name: Optional[str] = None, branch_name: Optional[str] = None, @@ -143,7 +142,6 @@ def run_reachability_analysis( min_severity: Minimum severity level (info, low, moderate, high, critical) skip_cache: Skip cache usage disable_analytics: Disable analytics sharing - enable_analysis_splitting: Enable analysis splitting (disabled by default) detailed_analysis_log_file: Print detailed analysis log file path repo_name: Repository name branch_name: Branch name @@ -181,9 +179,8 @@ def run_reachability_analysis( if disable_analytics: coana_args.append("--disable-analytics-sharing") - # Analysis splitting is disabled by default; only omit the flag if explicitly enabled - if not enable_analysis_splitting: - coana_args.append("--disable-analysis-splitting") + # Older Coana versions split analyses unless told not to. Newer ones ignore this flag. + coana_args.append("--disable-analysis-splitting") if detailed_analysis_log_file: coana_args.append("--print-analysis-log-file") diff --git a/socketsecurity/socketcli.py b/socketsecurity/socketcli.py index 1a05a302..3e04c81e 100644 --- a/socketsecurity/socketcli.py +++ b/socketsecurity/socketcli.py @@ -520,7 +520,6 @@ def main_code(config: Optional[CliConfig] = None): min_severity=config.reach_min_severity, skip_cache=config.reach_skip_cache or False, disable_analytics=config.reach_disable_analytics or False, - enable_analysis_splitting=config.reach_enable_analysis_splitting or False, detailed_analysis_log_file=config.reach_detailed_analysis_log_file or False, repo_name=None if repo_defaulted else config.repo, branch_name=None if branch_defaulted else config.branch, diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index d22b81ff..198d4b02 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -300,6 +300,15 @@ def test_reach_disable_external_tool_checks_flag(self): ) assert config.reach_disable_external_tool_checks is True + @pytest.mark.parametrize( + "flag", ["--reach-enable-analysis-splitting", "--reach-disable-analysis-splitting"] + ) + def test_analysis_splitting_flags_are_accepted_and_hidden(self, flag, capsys): + CliConfig.from_args(self.BASE_ARGS + ["--reach", flag]) + with pytest.raises(SystemExit): + CliConfig.from_args(["--help"]) + assert flag not in capsys.readouterr().out + def test_reach_new_flags_default_false(self): config = CliConfig.from_args(self.BASE_ARGS + ["--reach"]) assert config.reach_debug is False diff --git a/tests/unit/test_reachability.py b/tests/unit/test_reachability.py index f2c37095..441f9749 100644 --- a/tests/unit/test_reachability.py +++ b/tests/unit/test_reachability.py @@ -127,6 +127,10 @@ def test_disable_external_tool_checks(fake_run_path): assert "--disable-external-tool-checks" not in _run(fake_run_path)["args"] +def test_always_disables_analysis_splitting(fake_run_path): + assert "--disable-analysis-splitting" in _run(fake_run_path)["args"] + + def test_timeout_and_memory_forwarded_verbatim(fake_run_path): """coana parses the units; config-file ints are coerced to strings.""" args = _run(fake_run_path, timeout="10m", memory_limit=2048, concurrency=1)["args"] diff --git a/uv.lock b/uv.lock index 196ae3c8..b3681e40 100644 --- a/uv.lock +++ b/uv.lock @@ -1334,7 +1334,7 @@ wheels = [ [[package]] name = "socketsecurity" -version = "2.13.2" +version = "2.13.3" source = { editable = "." } dependencies = [ { name = "beautifulsoup4" }, From 67c15da817c5478ec57ba41808a272b21f6bbf92 Mon Sep 17 00:00:00 2001 From: Martin Torp Date: Mon, 23 Nov 2026 12:44:57 +0100 Subject: [PATCH 2/2] Drop the unused deprecated reach config fields reach_disable_analysis_splitting and reach_lazy_mode were copied into CliConfig but never read. They are gone now, the same as the new --reach-enable-analysis-splitting no-op. The argparse definitions stay, so all three flags still parse. The hidden-flag test now covers --reach-lazy-mode too. --- socketsecurity/config.py | 4 ---- tests/unit/test_config.py | 9 +++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/socketsecurity/config.py b/socketsecurity/config.py index 8320d086..b76d6de2 100644 --- a/socketsecurity/config.py +++ b/socketsecurity/config.py @@ -228,9 +228,7 @@ class CliConfig: reach_analysis_memory_limit: Optional[str] = None reach_analysis_timeout: Optional[str] = None reach_disable_analytics: bool = False - reach_disable_analysis_splitting: bool = False # Deprecated, kept for backwards compatibility reach_detailed_analysis_log_file: bool = False - reach_lazy_mode: bool = False # Deprecated, kept for backwards compatibility reach_ecosystems: Optional[List[str]] = None reach_exclude_paths: Optional[List[str]] = None reach_skip_cache: bool = False @@ -397,9 +395,7 @@ def _from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig': 'reach_analysis_timeout': args.reach_analysis_timeout, '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_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, 'exclude_paths': normalize_exclude_paths(args.exclude_paths), diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 198d4b02..27d8d85f 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -301,9 +301,14 @@ def test_reach_disable_external_tool_checks_flag(self): assert config.reach_disable_external_tool_checks is True @pytest.mark.parametrize( - "flag", ["--reach-enable-analysis-splitting", "--reach-disable-analysis-splitting"] + "flag", + [ + "--reach-enable-analysis-splitting", + "--reach-disable-analysis-splitting", + "--reach-lazy-mode", + ], ) - def test_analysis_splitting_flags_are_accepted_and_hidden(self, flag, capsys): + def test_deprecated_reach_flags_are_accepted_and_hidden(self, flag, capsys): CliConfig.from_args(self.BASE_ARGS + ["--reach", flag]) with pytest.raises(SystemExit): CliConfig.from_args(["--help"])