Skip to content

Commit a5480cc

Browse files
authored
Retire --reach-enable-analysis-splitting (#466)
* 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. * 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.
1 parent 4eed245 commit a5480cc

10 files changed

Lines changed: 40 additions & 18 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 2.15.0
4+
5+
### Upgrade notes
6+
7+
- `--reach-enable-analysis-splitting` is deprecated and no longer has an
8+
effect. With it, a reachability analysis that failed or timed out was
9+
retried in smaller batches. Jobs that pass it now run one analysis, as jobs
10+
without it already did, so their results can differ. The flag still parses,
11+
so existing CI commands keep working. Remove it when convenient.
12+
13+
### Changed
14+
15+
- Reachability always passes `--disable-analysis-splitting` to the Coana CLI,
16+
including for a Coana version picked with `--reach-version`.
17+
318
## 2.14.0
419

520
### Upgrade notes

‎docs/cli-reference.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
218218
[--ignore-commit-files] [--disable-blocking] [--disable-ignore] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
219219
[--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
220220
[--reach-analysis-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-concurrency REACH_CONCURRENCY] [--reach-ecosystems REACH_ECOSYSTEMS]
221-
[--reach-min-severity <level>] [--reach-skip-cache] [--reach-disable-analytics] [--reach-enable-analysis-splitting] [--reach-detailed-analysis-log-file]
221+
[--reach-min-severity <level>] [--reach-skip-cache] [--reach-disable-analytics] [--reach-detailed-analysis-log-file]
222222
[--reach-use-only-pregenerated-sboms] [--reach-debug] [--reach-disable-external-tool-checks] [--reach-disable-dependency-downloads]
223223
[--reach-output-file REACH_OUTPUT_FILE] [--only-facts-file] [--version]
224224
````
@@ -362,7 +362,6 @@ docs.socket.dev use `SOCKET_SECURITY_API_KEY`. Either works. If both are set,
362362
| `--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. |
363363
| `--reach-skip-cache` | False | False | Skip cache and force fresh reachability analysis |
364364
| `--reach-disable-analytics` | False | False | Disable analytics collection during reachability analysis |
365-
| `--reach-enable-analysis-splitting` | False | False | Enable analysis splitting/bucketing (a legacy performance feature). Splitting is disabled by default. |
366365
| `--reach-detailed-analysis-log-file` | False | False | Write a detailed analysis log file; its path is printed to stdout |
367366
| `--reach-use-only-pregenerated-sboms` | False | False | Build the scan only from pre-generated CycloneDX (CDX) and SPDX files in your project (requires --reach) |
368367
| `--reach-debug` | False | False | Enable coana debug output (`--debug`) for the analysis, independent of the global `--enable-debug` |

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.14.0"
9+
version = "2.15.0"
1010
requires-python = ">= 3.11"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

‎socketsecurity/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.14.0'
2+
__version__ = '2.15.0'
33
USER_AGENT_NAME = 'socket-python-cli'
44
USER_AGENT = f'{USER_AGENT_NAME}/{__version__}'

‎socketsecurity/config.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ class CliConfig:
228228
reach_analysis_memory_limit: Optional[str] = None
229229
reach_analysis_timeout: Optional[str] = None
230230
reach_disable_analytics: bool = False
231-
reach_disable_analysis_splitting: bool = False # Deprecated, kept for backwards compatibility
232-
reach_enable_analysis_splitting: bool = False
233231
reach_detailed_analysis_log_file: bool = False
234-
reach_lazy_mode: bool = False # Deprecated, kept for backwards compatibility
235232
reach_ecosystems: Optional[List[str]] = None
236233
reach_exclude_paths: Optional[List[str]] = None
237234
reach_skip_cache: bool = False
@@ -398,10 +395,7 @@ def _from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig':
398395
'reach_analysis_timeout': args.reach_analysis_timeout,
399396
'reach_analysis_memory_limit': args.reach_analysis_memory_limit,
400397
'reach_disable_analytics': args.reach_disable_analytics,
401-
'reach_disable_analysis_splitting': args.reach_disable_analysis_splitting,
402-
'reach_enable_analysis_splitting': args.reach_enable_analysis_splitting,
403398
'reach_detailed_analysis_log_file': args.reach_detailed_analysis_log_file,
404-
'reach_lazy_mode': args.reach_lazy_mode,
405399
'reach_ecosystems': args.reach_ecosystems.split(',') if args.reach_ecosystems else None,
406400
'reach_exclude_paths': args.reach_exclude_paths.split(',') if args.reach_exclude_paths else None,
407401
'exclude_paths': normalize_exclude_paths(args.exclude_paths),
@@ -1206,7 +1200,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
12061200
"--reach-enable-analysis-splitting",
12071201
dest="reach_enable_analysis_splitting",
12081202
action="store_true",
1209-
help="Enable analysis splitting/bucketing for reachability analysis (disabled by default). This is a legacy feature for improving performance"
1203+
help=argparse.SUPPRESS # Deprecated, kept for backwards compatibility (no-op)
12101204
)
12111205
reachability_group.add_argument(
12121206
"--reach-detailed-analysis-log-file",

‎socketsecurity/core/tools/reachability.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def run_reachability_analysis(
109109
min_severity: Optional[str] = None,
110110
skip_cache: bool = False,
111111
disable_analytics: bool = False,
112-
enable_analysis_splitting: bool = False,
113112
detailed_analysis_log_file: bool = False,
114113
repo_name: Optional[str] = None,
115114
branch_name: Optional[str] = None,
@@ -143,7 +142,6 @@ def run_reachability_analysis(
143142
min_severity: Minimum severity level (info, low, moderate, high, critical)
144143
skip_cache: Skip cache usage
145144
disable_analytics: Disable analytics sharing
146-
enable_analysis_splitting: Enable analysis splitting (disabled by default)
147145
detailed_analysis_log_file: Print detailed analysis log file path
148146
repo_name: Repository name
149147
branch_name: Branch name
@@ -181,9 +179,8 @@ def run_reachability_analysis(
181179
if disable_analytics:
182180
coana_args.append("--disable-analytics-sharing")
183181

184-
# Analysis splitting is disabled by default; only omit the flag if explicitly enabled
185-
if not enable_analysis_splitting:
186-
coana_args.append("--disable-analysis-splitting")
182+
# Older Coana versions split analyses unless told not to. Newer ones ignore this flag.
183+
coana_args.append("--disable-analysis-splitting")
187184

188185
if detailed_analysis_log_file:
189186
coana_args.append("--print-analysis-log-file")

‎socketsecurity/socketcli.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ def main_code(config: Optional[CliConfig] = None):
514514
min_severity=config.reach_min_severity,
515515
skip_cache=config.reach_skip_cache or False,
516516
disable_analytics=config.reach_disable_analytics or False,
517-
enable_analysis_splitting=config.reach_enable_analysis_splitting or False,
518517
detailed_analysis_log_file=config.reach_detailed_analysis_log_file or False,
519518
repo_name=None if repo_defaulted else config.repo,
520519
branch_name=None if branch_defaulted else config.branch,

‎tests/unit/test_config.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,20 @@ def test_reach_disable_external_tool_checks_flag(self):
300300
)
301301
assert config.reach_disable_external_tool_checks is True
302302

303+
@pytest.mark.parametrize(
304+
"flag",
305+
[
306+
"--reach-enable-analysis-splitting",
307+
"--reach-disable-analysis-splitting",
308+
"--reach-lazy-mode",
309+
],
310+
)
311+
def test_deprecated_reach_flags_are_accepted_and_hidden(self, flag, capsys):
312+
CliConfig.from_args(self.BASE_ARGS + ["--reach", flag])
313+
with pytest.raises(SystemExit):
314+
CliConfig.from_args(["--help"])
315+
assert flag not in capsys.readouterr().out
316+
303317
def test_reach_new_flags_default_false(self):
304318
config = CliConfig.from_args(self.BASE_ARGS + ["--reach"])
305319
assert config.reach_debug is False

‎tests/unit/test_reachability.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ def test_disable_external_tool_checks(fake_run_path):
127127
assert "--disable-external-tool-checks" not in _run(fake_run_path)["args"]
128128

129129

130+
def test_always_disables_analysis_splitting(fake_run_path):
131+
assert "--disable-analysis-splitting" in _run(fake_run_path)["args"]
132+
133+
130134
def test_timeout_and_memory_forwarded_verbatim(fake_run_path):
131135
"""coana parses the units; config-file ints are coerced to strings."""
132136
args = _run(fake_run_path, timeout="10m", memory_limit=2048, concurrency=1)["args"]

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)