Skip to content

Add common --format flag support#49

Merged
ehl-jf merged 11 commits intomainfrom
JGC-471-format-flag
Apr 30, 2026
Merged

Add common --format flag support#49
ehl-jf merged 11 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 19s ⏱️ ±0s
  3 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit f1769b1. ± 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 Outdated
@ehl-jf ehl-jf merged commit ce7d9b3 into main Apr 30, 2026
5 of 6 checks passed
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