Active choices does not work correctly with same name jobs under different folders

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Let's say we have the following jobs structure:
      TEST_FOLDER/test_folder1/test_job
      TEST_FOLDER/test_folder2/test_job
      So two folders with different names that have a job with the same name.

      If we add any type of active choices parameter with the following code

      return [jenkinsProject.getFullName()]

      to both jobs, then pressingĀ Build with parametersĀ will list the same value for the parameter for both jobs: eitherĀ TEST_FOLDER/test_folder1/test_job orĀ TEST_FOLDER/test_folder2/test_job.

      I suspect the code here https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L135Ā is not doing its job right of getting the actual project where that parameter was added andĀ projectFullName is not set correctly. Then, when binding theĀ jenkinsProject variable, the code will iterate through all the jobs and set the first job that has the same name asĀ projectName, https://github.com/jenkinsci/active-choices-plugin/blob/master/src/main/java/org/biouno/unochoice/AbstractScriptableParameter.java#L184.

      Thus, different jobs with the same name will have the same project bound to the script parameter.

      Ā 

      Also, this problem seems to manifest also when renaming the jobs. It's like the plugin doesn't care that the job has changed its name.

      Ā 

            Assignee:
            Bruno P. Kinoshita
            Reporter:
            Adrian Vlad
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: