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

Email Template Testing can't find passed Jelly script file

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: email-ext-plugin
    • Labels:
      None
    • Environment:
      OS: Windows 7
      Jenkins: 1.516
      Email-ext: 2.30.2
    • Similar Issues:

      Description

      Newly implemented Email Template Testing feature doesn't work for Jelly scripts.

      If name of template file is passed with extension following error occurs:

      Jelly script [myscript.jelly] was not found in $JENKINS_HOME/email-templates.

      If name of template file is passed without extension following error occurs:

      Template [myscript] was not found in $JENKINS_HOME/email-templates.

      additionally a validation error is shown:

      The file 'myscript' does not exist

      The problem is that EmailExtTemplateAction.doTemplateFileCheck() and EmailExtTemplateAction.renderTemplate() methods expect that template name includes extension. But JellyScriptContent.getTemplateInputStream() expects that template name doesn't contains extension.

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          Thanks for testing this I'll see if I can get a fix in for the next release.

          Show
          slide_o_mix Alex Earl added a comment - Thanks for testing this I'll see if I can get a fix in for the next release.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/JellyScriptContent.java
          http://jenkins-ci.org/commit/email-ext-plugin/16a8d52dc4d65b586dc5310a07152d68a0cd78c0
          Log:
          Fixed JENKINS-18157

          Check if file already ends with .jelly and don't add if it does.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/content/JellyScriptContent.java http://jenkins-ci.org/commit/email-ext-plugin/16a8d52dc4d65b586dc5310a07152d68a0cd78c0 Log: Fixed JENKINS-18157 Check if file already ends with .jelly and don't add if it does.
          Hide
          slide_o_mix Alex Earl added a comment -

          Added check if template name already ends with .jelly and don't append if it does.

          Show
          slide_o_mix Alex Earl added a comment - Added check if template name already ends with .jelly and don't append if it does.
          Hide
          awilliams Angel Williams added a comment -

          Has this been fixed I am havving issues but need Windows nodes to connect.

          Show
          awilliams Angel Williams added a comment - Has this been fixed I am havving issues but need Windows nodes to connect.
          Hide
          slide_o_mix Alex Earl added a comment -

          Yes, it was fixed. I'm not sure what it has to do with nodes at all...

          Show
          slide_o_mix Alex Earl added a comment - Yes, it was fixed. I'm not sure what it has to do with nodes at all...
          Hide
          awilliams Angel Williams added a comment - - edited

          where is the directory $Jenkins_Home/email-templates.. its been soo long I can't find it

          Well that is because between build 1.504 which was working for Jenkins and now 1.546 The Email-templates directory is gone.

          Show
          awilliams Angel Williams added a comment - - edited where is the directory $Jenkins_Home/email-templates.. its been soo long I can't find it Well that is because between build 1.504 which was working for Jenkins and now 1.546 The Email-templates directory is gone.
          Hide
          slide_o_mix Alex Earl added a comment -

          $JENKINS_HOME is on your Jenkins server. Usually its $HOME/.jenkins.

          Show
          slide_o_mix Alex Earl added a comment - $JENKINS_HOME is on your Jenkins server. Usually its $HOME/.jenkins.
          Hide
          slide_o_mix Alex Earl added a comment -

          Then it some how got removed during your upgrade process, which has nothing to do with email-ext.

          Show
          slide_o_mix Alex Earl added a comment - Then it some how got removed during your upgrade process, which has nothing to do with email-ext.
          Hide
          awilliams Angel Williams added a comment -

          ok I upgraded Jenkins from 1.504 to 1.546 recently and upgraded the EmailExt Plugin from 2.27.1 to what ever is available now.

          I luckily had a snapshot of the server prior to upgrade and can say that after the upgrade all my templates were missing from this path:
          C:\Jenkins\plugins\email-ext\WEB-INF\classes\hudson\plugins\emailext\templates

          So is there a proper way to upgrade this plugin without loosing my templates and the ability to send email post build?

          Show
          awilliams Angel Williams added a comment - ok I upgraded Jenkins from 1.504 to 1.546 recently and upgraded the EmailExt Plugin from 2.27.1 to what ever is available now. I luckily had a snapshot of the server prior to upgrade and can say that after the upgrade all my templates were missing from this path: C:\Jenkins\plugins\email-ext\WEB-INF\classes\hudson\plugins\emailext\templates So is there a proper way to upgrade this plugin without loosing my templates and the ability to send email post build?
          Hide
          slide_o_mix Alex Earl added a comment -

          Your templates should never go into the path you mention. Please review the documentation on where to put templates. With the most recent version of the plugin you can also use the managed config file plugin to contain your templates.

          Show
          slide_o_mix Alex Earl added a comment - Your templates should never go into the path you mention. Please review the documentation on where to put templates. With the most recent version of the plugin you can also use the managed config file plugin to contain your templates.
          Hide
          thekbb Kevin Behrens added a comment - - edited

          @Alex Earl , Can you expound upon using he 'config file plugin to contain your templates'? This sounds like sauce I need to have.

          Were you referring to the Config+File+Provider+Plugin? From the wiki, it say it

          Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace.

          I am missing something, as that would allow me to put the template on the slave, where it won't be used.

          Show
          thekbb Kevin Behrens added a comment - - edited @Alex Earl , Can you expound upon using he 'config file plugin to contain your templates'? This sounds like sauce I need to have. Were you referring to the Config+File+Provider+Plugin ? From the wiki, it say it Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace. I am missing something, as that would allow me to put the template on the slave, where it won't be used.
          Hide
          slide_o_mix Alex Earl added a comment -

          Email-ext uses that plugin to allow users to store templates inside Jenkins. You would want this plugin https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin for the GUI to manage the files.

          Show
          slide_o_mix Alex Earl added a comment - Email-ext uses that plugin to allow users to store templates inside Jenkins. You would want this plugin https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin for the GUI to manage the files.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              ddbear Volodja Medvid
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: