Skip to content

Commit 9336648

Browse files
Add --reach-disable-dependency-downloads
Forwards Coana's --disable-dependency-downloads (Coana 15.13.1+), which makes reachability analysis use only dependencies that are already installed and report missing ones as install failures.
1 parent 0de8df1 commit 9336648

8 files changed

Lines changed: 28 additions & 4 deletions

File tree

‎CHANGELOG.md‎

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

3+
## 2.11.6
4+
5+
### Added: `--reach-disable-dependency-downloads`
6+
7+
- Reachability analysis uses only dependencies that are already installed (e.g.
8+
in `.venv`, `vendor/` or the module cache), and reports missing ones as
9+
install failures.
10+
311
## 2.11.5
412

513
### Changed: bump pinned Coana CLI to 15.13.2

‎docs/cli-reference.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
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]
221221
[--reach-min-severity <level>] [--reach-skip-cache] [--reach-disable-analytics] [--reach-enable-analysis-splitting] [--reach-detailed-analysis-log-file]
222-
[--reach-use-only-pregenerated-sboms] [--reach-debug] [--reach-disable-external-tool-checks]
222+
[--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
````
225225

@@ -352,6 +352,7 @@ If you don't want to provide the Socket API Token every time then you can use th
352352
| `--reach-use-only-pregenerated-sboms` | False | False | Build the scan only from pre-generated CycloneDX (CDX) and SPDX files in your project (requires --reach) |
353353
| `--reach-debug` | False | False | Enable coana debug output (`--debug`) for the analysis, independent of the global `--enable-debug` |
354354
| `--reach-disable-external-tool-checks` | False | False | Disable coana's external tool availability checks (passes `--disable-external-tool-checks`) |
355+
| `--reach-disable-dependency-downloads` | False | False | Only analyze dependencies that are already installed (e.g. in `.venv`, `vendor/` or the module cache); missing ones count as install failures (passes `--disable-dependency-downloads`) |
355356
| `--reach-output-file` | False | .socket.facts.json | Path where reachability analysis results should be saved |
356357
| `--reach-exclude-paths` | False | | **[DEPRECATED — use `--exclude-paths`]** Comma-separated paths to exclude from reachability analysis. Still honored (unioned with `--exclude-paths`) but will be hidden in a future release |
357358
| `--only-facts-file` | False | False | Submit only the .socket.facts.json file when creating the full scan (requires --reach) |

‎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.11.5"
9+
version = "2.11.6"
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,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.11.5'
2+
__version__ = '2.11.6'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

‎socketsecurity/config.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class CliConfig:
222222
reach_continue_on_no_source_files: bool = False
223223
reach_debug: bool = False
224224
reach_disable_external_tool_checks: bool = False
225+
reach_disable_dependency_downloads: bool = False
225226
max_purl_batch_size: int = 5000
226227
enable_commit_status: bool = False
227228
legal: bool = False
@@ -369,6 +370,7 @@ def from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig':
369370
'reach_continue_on_no_source_files': args.reach_continue_on_no_source_files,
370371
'reach_debug': args.reach_debug,
371372
'reach_disable_external_tool_checks': args.reach_disable_external_tool_checks,
373+
'reach_disable_dependency_downloads': args.reach_disable_dependency_downloads,
372374
'max_purl_batch_size': args.max_purl_batch_size,
373375
'enable_commit_status': args.enable_commit_status,
374376
'legal': args.legal or args.legal_format == "fossa",
@@ -1223,6 +1225,14 @@ def create_argument_parser() -> argparse.ArgumentParser:
12231225
help="Disable coana's external tool availability checks during reachability analysis "
12241226
"(passes --disable-external-tool-checks to the coana CLI)."
12251227
)
1228+
reachability_group.add_argument(
1229+
"--reach-disable-dependency-downloads",
1230+
dest="reach_disable_dependency_downloads",
1231+
action="store_true",
1232+
help="Only analyze dependencies that are already installed (e.g. in the project's .venv, "
1233+
"vendor directory or module cache); missing ones count as install failures "
1234+
"(passes --disable-dependency-downloads to the coana CLI)."
1235+
)
12261236

12271237
parser.add_argument(
12281238
'--version',

‎socketsecurity/core/tools/reachability.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def run_reachability_analysis(
124124
continue_on_no_source_files: bool = False,
125125
reach_debug: bool = False,
126126
disable_external_tool_checks: bool = False,
127+
disable_dependency_downloads: bool = False,
127128
) -> Dict[str, Any]:
128129
"""
129130
Run reachability analysis.
@@ -213,6 +214,9 @@ def run_reachability_analysis(
213214
if disable_external_tool_checks:
214215
coana_args.append("--disable-external-tool-checks")
215216

217+
if disable_dependency_downloads:
218+
coana_args.append("--disable-dependency-downloads")
219+
216220
if use_only_pregenerated_sboms:
217221
coana_args.append("--use-only-pregenerated-sboms")
218222

‎socketsecurity/socketcli.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ def main_code():
552552
continue_on_no_source_files=config.reach_continue_on_no_source_files,
553553
reach_debug=config.reach_debug,
554554
disable_external_tool_checks=config.reach_disable_external_tool_checks,
555+
disable_dependency_downloads=config.reach_disable_dependency_downloads,
555556
)
556557

557558
log.info("Reachability analysis completed successfully")

‎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)