fix(report): preserve full finding metadata in SARIF output (#229)#230
fix(report): preserve full finding metadata in SARIF output (#229)#230rodboev wants to merge 4 commits into
Conversation
rng1995
left a comment
There was a problem hiding this comment.
Requesting changes because exact finding severity is still lost. SARIF level maps both CRITICAL and HIGH to error, so the new property bag does not yet preserve full finding metadata. Include the original severity for active and suppressed results and add a distinction test.
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
80e6c6b to
66113ee
Compare
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Re-review: approved. The prior severity-fidelity blocker is resolved: active and suppressed SARIF results preserve original severity in properties, including HIGH versus CRITICAL, while retaining SARIF level=error. Focused report/SARIF coverage passes.
|
Fix the CI issue @rodboev |
Signed-off-by: Rod Boev <rod.boev@gmail.com>
58845fe to
0e22116
Compare
|
Fixed. I rewrote the CI refresh commit with the missing DCO sign-off and force-pushed 0e22116. The branch diff is unchanged, this only updates the commit metadata. |
Summary
--format sarifcurrently drops finding metadata that--format jsonalready preserves. This update keeps the original finding severity in the SARIF resultpropertiesbag too, so downstream tooling can still distinguishCRITICALfromHIGHafter SARIF level flattening.Closes #229
Root cause
_build_sarif()builds each result from only the core SARIF fields and a partial properties bag. Even after the earlier metadata work, SARIFlevelstill flattened bothCRITICALandHIGHtoerror, and the originalseverityvalue was never preserved alongside the other finding fields.Diff Notes
SarifResultso the report layer preserves the originalseverityalongside the existing SkillSpector-specific finding metadata in the SARIF-compatiblepropertiesbag.endLine, rule generation, sorting, empty-finding filtering, and suppression markers unchanged.level=errorfor both results.Scope
This change is limited to report and SARIF schema code. It does not change analyzers, JSON output, CLI behavior, transitive scanning, baseline matching, or provider and MCP behavior.
Verification
.\.venv\Scripts\python.exe -m pytest tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.py(63 passed, 1 warning)uv run ruff check src/skillspector/nodes/report.py tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.pyuv run ruff format --check src/skillspector/nodes/report.py tests/nodes/test_report.py tests/nodes/test_sarif_rules_and_empty_findings.py