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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Changed
- `--reach-enable-analysis-splitting` is deprecated and does nothing, as reachability scans no longer split the analysis into several runs. Scripts that pass it keep working.

## [1.16.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.16.0) - 2026-11-19

### Added
Expand Down
1 change: 0 additions & 1 deletion src/commands/ci/handle-ci.mts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export async function handleCi(autoManifest: boolean): Promise<void> {
reachDisableDependencyDownloads: false,
reachDisableExternalToolChecks: false,
reachEcosystems: [],
reachEnableAnalysisSplitting: false,
reachExcludePaths: [],
reachFallbackToRegularScan: false,
reachRetainFactsFile: false,
Expand Down
8 changes: 1 addition & 7 deletions src/commands/scan/cmd-scan-create.mts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const CMD_NAME = 'create'
// must not imply --reach.
const DEPRECATED_NO_OP_REACH_FLAGS = new Set([
'reachDisableAnalysisSplitting',
'reachEnableAnalysisSplitting',
'reachLazyMode',
])

Expand Down Expand Up @@ -297,13 +298,10 @@ async function run(
reachContinueOnNoSourceFiles,
reachDebug,
reachDetailedAnalysisLogFile,
reachDisableAnalysisSplitting: _reachDisableAnalysisSplitting,
reachDisableAnalytics,
reachDisableDependencyDownloads,
reachDisableExternalToolChecks,
reachEnableAnalysisSplitting,
reachFallbackToRegularScan,
reachLazyMode: _reachLazyMode,
reachRetainFactsFile,
reachSkipCache,
reachUseOnlyPregeneratedSboms,
Expand Down Expand Up @@ -338,13 +336,10 @@ async function run(
reachContinueOnNoSourceFiles: boolean
reachDebug: boolean
reachDetailedAnalysisLogFile: boolean
reachDisableAnalysisSplitting: boolean
reachDisableAnalytics: boolean
reachDisableDependencyDownloads: boolean
reachDisableExternalToolChecks: boolean
reachEnableAnalysisSplitting: boolean
reachFallbackToRegularScan: boolean
reachLazyMode: boolean
reachRetainFactsFile: boolean
reachSkipCache: boolean
reachUseOnlyPregeneratedSboms: boolean
Expand Down Expand Up @@ -712,7 +707,6 @@ async function run(
reachDisableDependencyDownloads: Boolean(reachDisableDependencyDownloads),
reachDisableExternalToolChecks: Boolean(reachDisableExternalToolChecks),
reachEcosystems,
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),
reachExcludePaths,
reachFallbackToRegularScan: Boolean(reachFallbackToRegularScan),
reachRetainFactsFile: Boolean(reachRetainFactsFile),
Expand Down
7 changes: 4 additions & 3 deletions src/commands/scan/cmd-scan-create.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ describe('socket scan create', async () => {
--reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor directory or module cache). Missing dependencies count as installation failures.
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supported: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems.
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.
--reach-fallback-to-regular-scan If reachability analysis fails, continue with a regular SCA scan (without reachability results) instead of halting. By default, the CLI halts on reachability errors.
--reach-retain-facts-file Keep the \`.socket.facts.json\` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as an SBOM carrying stale reachability results.
--reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.
Expand Down Expand Up @@ -363,16 +362,18 @@ describe('socket scan create', async () => {
'--branch',
'abc',
'--reach-disable-analysis-splitting',
'--reach-enable-analysis-splitting',
'--reach-lazy-mode',
FLAG_CONFIG,
'{"apiToken":"fakeToken"}',
],
'should succeed when deprecated no-op --reach-disable-analysis-splitting is used without --reach',
'should succeed when deprecated no-op reach flags are used without --reach',
async cmd => {
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
expect(
code,
'should exit with code 0 for the deprecated no-op flag',
'should exit with code 0 for the deprecated no-op flags',
).toBe(0)
},
)
Expand Down
7 changes: 0 additions & 7 deletions src/commands/scan/cmd-scan-reach.mts
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,9 @@ async function run(
reachContinueOnNoSourceFiles,
reachDebug,
reachDetailedAnalysisLogFile,
reachDisableAnalysisSplitting: _reachDisableAnalysisSplitting,
reachDisableAnalytics,
reachDisableDependencyDownloads,
reachDisableExternalToolChecks,
reachEnableAnalysisSplitting,
reachLazyMode: _reachLazyMode,
reachRetainFactsFile,
reachSkipCache,
reachUseOnlyPregeneratedSboms,
Expand All @@ -188,12 +185,9 @@ async function run(
reachContinueOnNoSourceFiles: boolean
reachDebug: boolean
reachDetailedAnalysisLogFile: boolean
reachDisableAnalysisSplitting: boolean
reachDisableAnalytics: boolean
reachDisableDependencyDownloads: boolean
reachDisableExternalToolChecks: boolean
reachEnableAnalysisSplitting: boolean
reachLazyMode: boolean
reachRetainFactsFile: boolean
reachSkipCache: boolean
reachUseOnlyPregeneratedSboms: boolean
Expand Down Expand Up @@ -321,7 +315,6 @@ async function run(
reachDisableDependencyDownloads: Boolean(reachDisableDependencyDownloads),
reachDisableExternalToolChecks: Boolean(reachDisableExternalToolChecks),
reachEcosystems,
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),
reachExcludePaths,
reachRetainFactsFile: Boolean(reachRetainFactsFile),
reachSkipCache: Boolean(reachSkipCache),
Expand Down
22 changes: 1 addition & 21 deletions src/commands/scan/cmd-scan-reach.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe('socket scan reach', async () => {
--reach-disable-dependency-downloads Only analyze dependencies that are already installed (e.g. in the project's .venv, vendor directory or module cache). Missing dependencies count as installation failures.
--reach-disable-external-tool-checks Disable external tool checks during reachability analysis.
--reach-ecosystems List of ecosystems to conduct reachability analysis on, as either a comma separated value or as multiple flags. Supported: cargo, composer, gem, golang, maven, npm, nuget, pypi. Defaults to all supported ecosystems.
--reach-enable-analysis-splitting Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.
--reach-retain-facts-file Keep the \`.socket.facts.json\` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. Delete it once inspected: later reachability scans ignore it, but a scan without --reach uploads it as an SBOM carrying stale reachability results.
--reach-skip-cache Skip caching-based optimizations. By default, the reachability analysis will use cached configurations from previous runs to speed up the analysis.
--reach-use-only-pregenerated-sboms When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project.
Expand Down Expand Up @@ -202,31 +201,13 @@ describe('socket scan reach', async () => {
'reach',
FLAG_DRY_RUN,
'--reach-disable-analysis-splitting',
'--org',
'fakeOrg',
FLAG_CONFIG,
'{"apiToken":"fakeToken"}',
],
'should accept deprecated --reach-disable-analysis-splitting flag (noop)',
async cmd => {
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
expect(code, 'should exit with code 0').toBe(0)
},
)

cmdit(
[
'scan',
'reach',
FLAG_DRY_RUN,
'--reach-enable-analysis-splitting',
'--org',
'fakeOrg',
FLAG_CONFIG,
'{"apiToken":"fakeToken"}',
],
'should accept --reach-enable-analysis-splitting flag',
'should accept the deprecated analysis splitting flags (noop)',
async cmd => {
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
expect(stdout).toMatchInlineSnapshot(`"[DryRun]: Bailing now"`)
Expand Down Expand Up @@ -438,7 +419,6 @@ describe('socket scan reach', async () => {
'3600',
'--reach-concurrency',
'2',
'--reach-enable-analysis-splitting',
'--reach-ecosystems',
'npm,pypi',
'--reach-exclude-paths',
Expand Down
1 change: 0 additions & 1 deletion src/commands/scan/create-scan-from-github.mts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ async function scanOneRepo(
reachDisableDependencyDownloads: false,
reachDisableExternalToolChecks: false,
reachEcosystems: [],
reachEnableAnalysisSplitting: false,
reachExcludePaths: [],
reachFallbackToRegularScan: false,
reachRetainFactsFile: false,
Expand Down
6 changes: 2 additions & 4 deletions src/commands/scan/perform-reachability-analysis.mts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export type ReachabilityOptions = {
reachDisableExternalToolChecks: boolean
reachDisableAnalytics: boolean
reachEcosystems: PURL_Type[]
reachEnableAnalysisSplitting: boolean
reachExcludePaths: string[]
reachRetainFactsFile: boolean
reachSkipCache: boolean
Expand Down Expand Up @@ -250,9 +249,8 @@ export async function performReachabilityAnalysis(
...(reachabilityOptions.reachDisableExternalToolChecks
? ['--disable-external-tool-checks']
: []),
...(reachabilityOptions.reachEnableAnalysisSplitting
? []
: ['--disable-analysis-splitting']),
// Older Coana versions split analyses unless this is passed.
'--disable-analysis-splitting',
'--run-without-docker',
'--manifests-tar-hash',
tarHash,
Expand Down
3 changes: 2 additions & 1 deletion src/commands/scan/perform-reachability-analysis.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe('performReachabilityAnalysis manifests tar hash', () => {
rmSync(scanCwd, { force: true, recursive: true })
})

it('always passes the uploaded tar hash and --run-without-docker to Coana', async () => {
it('always passes the uploaded tar hash, --run-without-docker and --disable-analysis-splitting to Coana', async () => {
await performReachabilityAnalysis({
cwd: scanCwd,
orgSlug: TEST_ORG_SLUG,
Expand All @@ -196,6 +196,7 @@ describe('performReachabilityAnalysis manifests tar hash', () => {

const args = mockSpawnCoana.mock.calls[0]![0] as string[]
expect(args).toContain('--run-without-docker')
expect(args).toContain('--disable-analysis-splitting')
expect(args[args.indexOf('--manifests-tar-hash') + 1]).toBe(TEST_TAR_HASH)
})

Expand Down
3 changes: 2 additions & 1 deletion src/commands/scan/reachability-flags.mts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ export const reachabilityFlags: MeowFlags = {
reachEnableAnalysisSplitting: {
type: 'boolean',
default: false,
hidden: true,
description:
'Allow the reachability analysis to partition CVEs into buckets that are processed in separate analysis runs. May improve accuracy, but not recommended by default.',
'Deprecated: Analysis splitting is no longer supported. This flag is a no-op.',
},
reachEcosystems: {
type: 'string',
Expand Down
1 change: 0 additions & 1 deletion test/reachability-options.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function makeReachabilityOptions(): ReachabilityOptions {
reachDisableDependencyDownloads: false,
reachDisableExternalToolChecks: false,
reachEcosystems: [],
reachEnableAnalysisSplitting: false,
reachExcludePaths: [],
reachRetainFactsFile: false,
reachSkipCache: false,
Expand Down
Loading
Loading