Skip to content

Add common --format flag support#49

Open
ehl-jf wants to merge 10 commits intomainfrom
JGC-471-format-flag
Open

Add common --format flag support#49
ehl-jf wants to merge 10 commits intomainfrom
JGC-471-format-flag

Conversation

@ehl-jf
Copy link
Copy Markdown
Collaborator

@ehl-jf ehl-jf commented Apr 24, 2026

  • The pull request is targeting the main branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • All integration tests have passed locally as they cannot be automated yet.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

ehl-jf added 9 commits April 23, 2026 14:21
Replaces the undocumented --json bool flag with --format (accepted: json,
table; default: table). The default remains CSV (table) to match existing
behaviour; --format json emits the full {"workers":[...]} JSON response.
The --json flag is removed; scripts must migrate to --format json.
Supports json (default) and table output formats for the execute command, consistent with the worker list command.
Accepted formats: json (default, backward-compatible) and table. The
table output is CSV with columns: start, end, testRun, result, logs.
No --json flag existed previously, so no removal was needed.
Accepted formats: json (default, backward-compatible) and table.
Table output renders the worker response as CSV key-value rows.
No --json flag was removed as the command did not have one.
Accepts json and table formats; default is table (preserves the existing
comma-separated plain-text output for backward compatibility). JSON output
returns the full ActionMetadata array. Added PrintJSONValue helper to
commands/common/cmd_io.go.
Pattern B (HTTP call, body discarded): --format json emits a synthetic
{"status_code": 200, "message": "OK"} JSON object; --format <other>
returns an error; omitting --format preserves the existing log-only
behaviour for backward compatibility. No --json flag was removed.
Pattern B: only json is supported (no tabular data). When --format json
is passed, prints {"status_code": 200, "message": "OK"}. Unsupported
formats return an error. When no --format flag is given, behaviour is
unchanged (log lines only, no JSON output).
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Unit Tests Results

257 tests  +26   257 ✅ +26   1m 20s ⏱️ -1s
  3 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 39d443e. ± Comparison against base commit be568d9.

This pull request removes 1 and adds 27 tests. Note that renamed tests count towards both.
commands ‑ TestListCommand/list_for_JSON
commands ‑ TestWorkerDeploy_FormatJSON
commands ‑ TestWorkerDeploy_FormatTableRejected
commands ‑ TestWorkerDeploy_NoFormat
commands ‑ TestWorkerDryRun_FormatDefault
commands ‑ TestWorkerDryRun_FormatJSON
commands ‑ TestWorkerDryRun_FormatTable
commands ‑ TestWorkerDryRun_FormatUnsupported
commands ‑ TestWorkerExecute_FormatDefault
commands ‑ TestWorkerExecute_FormatJSON
commands ‑ TestWorkerExecute_FormatTable
…

♻️ This comment has been updated with latest results.

Comment thread go.mod
github.com/jfrog/go-mockhttp v0.3.1
github.com/jfrog/jfrog-cli-core/v2 v2.60.0
github.com/jfrog/jfrog-client-go v1.55.0
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260424064607-168e6cd94fc8
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is JGC-471-format-flag branch.
Should be replace with master prior to merge, once jfrog-cli-core will be merged

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