Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75073

Missing serverUrl in fillCredentialsIdItems cause some credentials missing in the initial configuration

    • 933.3.0

      I have attached a short video to illustrate the issue. In the initial configuration, where no branch source has been configured, some credentials won't show in the credentials dropdown. I investigated the request, and see that the `serverUrl` parameter in fillCredentialsIdItems request is blank. Then, after I saved the configuration and reconfig the plugin again, the missing credential shows, with the fillCredentialsIdItems request filled with proper `serverUrl` value: "https://bitbucket.org". I'm using the Bitbucket cloud.

       

       

          [JENKINS-75073] Missing serverUrl in fillCredentialsIdItems cause some credentials missing in the initial configuration

          Nikolas Falco added a comment -

          I see the video and I had try myself.

          The issue is related on how the UI works. When the UI load the component page, any combobox in the page calls own fillItem method at the same time. That means when it call for the first time the
          http://localhost:8090/jenkins/job/xxx/descriptorByName/com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator/fillCredentialsIdItems
          method, values in serverUrl combobox are not yet filled so an empty string is send.
          If you have more than one Bitbucket server configured, choosing the server value will trigger a new fillCredentialsIdItems with the selected serverUrl.

          Nikolas Falco added a comment - I see the video and I had try myself. The issue is related on how the UI works. When the UI load the component page, any combobox in the page calls own fillItem method at the same time. That means when it call for the first time the http://localhost:8090/jenkins/job/xxx/descriptorByName/com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator/fillCredentialsIdItems method, values in serverUrl combobox are not yet filled so an empty string is send. If you have more than one Bitbucket server configured, choosing the server value will trigger a new fillCredentialsIdItems with the selected serverUrl.

          Daren added a comment -

          Hi Nikolas, thanks for your quick and detailed reply. Currently I have only one Bitbucket server, thus I can't trigger the `fillCredentialsIdItems` by choosing servers. Seems the bug is related to the Jenkins core instead of the plugin itself? I'm wonder if there exists some other tricks to mitigate the problem, if possible.

          Daren added a comment - Hi Nikolas, thanks for your quick and detailed reply. Currently I have only one Bitbucket server, thus I can't trigger the `fillCredentialsIdItems` by choosing servers. Seems the bug is related to the Jenkins core instead of the plugin itself? I'm wonder if there exists some other tricks to mitigate the problem, if possible.

            nfalco Nikolas Falco
            techiscy Daren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: