Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rt curl ServerID environment variable usage #2882

Merged
merged 7 commits into from
Feb 26, 2025

Conversation

agrasth
Copy link
Collaborator

@agrasth agrasth commented Feb 24, 2025

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Fix: Ensure jfrog rt curl Uses JFROG_CLI_SERVER_ID When Set
Issue
Currently, jfrog rt curl does not respect the JFROG_CLI_SERVER_ID environment variable when no --server-id flag is provided. Instead, it always defaults to the server configured via jfrog c add. This PR addresses issue #2870.

Changes Made

  • Updated curlCmd in artifactory/cli.go to check for JFROG_CLI_SERVER_ID when --server-id is not explicitly set.
  • Modified test cases in artifactory_test.go to validate the new behavior.
  • Introduced structured test runs to ensure:
    • Default server config is used when no server-id or env var is set.
    • --server-id flag takes precedence over JFROG_CLI_SERVER_ID.
    • JFROG_CLI_SERVER_ID takes precedence over the default configuration.

Impact

  • Ensures consistency with environment variable behavior.
  • Provides better flexibility for users relying onJFROG_CLI_SERVER_ID.

Testing

  • Added multiple test cases covering different priority scenarios.
  • Verified jfrog rt curl behavior using structured test runs.

Copy link
Contributor

github-actions bot commented Feb 24, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@agrasth agrasth added the safe to test Approve running integration tests on a pull request label Feb 24, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 24, 2025
@agrasth
Copy link
Collaborator Author

agrasth commented Feb 24, 2025

I have read the CLA Document and I hereby sign the CLA

@agrasth agrasth added the safe to test Approve running integration tests on a pull request label Feb 25, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 25, 2025
@EyalDelarea EyalDelarea added the bug Something isn't working label Feb 26, 2025
@EyalDelarea EyalDelarea changed the title Fix: jfrog rt curl for JFROG_CLI_SERVER_ID environment variable usage Fix rt curl ServerID environment variable usage Feb 26, 2025
@EyalDelarea EyalDelarea added the safe to test Approve running integration tests on a pull request label Feb 26, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Feb 26, 2025
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@EyalDelarea EyalDelarea merged commit 7bd7346 into jfrog:dev Feb 26, 2025
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jfrog rt curl does not use JFROG_CLI_SERVER_ID environment variable
3 participants