Repository navigation
fix(scan): serialize status and reason in JSON and YAML scan output - #2385
Merged
Merged
Conversation
## Summary devops scan trivy|sast|secrets with --format json or yaml printed only the findings list. A scan that gave no result (not installed, failed, not_applicable) printed []. The empty list read as a clean scan. What changes: - devops scan trivy, devops scan secrets, devops scan sast, and devops scan iac serialize a mapping with status, reason, and findings for JSON and YAML formats. - A scan that gave no result prints the status and the reason next to an empty findings list, never only []. - tests/test_scan.py tests JSON and YAML output formats for unrun, failed, clean, and positive scanner runs. - tests/test_security_semgrep.py asserts against the serialized dictionary output. Evidence: - uv run devops ci fail-to-pass --base origin/main reports 19 failures on base and 0 on this branch. - uv run pytest tests/test_scan.py tests/test_security_semgrep.py tests/test_security_gitleaks.py passes (86 tests). ## Item Closes #2107 Change: openspec/changes/archive/2026-10-27-2107-scan-output-status/
dan-petty
marked this pull request as ready for review
October 27, 2026 21:10
dan-petty
pushed a commit
that referenced
this pull request
Oct 27, 2026
🤖 I have created a release *beep* *boop* --- ## [0.8.0](v0.7.4...v0.8.0) (2026-10-27) ### Features * **github:** devops gh issues view shows one issue ([#2374](#2374)) ([63be7ed](63be7ed)), closes [#2361](#2361) * **repos:** make devops repos worktrees add remove merged worktrees first ([#2351](#2351)) ([6d3a18a](6d3a18a)), closes [#2338](#2338) ### Bug Fixes * **k8s:** devops k8s configure-urls saves a run that changes only the task gateway urls ([#2384](#2384)) ([1a7e7c7](1a7e7c7)) * **k8s:** exit non-zero when kube-linter is unavailable or reports findings ([#2386](#2386)) ([31c5a0b](31c5a0b)), closes [#2095](#2095) * **scan:** serialize status and reason in JSON and YAML scan output ([#2385](#2385)) ([d594b55](d594b55)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
devops scan trivy|sast|secrets with --format json or yaml printed only the findings list. A scan that gave no result (not installed, failed, not_applicable) printed []. The empty list read as a clean scan.
What changes:
Evidence:
Item
Closes #2107
Change:
openspec/changes/archive/2026-10-27-2107-scan-output-status/