Skip to content

Add --format flag support to artifactory commands#435

Merged
agrasth merged 32 commits into
jfrog:mainfrom
ehl-jf:JGC-478-format-flag
May 12, 2026
Merged

Add --format flag support to artifactory commands#435
agrasth merged 32 commits into
jfrog:mainfrom
ehl-jf:JGC-478-format-flag

Conversation

@ehl-jf
Copy link
Copy Markdown
Contributor

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

Summary

Adds --format flag support across rt commands so output can be rendered as json, table, or the default human-readable text. The flag plumbs through to the framework's shared format machinery rather than each command rolling its own.

Changes

Commands with new --format support

  • Generic: search, ping, upload, download, move, copy, delete, direct-download, set-props, delete-props, git-lfs-clean
  • Build: build-publish, build-promote, build-discard, build-add-dependencies
  • Docker / Podman: docker-promote, podman-push, podman-pull
  • Repo / Replication: repo-create, repo-update, replication-create
  • NuGet: nuget-deps-tree

build-publish specifics

  • BuildPublishCommand now exposes GetBuildInfoUiUrl(), SetSuppressOutput(), and SetCollectSha256() so the CLI layer can render the UI URL (and sha256) when --format is set, without double-printing JSON from Run().

Tests

  • New artifactory/cli/cli_test.go (~1.3k lines) covering format rendering across the affected commands.

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • Appropriate label is added to auto generate release notes.
  • I used gofmt for formatting the code before submitting the pull request.
  • PR description is clear and concise, and it includes the proposed solution/fix.

ehl-jf added 21 commits May 4, 2026 09:06
Pattern A: DependencyTreeCmd() now returns ([]byte, error); --format json
emits indented solution JSON (backward-compat default); --format table renders
PROJECT/DEPENDENCY_COUNT table per project.
@agrasth agrasth added the improvement Automatically generated release notes label May 4, 2026
Comment thread artifactory/cli/cli.go Outdated
Comment thread artifactory/cli/cli.go
Comment thread artifactory/cli/cli.go Outdated
Comment thread artifactory/cli/cli.go Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ehl-jf ehl-jf changed the title Add --format flag support Add --format flag support to artifactory commands May 5, 2026
@ehl-jf ehl-jf requested a review from agrasth May 5, 2026 11:48
Comment thread artifactory/cli/cli.go
@reshmifrog
Copy link
Copy Markdown
Contributor

Please update the description , It needs to have all the information regarding the changes you have done as part of this PR.

@ehl-jf ehl-jf requested a review from reshmifrog May 7, 2026 12:16
@reshmifrog reshmifrog added the safe to test Approve running integration tests on a pull request label May 11, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label May 11, 2026
@agrasth agrasth merged commit ec417dc into jfrog:main May 12, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants