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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 2.15.0

### Upgrade notes

- `--reach-enable-analysis-splitting` is deprecated and no longer has an
effect. With it, a reachability analysis that failed or timed out was
retried in smaller batches. Jobs that pass it now run one analysis, as jobs
without it already did, so their results can differ. The flag still parses,
so existing CI commands keep working. Remove it when convenient.

### Changed

- Reachability always passes `--disable-analysis-splitting` to the Coana CLI,
including for a Coana version picked with `--reach-version`.

## 2.14.0

### Upgrade notes
Expand Down
3 changes: 1 addition & 2 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <level>] [--reach-skip-cache] [--reach-disable-analytics] [--reach-enable-analysis-splitting] [--reach-detailed-analysis-log-file]
[--reach-min-severity <level>] [--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]
````
Expand Down Expand Up @@ -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` |
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.14.0"
version = "2.15.0"
requires-python = ">= 3.11"
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,4 +1,4 @@
__author__ = 'socket.dev'
__version__ = '2.14.0'
__version__ = '2.15.0'
USER_AGENT_NAME = 'socket-python-cli'
USER_AGENT = f'{USER_AGENT_NAME}/{__version__}'
8 changes: 1 addition & 7 deletions socketsecurity/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +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_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
reach_exclude_paths: Optional[List[str]] = None
reach_skip_cache: bool = False
Expand Down Expand Up @@ -398,10 +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_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,
'exclude_paths': normalize_exclude_paths(args.exclude_paths),
Expand Down Expand Up @@ -1206,7 +1200,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",
Expand Down
7 changes: 2 additions & 5 deletions socketsecurity/core/tools/reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion socketsecurity/socketcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,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,
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,20 @@ 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",
"--reach-lazy-mode",
],
)
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"])
assert flag not in capsys.readouterr().out

Comment thread
mtorp marked this conversation as resolved.
Resolved
def test_reach_new_flags_default_false(self):
config = CliConfig.from_args(self.BASE_ARGS + ["--reach"])
assert config.reach_debug is False
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_reachability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.