Skip to content

RTECO-1536 - Add jf ruby command for native RubyGems/Bundler support#3574

Open
agrasth wants to merge 2 commits into
masterfrom
feature/rubygems-native-support
Open

RTECO-1536 - Add jf ruby command for native RubyGems/Bundler support#3574
agrasth wants to merge 2 commits into
masterfrom
feature/rubygems-native-support

Conversation

@agrasth

@agrasth agrasth commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Registers the jf ruby <gem|bundle> command in the JFrog CLI, wiring up the native RubyGems/Bundler support with full authentication, build-info collection, and Ghost Frog integration.

Depends on: jfrog/jfrog-cli-artifactory#499

What is included in this PR

  • Command registration: jf ruby with SkipFlagParsing: true for transparent arg passthrough
  • Flag extraction: --server-id, --repo, --build-name, --build-number, --module, --project consumed by jf; everything else forwarded to native tool
  • --repo flag: Specifies Artifactory repo name; jf constructs the full gems API URL from server config (no need to pass full URLs)
  • Ghost Frog integration: gem/bundle aliases route through jf ruby <tool>
  • Help documentation: Usage examples including --repo shorthand
  • Integration tests: Version passthrough, help bypass, unsupported tool errors, no-args error, --repo stripping

Usage examples

# Bundle install (auto-discovers source from Gemfile)
jf ruby bundle install

# Gem install with --repo (URL constructed from server config)
jf ruby gem install rake --repo gems-virtual

# Gem push with --repo
jf ruby gem push my.gem --repo gems-local --build-name=build --build-number=1

# Explicit --source (traditional way still works)
jf ruby gem install rake --source https://my.jfrog.io/artifactory/api/gems/gems-virtual/

# With explicit server selection
jf ruby bundle install --server-id my-rt --repo gems-virtual

Test plan

  • go build ./... - compiles with local replaces
  • Integration tests pass (go test -run TestRuby)
  • End-to-end with live Artifactory gems repos

Wires the native RubyGems/Bundler support into the JFrog CLI:

- Register `jf ruby` command in buildtools/cli.go with SkipFlagParsing
- RubyCmd handler: extracts native tool, server-id, build details, delegates
  to RubyCommand via ExecWithPackageManager
- Add Ruby flag set (BuildName, BuildNumber, module, Project, serverId)
- Add docs/buildtools/rubycommand/help.go with usage examples
- Route gem/bundle through `jf ruby` in packagealias/dispatch.go (Ghost Frog)
- Add 5 integration tests (version passthrough, help bypass, error handling)

Note: go.mod contains local replace directives for build-info-go and
jfrog-cli-artifactory (development only, to be replaced at merge time).

Co-authored-by: Cursor <cursoragent@cursor.com>
@agrasth agrasth changed the title Add jf ruby command for native RubyGems/Bundler support RTECO-1536 - Add jf ruby command for native RubyGems/Bundler support Jun 29, 2026
The --repo flag specifies an Artifactory repository name and lets jf
construct the full gems API URL from the server config, so users do not
need to pass full Artifactory URLs for gem install/push commands.

Also updates help text with --repo examples and adds integration test.

Co-authored-by: Cursor <cursoragent@cursor.com>
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