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

Project renaming is not propagated to Active Choices projectName

    Details

    • Type: Bug
    • Status: Fixed but Unreleased (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: active-choices-plugin
    • Labels:
      None
    • Environment:
      Jenkins v2.100, Active Choices v 2,1
    • Similar Issues:

      Description

      After using the Jenkins UI to rename a project the old name remains in the Active choices configuration and the project form UI breaks.

      PLATE_EXPLORER was the old project name. The project is now renamed to ASSAY_EXPLORER.

       

      Tried the following two workarounds.

      1. Reload project configuration-Does not work!
      2. Make a small change to the configuration (such as changing the description of one of the parameters) and save the configuration- THIS WORKED! projectName in Active Choice parameters gets updated to the new project name

        Attachments

          Activity

          Hide
          kinow Bruno P. Kinoshita added a comment -

          Fixed in pull request 20 by sebcworks (thanks!)

           

          https://github.com/jenkinsci/active-choices-plugin/pull/20

          Show
          kinow Bruno P. Kinoshita added a comment - Fixed in pull request 20 by sebcworks (thanks!)   https://github.com/jenkinsci/active-choices-plugin/pull/20
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Ioannis Moutsatsosuno-choice.hpi as promised, here's the hpi

          Just checked out the project and `mvn clean package`'d.

          Show
          kinow Bruno P. Kinoshita added a comment - Ioannis Moutsatsos uno-choice.hpi as promised, here's the hpi Just checked out the project and `mvn clean package`'d.
          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Testing today. Thanks Bruno P. Kinoshita!

          Show
          ioannis Ioannis Moutsatsos added a comment - Testing today. Thanks Bruno P. Kinoshita !
          Hide
          ioannis Ioannis Moutsatsos added a comment - - edited

          Hi Bruno P. Kinoshita Finished testing today and the current snapshot does NOT seem to resolve the issue. After renaming the project I checked the projectName in the config.xml file and it seems to still point to the name of the project before renaming. Attaching before and after project rename Screenshots

          I have also tested COPYing a project to a different name. This works! When the project is copied to a new config.xml the projectName references are updated.

           

          I need perhaps to add that I'm currently using Jenkins v2.100. I was just reading some notes  'UI for renaming jobs' has been changed: JENKINS-22936

          Could some of these discrepancies be due to different versions of Jenkins?

           

           

           

          Show
          ioannis Ioannis Moutsatsos added a comment - - edited Hi Bruno P. Kinoshita Finished testing today and the current snapshot does NOT seem to resolve the issue. After renaming the project I checked the projectName in the config.xml file and it seems to still point to the name of the project before renaming. Attaching before and after project rename Screenshots I have also tested COPYing a project to a different name. This works! When the project is copied to a new config.xml the projectName references are updated.   I need perhaps to add that I'm currently using Jenkins v2.100. I was just reading some notes  'UI for renaming jobs' has been changed:  JENKINS-22936 Could some of these discrepancies be due to different versions of Jenkins?      
          Hide
          kinow Bruno P. Kinoshita added a comment -

          Ioannis Moutsatsos now I noticed, you were using the `projectName` property of the parameter. That is a helper variable, used when the project is created via its constructor. But if it is loaded via serializer/Stapler/etc, then I am not sure if the constructor will always be called.

          There is a logic that tries to use that variable, but when it is not found, we fallback to locating a project with a parameter UUID (every active choices has a random UUID). However, we do not save the project to `projectName`.

          For the current implementation - which is a bit complex, and may need to improvements - the best way to access the Jenkins project is via the variable `jenkinsProject`, that the plugin populates automatically.

          Tried with a groovy script that returned `return [jenkinsProject.name]`, and it worked before & after renaming the project.

          Hope that makes sense?

          Show
          kinow Bruno P. Kinoshita added a comment - Ioannis Moutsatsos now I noticed, you were using the `projectName` property of the parameter. That is a helper variable, used when the project is created via its constructor. But if it is loaded via serializer/Stapler/etc, then I am not sure if the constructor will always be called. There is a logic that tries to use that variable, but when it is not found, we fallback to locating a project with a parameter UUID (every active choices has a random UUID). However, we do not save the project to `projectName`. For the current implementation - which is a bit complex, and may need to improvements - the best way to access the Jenkins project is via the variable `jenkinsProject`, that the plugin populates automatically. Tried with a groovy script that returned `return [jenkinsProject.name] `, and it worked before & after renaming the project. Hope that makes sense?

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              ioannis Ioannis Moutsatsos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: