Skip to content

Fix report links in Console and JSON - #396

Open
John-David Dalton (jdalton) wants to merge 1 commit into
mainfrom
codex/surf199-python-report-refs
Open

John-David Dalton (jdalton) wants to merge 1 commit into
mainfrom
codex/surf199-python-report-refs

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

LLM Description written by Codex:gpt-6-luna

Console comparison summaries could show a full-scan report URL as a diff link, while clean scan summaries omitted available report references.

Root Cause

Console output chose report_url before diff_url for comparisons and returned early for clean scans before rendering a link. JSON output already exposed these URLs separately, but the Console path did not preserve their distinction.

Fix

Add a typed report-reference value and pure Console/JSON builders. Comparison Console output now prefers the supplied diff URL and uses the report URL as a correctly labeled fallback. Clean summaries retain No issues found as their first line and include an available link. The Socket JSON payload keeps its existing keys, values, metadata, and alert serialization.

Public Changelog

N/A

Validation

  • Bump the package version to 2.10.12; 2.10.11 is already published on PyPI.

  • python -m pytest tests/unit/test_report_output.py --no-cov — 11 passed.

  • ruff check socketsecurity/core/report_output.py socketsecurity/output.py tests/unit/test_report_output.py — passed.

  • ruff format --check socketsecurity/core/report_output.py tests/unit/test_report_output.py — passed. The existing output.py has formatting differences outside this change; it was left intact.


Note

Medium Risk
Changes user-visible CLI summaries and JSON report fields; behavior is covered by new unit tests but affects every scan’s stdout/file output paths.

Overview
Fixes console report links for comparison and clean scans by moving summary/JSON construction into socketsecurity/core/report_output.py with a ReportReferences helper that picks the right URL and label (diff vs full-scan report, with fallbacks).

Comparison output now prefers diff_url under a Diff Url label instead of surfacing a full-scan report_url as the diff link. Clean scans still lead with No issues found but now append an available link when one exists. Full-scan behavior keeps report-first linking and the existing “findings not fetched” message.

OutputHandler delegates build_summary_text and build_json_report to the new builders. Socket JSON gains explicit full_scan_id and diff_url alongside unchanged alert/metadata fields. Unit tests in tests/unit/test_report_output.py lock in link precedence, strict-blocking summaries, and JSON shape.

Reviewed by Cursor Bugbot for commit f57b781. Configure here.

Assisted-by: Codex:gpt-6-luna

This branch was successfully deployed

1 active deployment
socket-firewall — 6b113c03 Deployed Oct 13, 2026 by jdalton via python-sfw-smoke-enterprise #477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant