Skip to content

Commit 486a784

Browse files
committed
fix(engine): treat severity_threshold 'none' as no threshold
When severity_threshold is set to "none" (the default in composite actions), it was being parsed as Severity.UNKNOWN (order 0), causing every finding to exceed the threshold and returning exit code 1. Fix _parse_severity() to return None for "none" and handle the same case in the CLI --severity-threshold override. This fixes the CI failures in scanner-bandit and scanner-opengrep thin wrappers.
1 parent 23912c3 commit 486a784

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

argus/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,12 @@ def _cmd_source_scan(args: argparse.Namespace) -> int:
540540

541541
# Override config with CLI arguments
542542
if args.severity_threshold:
543-
config.reporting.severity_threshold = Severity.from_string(
544-
args.severity_threshold
545-
)
543+
if args.severity_threshold == "none":
544+
config.reporting.severity_threshold = None
545+
else:
546+
config.reporting.severity_threshold = Severity.from_string(
547+
args.severity_threshold
548+
)
546549
if args.output_dir:
547550
config.reporting.output_dir = args.output_dir
548551
if args.formats:

argus/core/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,16 @@ def get_scanner_config(self, scanner_name: str) -> ScannerConfig:
124124

125125

126126
def _parse_severity(value: str | None) -> Optional[Severity]:
127-
"""Parse a severity string or return None."""
127+
"""Parse a severity string or return None.
128+
129+
"none" is treated as no threshold (returns None), not as
130+
Severity.UNKNOWN — this matches the CLI semantics where
131+
--severity-threshold none means "never fail on findings".
132+
"""
128133
if value is None:
129134
return None
135+
if str(value).strip().lower() == "none":
136+
return None
130137
return Severity.from_string(str(value))
131138

132139

0 commit comments

Comments
 (0)