feat(integration-jfrog): add -o json output, separated from logs - #55
Merged
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep GitHub App |
KunalSin9h
force-pushed
the
feat/jfrog-json-output
branch
6 times, most recently
from
August 26, 2026 09:47
faa7187 to
2696320
Compare
arunanshub
previously approved these changes
Aug 26, 2026
abhisek
reviewed
Aug 26, 2026
KunalSin9h
force-pushed
the
feat/jfrog-json-output
branch
from
August 26, 2026 12:20
2696320 to
50341d4
Compare
KunalSin9h
force-pushed
the
feat/jfrog-json-output
branch
6 times, most recently
from
August 26, 2026 14:00
e21306a to
feccacb
Compare
The run daemon separates output from logs. A single reporter (reporter.go), injected into every component, routes each line by output mode: - Output: a real state change in XRay (package_pushed, package_deleted) or a dry-run preview (dry_run_package_push, dry_run_package_delete). - Logs: everything operational (feed cycle, connectivity, startup mode, errors, no-ops, skips). Under -o json the reporter prints only result events, as JSONL on stdout, and suppresses every log: the json stream is results only, nothing on stderr. In any other mode nothing goes to stdout and results and logs render as drytui lines on stderr, the same as the rest of the CLI. The two per-package no-ops (already pushed, does not exist) are dimmed but always shown in human modes. The reporter is a constructor dependency of all four components, so wiring is uniform. Also rename the token flag to --insecure-instance-access-token: a token on the command line is saved in the shell history and shown in the process list. The docs lead with the environment variable and never show a literal token. Docs and comments for this change are written in simple, plain English. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RS4e9U1L2dP4H5XXeGPe6y
KunalSin9h
force-pushed
the
feat/jfrog-json-output
branch
from
August 26, 2026 14:04
feccacb to
4b224ad
Compare
abhisek
approved these changes
Aug 26, 2026
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.



What
safedep integration jfrog runnow has a machine-consumable output stream, cleanly separated from operational logs.package_pushed,package_deleted) or a dry-run preview (dry_run_package_push,dry_run_package_delete).-o json(or--output json) is an explicit request for machine output, so it prints only the result events, as JSONL on stdout, and nothing else: every log is suppressed. No2>/dev/nullneeded.{"event":"package_pushed","report_id":"01KR0EKN...","package":"make-array","ecosystem":"npm","versions":["0.1.2"],"issue_id":"SD-01KR0EKN...","status":201} {"event":"package_deleted","report_id":"01KR0G12...","package":"retracted","ecosystem":"pypi","issue_id":"SD-01KR0G12...","status":200}Without
-o json, the command prints for humans: results and logs both render to stderr, unchanged from before, except the high-frequency no-ops (already pushed, does not exist) are now dimmed but always shown (no--verboseneeded).package_pushed,package_deleteddry_run_package_push,dry_run_package_deleteDesign (addressing review)
reporter(reporter.go) routes everything by output mode. Only results reach stdout; everything operational is a log. Under-o jsonlogs are suppressed entirely, so the json stream is results-only and stderr stays empty.reporteris a constructor dependency of all four components (feed service, feed source, real client, print client), so wiring is uniform. No post-construction field assignment.--insecure-instance-access-token: a token on the command line leaks into shell history and the process list. Docs lead with the environment variable and never show a literal token. (Follows the existing--insecure-keychain-fallbackconvention.)dry/log(internal diagnostic), keeping it out of the json stream.Fatal errors
A fatal error (JFrog connectivity failure, missing add-on, bad API key) is a returned error, not a log: the command exits non-zero and prints the error, in every mode including
-o json(stdout stays clean, so an agent sees empty stdout + non-zero exit). Transient per-cycle errors are logs and the loop retries.Tests / docs
Tests assert the split: under
-o jsononly state changes and dry-run previews reach stdout and stderr is empty; no-ops/errors/skips are suppressed. Fullgo test ./..., gofmt, and cobra convention tests green.docs/cmd/integration-jfrog-run.mdanddocs/integration-jfrog.mddocument the output/logs boundary and the flag.