Feature/rteco 1003 external artifactory support#3438
Open
naveenku-jfrog wants to merge 3 commits intomasterfrom
Open
Feature/rteco 1003 external artifactory support#3438naveenku-jfrog wants to merge 3 commits intomasterfrom
naveenku-jfrog wants to merge 3 commits intomasterfrom
Conversation
Add workflow_dispatch inputs (jfrog_url, jfrog_admin_token) to 14 test workflows so they can target an external Artifactory instance instead of installing a local one. Changes are backward-compatible: when inputs are empty (push/PR triggers), behavior is identical to before. - Composite action: skip local-rt-setup when JFROG_URL is set, export JFROG_TESTS_URL and JFROG_TESTS_IS_EXTERNAL env vars - Pattern A workflows (explicit URL): replace hardcoded 127.0.0.1:8082 with JFROG_TESTS_URL env var - Pattern B workflows (implicit URL): conditionally append --jfrog.url and --jfrog.adminToken flags only when JFROG_TESTS_IS_EXTERNAL is set Made-with: Cursor
9e53398 to
fb209ac
Compare
Single source of truth for all CLI test suites and their dependency requirements. jfrog-cli-workflows reads this file at runtime to build its matrix — no hard-coded suite names needed downstream. Made-with: Cursor
bhanurp
reviewed
Apr 16, 2026
| - name: Run Access tests | ||
| if: matrix.os.name != 'macos' | ||
| run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.access --jfrog.url=http://127.0.0.1:8082 --jfrog.adminToken=${{ env.JFROG_TESTS_LOCAL_ACCESS_TOKEN }} | ||
| run: >- |
Contributor
There was a problem hiding this comment.
does this change impact the integration tests run on jfrog-cli-artifactory?
Collaborator
Author
There was a problem hiding this comment.
No, all the changes are backward compatible.
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 ./....Composite Action: install-local-artifactory/action.yml
What: Added two new optional inputs (JFROG_URL, JFROG_ADMIN_TOKEN) to the composite action. When JFROG_URL is provided, the action skips the local Artifactory installation entirely and instead exports three environment variables: JFROG_TESTS_LOCAL_ACCESS_TOKEN, JFROG_TESTS_URL, and JFROG_TESTS_IS_EXTERNAL. When JFROG_URL is empty (default), the existing local-rt-setup logic runs unchanged and JFROG_TESTS_URL is set to http://127.0.0.1:8082.
Why: Today, every test workflow installs a fresh local Artifactory instance via local-rt-setup. This works for open-source CI on github.com but blocks us from running the same tests against a pipeline-provisioned draft Artifactory instance (for validating pre-release builds). By making the Artifactory source configurable, we can reuse the exact same workflows for both local and external instances without duplicating workflow files.
workflow_dispatch Inputs (all 14 workflow files)
What: Added jfrog_url and jfrog_admin_token as optional workflow_dispatch inputs with empty string defaults to all 14 test workflows.
Why: These inputs allow an external caller (JFrog Pipelines, GHE dispatch, or manual trigger) to pass in an external Artifactory URL and admin token. When triggered by push or pull_request_target, these inputs are empty and the workflow behaves identically to before — zero impact on existing CI.
Pattern A Workflows: Replace Hardcoded URL (6 workflows)
Files: artifactoryTests.yml, accessTests.yml, helmTests.yml, huggingfaceTests.yml, lifecycleTests.yml, transferTests.yml (Transfer-7 job)
What: Replaced the hardcoded --jfrog.url=http://127.0.0.1:8082 with --jfrog.url=${{ env.JFROG_TESTS_URL || 'http://127.0.0.1:8082' }} in the go test commands.
Why: These workflows had the local Artifactory address baked into the test command. By reading from the JFROG_TESTS_URL environment variable (set by the composite action), the same go test command works for both local and external Artifactory. The || 'http://127.0.0.1:8082' fallback ensures backward compatibility even if the composite action hasn't been updated yet.
Pattern B Workflows: Add Conditional Flags (8 workflows + 2 special cases)
Files: npmTests.yml, mavenTests.yml, gradleTests.yml, conanTests.yml, pnpmTests.yml, nugetTests.yml, pythonTests.yml, pluginsTests.yml, plus artifactoryTests.yml (artifactoryProject step) and transferTests.yml (Transfer-6 job)
What: Added a conditional expression that appends --jfrog.url and --jfrog.adminToken flags only when JFROG_TESTS_IS_EXTERNAL == 'true':
${{ env.JFROG_TESTS_IS_EXTERNAL == 'true' && format('--jfrog.url={0} --jfrog.adminToken={1}', env.JFROG_TESTS_URL, env.JFROG_TESTS_LOCAL_ACCESS_TOKEN) || '' }}
Why: These workflows never passed --jfrog.url or --jfrog.adminToken — they relied on Go flag defaults (http://localhost:8081/) and the GetLocalArtifactoryTokenIfNeeded() function, which reads the token from the JFROG_TESTS_LOCAL_ACCESS_TOKEN env var only if the URL contains localhost:808. For an external Artifactory, those defaults don't work. However, unconditionally adding the flags would change the URL from port 8081 to 8082 for local installs, which could introduce subtle differences. The conditional approach preserves exact existing behavior for local installs (no flags appended, original defaults used) while adding the required flags only for external instances.
Transfer-7: Added Explicit --jfrog.adminToken
What: Added --jfrog.adminToken=${{ env.JFROG_TESTS_LOCAL_ACCESS_TOKEN }} to the Transfer-7 go test command (previously absent).
Why: Transfer-7 previously relied on the Go flag default mechanism to pick up the token — it passed --jfrog.url=http://127.0.0.1:8082 but not --jfrog.adminToken. The token default works because at flag registration time, the default URL is localhost:8081 (which matches GetLocalArtifactoryTokenIfNeeded). With an external URL, this implicit token resolution breaks. Making it explicit is backward-compatible (same env var value) and necessary for external instances.