jenkinsci/bitbucket-branch-source-plugin

Invalid error message about Unregistered Server Reopened

markperdue opened this issue · 3 comments

Jenkins and plugins versions report

Cloudbees CI Managed Controller 2.319.3.4-rolling
Bitbucket Branch Source Plugin 746.v350d2781c184 (currently latest in Cloudbees but doesn't seem to be latest in this repo)

What Operating System are you using (both controller, and any agents involved in the problem)?

Tenant controller running within CJOC in EKS k8s v1.21

Reproduction steps

  1. Delete any existing Bitbucket endpoints from global Jenkins controller configuration
  2. Add a single Bitbucket Server entry
    Screen Shot 2022-06-09 at 12 54 23 PM
  3. Save changes
  4. Create a new Multibranch Pipeline job
  5. From Branch Sources select Bitbucket

Expected Results

  1. Bitbucket Server entry is selected by default
  2. No error message related to 'Unregistered Server' is displayed

Actual Results

  1. Bitbucket Server entry is selected by default
  2. Error message related to 'Unregistered Server' is displayed
    Screen Shot 2022-06-09 at 12 55 18 PM

Anything else?

This is very related to #416 but the accepted fix there is for DSL pipelines. The 'bug' still exists through the default user-facing flow when using the UI.

Even with the error message displayed, the job does still work like as mentioned in #416 but it would be nice if the error message wasn't displayed. Some of our developers that don't manage the instance see the error message and take it at surface level that something is not working.

What might be a tip on what's going on here is the following addl repo steps:

  1. Delete any existing Bitbucket endpoints from global Jenkins controller configuration

  2. Add a Bitbucket Cloud entry

  3. Add a single Bitbucket Server entry
    Screen Shot 2022-06-09 at 12 56 56 PM

  4. Save changes

  5. Create a new Multibranch Pipeline job

  6. From Branch Sources select Bitbucket

  7. Bitbucket Cloud is selected by default and no error is displayed
    Screen Shot 2022-06-09 at 12 57 20 PM

  8. Using dropdown select Bitbucket server entry from step 3

  9. Bitbucket server entry displays as expected without any errors unlike the earlier steps.
    Screen Shot 2022-06-09 at 12 57 28 PM

The best guess I have at this without digging into code is that the initially selected value from choosing Bitbucket for Branch Sources isn't properly reading what is loaded into the list. This can sort of be seen by watching the network traffic as mentioned in #416 (comment)

e.g. The initially selected Bitbucket server passes an empty value to http://<jenkins-host>/job/<job>/descriptorByName/com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource/checkServerUrl?value=. When selecting a secondary item in the server list, the value is properly read and included in the request parameter. When the initial value is a Bitbucket Cloud server, no error is displayed. When I add the Bitbucket Server entry that causes problems as the only Bitbucket server option, the error is displayed but the error goes away when that same server is not the default-selected server in the dropdown.

Hi, I got the same issue, Any progress?