jenkinsci / jenkinsci/jfrog-plugin
(short issue description)
- Dominant language
- Java
- Stars
- 16
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
Defining a server under Manage Jenkins | Configure System with a unique ID and its URL but without credentials, and in pipelines edit the configuration to add user/password, then subsequent 'jf' calls complaint about not finding the server URL.
### Current behavior
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] withEnv
[Pipeline] {
[Pipeline] jf
[arti_test] $ docker exec --env ******** --env ******** f833c477775786725f2cca26fc80cc1f1bac9f61ce7119c2066189617626e808 /opt/jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf c add arti_server --user= ******** --url=https://my_art_server.com --artifactory-url=https://my_art_server.com/artifactory --distribution-url=https://my_art_server.com/distribution --xray-url=https://my_art_server.com/xray --interactive=false --overwrite=true
14:04:12 [Debug] JFrog CLI version: 2.53.2
14:04:12 [Debug] OS/Arch: linux/amd64
14:04:12 [Debug] Locking config file to run config AddOrEdit command.
14:04:12 [Debug] Creating lock in: /opt/jenkins/workspace/arti_test@tmp/jfrog/10/.jfrog/locks/config
14:04:12 [Debug] Releasing lock: /opt/jenkins/workspace/arti_test@tmp/jfrog/10/.jfrog/locks/config/jfrog-cli.conf.lck.9.1710338652958460070
14:04:12 [Debug] Config AddOrEdit command completed successfully. config file is released.
[arti_test] $ docker exec --env ******** --env ******** f833c477775786725f2cca26fc80cc1f1bac9f61ce7119c2066189617626e808 /opt/jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf config show
14:04:13 [Debug] JFrog CLI version: 2.53.2
14:04:13 [Debug] OS/Arch: linux/amd64
Server ID: arti_server
JFrog Platform URL: https://my_art_server.com/
Artifactory URL: https://my_art_server.com/artifactory/
Distribution URL: https://my_art_server.com/distribution/
Xray URL: https://my_art_server.com/xray/
Mission Control URL: https://my_art_server.com/mc/
Pipelines URL: https://my_art_server.com/pipelines/
Default: true
[Pipeline] jf
[arti_test] $ docker exec --env ******** --env ******** f833c477775786725f2cca26fc80cc1f1bac9f61ce7119c2066189617626e808 /opt/jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf config edit arti_server --user=my_user --password=***
14:04:13 [Debug] JFrog CLI version: 2.53.2
14:04:13 [Debug] OS/Arch: linux/amd64
14:04:13 [Debug] Locking config file to run config AddOrEdit command.
14:04:13 [Debug] Creating lock in: /opt/jenkins/workspace/arti_test@tmp/jfrog/10/.jfrog/locks/config
14:04:13 [Debug] Releasing lock: /opt/jenkins/workspace/arti_test@tmp/jfrog/10/.jfrog/locks/config/jfrog-cli.conf.lck.28.1710338653130701623
14:04:13 [Debug] Config AddOrEdit command completed successfully. config file is released.
[Pipeline] jf
[arti_test] $ docker exec --env ******** --env ******** f833c477775786725f2cca26fc80cc1f1bac9f61ce7119c2066189617626e808 /opt/jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf config show
14:04:13 [Debug] JFrog CLI version: 2.53.2
14:04:13 [Debug] OS/Arch: linux/amd64
Server ID: arti_server
User: my_user
Password: ***
Default: true
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build and Publish)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] withEnv
[Pipeline] {
[Pipeline] jf
[arti_test] $ docker exec --env ******** --env ******** f833c477775786725f2cca26fc80cc1f1bac9f61ce7119c2066189617626e808 /opt/jenkins/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf mvn --project ${PROJECT_ID} clean install
14:04:20 [Debug] JFrog CLI version: 2.53.2
14:04:20 [Debug] OS/Arch: linux/amd64
14:04:20 [Debug] Saving build general details at: /tmp/jfrog/builds/33ca3cae3fe1ba0994026d5b733bfaf6ff380687333fbea68dfce8c634937b79/partials
14:04:20 [Error] Server ID arti_server: URL is required.
### Reproduction steps
Add a server configuration under Manage Jenkins > Configure System as described in the doc but without credentials.
Add pipeline steps:
```groovy
stage('Edit JFrog CLI') {
steps {
jf('config show')
jf('config edit arti_server --user=my_user --password=***')
jf('config show')
}
}
stage('Build and Publish') {
steps {
jf('mvn --project ${PROJECT_ID} clean install')
}
}
```
### Expected behavior
The user and password should be add to configuration without removing server URLs
### JFrog plugin version
1.5.0
### JFrog CLI version
2.53.2
### Operating system type and version
Linux
### JFrog Artifactory version
7.68.19
### JFrog Xray version
_No response_
Contributor guide
Research direction
Start by reproducing the Manage Jenkins configuration and pipeline steps with JFrog plugin 1.5.0, focusing on the transition from `jf config edit` to the later `jf mvn` call. Done means adding user and password preserves the configured server URLs so the subsequent Maven command no longer reports that the URL is required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100