You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(scan): unit suffixes for reachability timeout/memory limits (1.1.123, Coana 15.5.0) (#1369)
* feat(scan): unit suffixes for reachability timeout/memory limits (1.1.123, Coana 15.5.0)
--reach-analysis-timeout and --reach-analysis-memory-limit now accept unit
suffixes (s/m/h for duration, MB/GB for memory, case-insensitive). Coana owns
the canonical parsing, so the CLI forwards the raw string verbatim instead of
coercing to a number. A thin local validator gives fast errors before the Coana
binary is spawned.
Empty or zero-magnitude values are omitted when forwarding so Coana applies its
own defaults, preserving the prior numeric-0 sentinel. Bare numbers keep working
but are no longer documented. Bumps the bundled Coana CLI to 15.5.0, whose parser
handles these units.
* fix(scan): treat default-equivalent reach unit values as default in --reach guard
The "reachability flags require --reach" guard compared the raw flag strings to
the default string, so unit-equivalent inputs were wrongly flagged as non-default
and rejected without --reach: 8GB / 8192MB (= the 8192MB default) and the
zero/omit timeout sentinel 0 / 0s. The latter was a regression from the
number→string change (numeric 0 used to equal the numeric default).
Compare by resolved magnitude instead: reachMemoryLimitToMb normalizes
8192/8192MB/8GB to 8192, and the timeout uses the omit sentinel so any zero
counts as default.
* refactor(scan): drop local reach unit validation, defer to Coana
Coana (@coana-tech/cli) is now the sole validator/parser of the
--reach-analysis-timeout and --reach-analysis-memory-limit values, matching the
Python CLI. Removes the local grammar mirror (isValid* regex fast-fail) that had
already drifted from Coana twice (unit case-sensitivity, and a whitespace gap
where Coana trims but the mirror did not). An invalid unit now surfaces as
Coana's error instead of a fast local one.
Kept the non-validation helpers, which Coana does not model: isOmittedReachValue
(empty/zero -> omit the flag so Coana applies its default) and reachMemoryLimitToMb
(unit-agnostic default-equivalence for the "requires --reach" guard). The raw
string is still forwarded to Coana verbatim.
-`socket scan create --reach` and `socket scan reach` now accept unit suffixes on `--reach-analysis-timeout` (`s`, `m`, `h` — e.g. `90s`, `10m`, `1h`) and `--reach-analysis-memory-limit` (`MB`, `GB` — e.g. `512MB`, `8GB`). Plain numbers keep working as before.
--workspace The workspace in the Socket Organization that the repository is in to associate with the full scan.
57
57
58
58
Reachability Options (when --reach is used)
59
-
--reach-analysis-memory-limit The maximum memory in MB to use for the reachability analysis. The default is 8192MB.
60
-
--reach-analysis-timeout Set timeout for the reachability analysis. Split analysis runs may cause the total scan time to exceed this timeout significantly.
59
+
--reach-analysis-memory-limit The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB.
60
+
--reach-analysis-timeout Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly.
61
61
--reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available.
62
62
--reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed (Tier 2) results. By default, the CLI halts on analysis errors.
63
63
--reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed (Tier 2) results. By default, the CLI halts on installation errors.
--exclude-paths List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) Tier 1 reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (\`--cwd\` if set), not the reachability target: \`tests\` matches only \`<cwd>/tests\`; use \`**/tests\` to match at any depth. Negation patterns (\`!path\`) are not supported. Accepts a comma-separated value or multiple flags.
41
-
--reach-analysis-memory-limit The maximum memory in MB to use for the reachability analysis. The default is 8192MB.
42
-
--reach-analysis-timeout Set timeout for the reachability analysis. Split analysis runs may cause the total scan time to exceed this timeout significantly.
41
+
--reach-analysis-memory-limit The maximum memory for the reachability analysis as a whole number optionally followed by MB or GB (e.g. 512MB, 8GB). The default is 8GB.
42
+
--reach-analysis-timeout Set the timeout for the reachability analysis as a whole number optionally followed by s, m or h (e.g. 90s, 10m, 1h). Defaults to 10m. Split analysis runs may cause the total scan time to exceed this timeout significantly.
43
43
--reach-concurrency Set the maximum number of concurrent reachability analysis runs. It is recommended to choose a concurrency level that ensures each analysis run has at least the --reach-analysis-memory-limit amount of memory available.
44
44
--reach-continue-on-analysis-errors Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed (Tier 2) results. By default, the CLI halts on analysis errors.
45
45
--reach-continue-on-install-errors Continue reachability analysis when package installation fails, falling back to precomputed (Tier 2) results. By default, the CLI halts on installation errors.
0 commit comments