Open
Conversation
Adds `--format table|json` to `jf access-token-create`. Default is `json` for backward compatibility. Table mode renders a two-column tabwriter output with access_token truncated to 40 chars. Includes unit tests covering both formats, truncation, absent-field omission, unsupported-format error, and default/explicit format resolution. Also adds a general `Format` StringFlag entry and restores the Xray-specific flag as `XrFormat` in commandsflags.go.
Adds `--format table|json` to `jf exchange-oidc-token`. Default is `json` for backward compatibility (the command always emitted JSON via PrintResponseToConsole). Table mode renders access_token (truncated to 40 chars), username, issued_token_type, scope, and token_type using tabwriter. Works directly with the full OidcTokenResponseData struct rather than the narrower ExchangeCommandOutputStruct, exposing all response fields. Includes 9 unit tests covering both formats, truncation, absent-field omission, unsupported-format error, and default/explicit format resolution.
jf mc license-acquire: refactors LicenseAcquire() in jfrog-cli-core to
return the key string instead of printing it; CLI adds --format table|json
(default table) outputting a labeled tabwriter row or {"license_key":"..."}.
jf pl status: adds suppressOutput/Response() to StatusCommand in
jfrog-cli-core; when --format is set the command's internal colored output
is suppressed and the CLI formats the full PipelineRunStatusResponse —
table renders pipeline/branch/run/status/duration columns skipping unrun
pipelines, json emits the complete response struct.
7 tests for license-acquire, 9 tests for pl status — all 16 pass.
Adds utils/cliutils/httpformat.go with FormatHTTPResponseJSON(body, statusCode):
- If body is valid JSON, prints it indented.
- Otherwise prints {"status_code": N, "message": "..."} — using the body
text as message when non-empty, or the HTTP status phrase when nil.
Applies the helper to jf pl trigger (--format json):
- jfrog-client-go discards the trigger response body, so nil is passed;
on success (error == nil guarantees HTTP 200) the helper synthesises
{"status_code": 200, "message": "OK"}.
- When the body IS available in future callers, the same helper will
transparently surface the real JSON response.
4 unit tests cover: valid JSON passthrough, nil body fallback,
plain-text body fallback, and corrupt JSON fallback.
…igger (report)
pl sync (Pattern B): --format json emits {"status_code":200,"message":"OK"};
no table format as the client layer discards the response body.
pl sync-status (Pattern A): default table shows branch/status/is_syncing/
started/ended/commit_sha columns; --format json marshals full
[]PipelineSyncStatus. Requires SyncStatusCommand.SetSuppressOutput in core.
pl trigger report corrected: was already implemented in previous commit
(987c57db) but report still showed it as not done.
Both commands' core functions refactored to return ([]byte, error) instead of printing internally. Default format is json (backward-compatible). Table format uses generic map rendering for the unknown response schema, with preferred key ordering.
Both commands are Pattern B: the client layer discards the response body.
--format json emits {"status_code":200,"message":"OK"}; table is rejected
with an error. Wrapper functions in plugins/cli.go handle the format guard
so the existing commands.InstallCmd and PublishCmd are unchanged.
The name = "name" constant in the Pipelines flags block was never referenced in any flag slice, causing a recurring unused-const diagnostic.
Reads local config directly via config.GetAllServersConfigs / GetSpecificConfig. --format table renders a FIELD/VALUE tabwriter table per server, omitting empty fields and masking sensitive values as ***. --format json marshals the sanitized []*ServerDetails slice. When no --format is set, delegates to commands.ShowConfig unchanged for full backward compatibility.
jf worker list now supports --format (json, table; default: table). The old --json flag has been removed. Updates summary counts and adds a Priority Summary strikethrough entry.
…ls.GetOutputFormat Remove 8 identical getXxxOutputFormat functions across config, general/token, missioncontrol, and pipelines packages. All callers now use commonCliUtils.GetOutputFormat from jfrog-cli-core/v2/common/cliutils.
2d65caf to
6395942
Compare
vitaliil-jfrog
approved these changes
Apr 29, 2026
|
|
||
| // replace github.com/jfrog/build-info-go => github.com/reshmifrog/build-info-go v1.8.9-0.20260106113011-c7f131cea484 | ||
|
|
||
| replace github.com/jfrog/jfrog-cli-artifactory => github.com/ehl-jf/jfrog-cli-artifactory v0.0.0-20260428143325-08b067cf4746 |
Collaborator
There was a problem hiding this comment.
Should we change the dependency to the one from jfrog repo before merge?
83d204e to
25b9864
Compare
fe21cb8 to
5af9d26
Compare
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.
masterbranch.go vet ./....go fmt ./....