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

New AbstractItem renaming template broken if URL is not defined in sidepanel.jelly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Jenkins Core >= 2.110
    • Jenkins 2.130

      The Jelly template for RenameAction added in jenkinsci/jenkins#3289 is incorrect for items who do not define a variable in the template that includes the rename action named url that contains the item's URL (Generally this is items that don't inherit from AbstractProject). This was found when we tried to make folders use the new renaming method and the URL created for the action was http(s)://$JENKINS/confirm-rename, when it should have been http(s)://$JENKINS/job/$FOLDER/confirm-rename.

      In particular, the url variable used in RenameAction/action.jelly is defined in AbstractProject/sidepanel.jelly, but not all AbstractItem subclasses extend AbstractProject.

      This is a regression for any Job types extending Job but not AbstractProject where Job#isNameEditable returns true and where a url variable is not set in the template that includes the Job's actions, but I don't know how common that is. I thought it might affect Pipeline since WorkflowJob does not extend AbstractProject, but fortunately url is defined in WorkflowJob/sidepanel.jelly so it works fine.

      To fix this we can copy the code to generate the URL into RenameAction/action.jelly.

          [JENKINS-52164] New AbstractItem renaming template broken if URL is not defined in sidepanel.jelly

          Devin Nusbaum added a comment -

          The only regression I found after looking through all public Job types was for Template Workflow Jobs in the template-workflows plugin.

          Devin Nusbaum added a comment - The only regression I found after looking through all public Job types was for Template Workflow Jobs in the template-workflows plugin.

          Devin Nusbaum added a comment -

          Fixed in Jenkins 2.130. See the changelog.

          Devin Nusbaum added a comment - Fixed in Jenkins 2.130. See the changelog .

            dnusbaum Devin Nusbaum
            dnusbaum Devin Nusbaum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: