RTECO-1536 - Add jf ruby command for native RubyGems/Bundler support#3574
Open
agrasth wants to merge 31 commits into
Open
RTECO-1536 - Add jf ruby command for native RubyGems/Bundler support#3574agrasth wants to merge 31 commits into
agrasth wants to merge 31 commits into
Conversation
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>
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>
Integration tests for gem install/fetch/push, bundle install, build-info capture, checksums, scope classification, and round-trip flows. All tests auto-skip unless explicitly enabled with -test.ruby=true, so CI remains unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds rubyTests.yml following the same pattern as nixTests/uvTests: - Sets up Ruby 3.2 via ruby/setup-ruby - Spins up local Artifactory - Runs `go test --test.ruby` - Supports external Artifactory via workflow_dispatch inputs Co-authored-by: Cursor <cursoragent@cursor.com>
…tive-support Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # go.sum # main_test.go # utils/tests/consts.go # utils/tests/utils.go
Points build-info-go and jfrog-cli-artifactory replace directives to their feature branch commits on GitHub, so CI can resolve dependencies without local checkouts. Co-authored-by: Cursor <cursoragent@cursor.com>
- ruby_integration_test.go: suppress G703 path traversal on test-only WriteFile (path always comes from CreateTempDir) - buildtools/cli.go: rewrite if-else chain to switch in extractRubyRepoFromArgs to satisfy gocritic Co-authored-by: Cursor <cursoragent@cursor.com>
Required by the CI static analysis check that verifies all registered commands expose AI-consumable descriptions via ResolveDescription. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Integration tests now call prepareHomeDir(t) via initRubyTest to ensure the JFrog server config is available (fixes "Invalid uri scheme" errors from missing ArtifactoryUrl). Also updates jfrog-cli-artifactory dependency to include the reference token auth fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Integration tests now call prepareHomeDir(t) via initRubyTest to ensure the JFrog server config is available (fixes "Invalid uri scheme" errors from missing ArtifactoryUrl). Also updates jfrog-cli-artifactory dependency to include the reference token auth fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Bundler lockfile fixtures caused "unreadable lockfile" errors in CI due to version mismatches and unpatched placeholder URLs. Removing them lets bundler generate a fresh lockfile during tests. Also updates jfrog-cli-artifactory dep to include the fix that errors on invalid --server-id instead of silently falling through. Co-authored-by: Cursor <cursoragent@cursor.com>
Bundler lockfile fixtures caused "unreadable lockfile" errors in CI due to version mismatches and unpatched placeholder URLs. Removing them lets bundler generate a fresh lockfile during tests. Also updates jfrog-cli-artifactory dep to include the fix that errors on invalid --server-id instead of silently falling through. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Bundler env var credential matching varies across versions and port handling. Embedding credentials directly in the source URL is the most reliable approach for CI, matching how gem install works. Co-authored-by: Cursor <cursoragent@cursor.com>
Bundler env var credential matching varies across versions and port handling. Embedding credentials directly in the source URL is the most reliable approach for CI, matching how gem install works. Co-authored-by: Cursor <cursoragent@cursor.com>
When using access tokens, serverDetails.User is empty. Fall back to the test framework default user (admin) for embedded URL credentials in the Gemfile, matching how Artifactory expects basic auth. Co-authored-by: Cursor <cursoragent@cursor.com>
When using access tokens, serverDetails.User is empty. Fall back to the test framework default user (admin) for embedded URL credentials in the Gemfile, matching how Artifactory expects basic auth. Co-authored-by: Cursor <cursoragent@cursor.com>
Artifactory generates specs.4.8.gz (needed by Bundler) only after at least one gem is cached via the remote. Add a gem fetch warm-up step before bundle tests to prime the virtual repo index. Co-authored-by: Cursor <cursoragent@cursor.com>
Artifactory generates specs.4.8.gz (needed by Bundler) only after at least one gem is cached via the remote. Add a gem fetch warm-up step before bundle tests to prime the virtual repo index. Co-authored-by: Cursor <cursoragent@cursor.com>
The gem fetch approach doesn't generate specs.4.8.gz on the virtual. Instead, build and deploy a minimal gem to the local repo via jf rt upload, which triggers Artifactory index generation. Co-authored-by: Cursor <cursoragent@cursor.com>
The gem fetch approach doesn't generate specs.4.8.gz on the virtual. Instead, build and deploy a minimal gem to the local repo via jf rt upload, which triggers Artifactory index generation. Co-authored-by: Cursor <cursoragent@cursor.com>
Generic jf rt upload doesn't trigger Artifactory gem index generation. Use jf ruby gem push which hits the RubyGems API endpoint (POST /api/gems/<repo>) and properly triggers specs.4.8.gz creation. Co-authored-by: Cursor <cursoragent@cursor.com>
Generic jf rt upload doesn't trigger Artifactory gem index generation. Use jf ruby gem push which hits the RubyGems API endpoint (POST /api/gems/<repo>) and properly triggers specs.4.8.gz creation. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Artifactory generates specs.4.8.gz asynchronously after gem push API call. Add a wait to give it time to complete before bundle tests request the index. Co-authored-by: Cursor <cursoragent@cursor.com>
The virtual repo's specs.4.8.gz depends on both the local repo (gem push) AND the remote repo (lazy sync from rubygems.org). Replace the fixed 10s sleep with polling (up to 60s, 5s intervals) that verifies the index is actually available before proceeding with bundle tests. Co-authored-by: Cursor <cursoragent@cursor.com>
1. warmUpRubyVirtualRepo now uses sync.Once so the expensive polling (push gem + poll specs.4.8.gz) runs only once across all tests. Increased timeout to 120s for slow CI Artifactory instances. 2. TestRubyBuildFlags: name-only and number-only cases now correctly expect an error (CLI rejects partial build-name/build-number). Co-authored-by: Cursor <cursoragent@cursor.com>
The CI Artifactory instance does not generate specs.4.8.gz for virtual repos (confirmed after multiple attempts with polling up to 120s). This is an infrastructure limitation, not a code bug. Fix: Bundle tests now use the LOCAL repo directly with a self-contained 'warmup' gem. The local repo generates specs immediately on gem push. gem install/fetch tests still use the virtual repo (which works fine for individual gem operations that don't need specs.4.8.gz). Co-authored-by: Cursor <cursoragent@cursor.com>
…tive-support Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # ruby_integration_test.go
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.

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
jf rubywithSkipFlagParsing: truefor transparent arg passthrough--server-id,--repo,--build-name,--build-number,--module,--projectconsumed by jf; everything else forwarded to native tool--repoflag: Specifies Artifactory repo name; jf constructs the full gems API URL from server config (no need to pass full URLs)gem/bundlealiases route throughjf ruby <tool>Usage examples
Test plan
go build ./...- compiles with local replacesgo test -run TestRuby)