Skip to content

feat(python-cli-parity): support Python-compatible diff JSON output - #1813

Open
John-David Dalton (jdalton) wants to merge 1 commit into
feat/ci-skip-unchanged-manifestsfrom
feat/ci-python-diff-json
Open

John-David Dalton (jdalton) wants to merge 1 commit into
feat/ci-skip-unchanged-manifestsfrom
feat/ci-python-diff-json

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The Socket Python CLI gives scripts a JSON report of package changes and security findings. This PR lets those scripts read the same format from Socket CLI. Use --json-format python-v1 with socket scan diff or with socket ci on a pull request. The report says whether the scan finished, was skipped, or was incomplete.

Builds on #1809.

@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Additive output format behind an opt-in flag; existing JSON and CLI behavior stay default unless --json-format python-v1 is used.

Overview
Adds --json-format python-v1 so socket scan diff and PR socket ci runs emit a versioned JSON shape aligned with the Socket Python CLI (package/alert field names, comparison_status, decision, scan/diff IDs and URLs).

A new python-diff-json mapper turns diff-scan API results into that contract, including complete, skipped, incomplete, and unsupported states plus helpers for API/usage failures. socket ci requires a PR context for this format, maps “no manifest changes” skips to the skipped payload, and threads CI metadata (repo, branch, commit) through scan/diff output. socket scan diff treats python-v1 as implying JSON, rejects combining it with --markdown, and drives exit codes from decision when the format is selected. Native JSON when the flag is omitted is unchanged.

Docs add scan-diff.md and document the flag on ci. Unit and CLI tests cover mapping, strict-blocking alert merging, and flag validation.

Reviewed by Cursor Bugbot for commit baaae53. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit baaae53. Configure here.

Comment thread src/commands/scan/python-diff-json.mts Resolved
@jdalton John-David Dalton (jdalton) changed the title feat(scan): support Python-compatible diff JSON output feat(python-cli-parity): support Python-compatible diff JSON output Dec 2, 2026
@jdalton
John-David Dalton (jdalton) force-pushed the feat/ci-python-diff-json branch 2 times, most recently from 161cf99 to b28f1c4 Compare December 3, 2026 16:42
@jdalton
John-David Dalton (jdalton) force-pushed the feat/ci-python-diff-json branch 2 times, most recently from 580ddd6 to 7461466 Compare December 3, 2026 16:44
@jdalton
John-David Dalton (jdalton) force-pushed the feat/ci-python-diff-json branch 2 times, most recently from fab9ec4 to 49f8f3e Compare December 3, 2026 16:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant