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

Detect changes made by other plugins (not via Configure screen)

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • ez-templates-plugin
    • None

      If I edit a template manually and then reload Jenkins, my changes show on the Template configuration page, but do not propagate out to the Jobs that use the Template.

      I have to then save the template in Jenkins UI to have the changes propagate out.

          [JENKINS-42886] Detect changes made by other plugins (not via Configure screen)

          Steve Cohen added a comment -

          I don't see a place to put the version.  This is with 1.2.5

          Steve Cohen added a comment - I don't see a place to put the version.  This is with 1.2.5

          Marc Carter added a comment -

           "edit a template manually"

          Can you clarify what you mean here. Are you editing the XML?

          (additional details, like plugin versions, go into the freetext Environment field)

          Marc Carter added a comment -  "edit a template manually" Can you clarify what you mean here. Are you editing the XML? (additional details, like plugin versions, go into the freetext Environment field)

          An excellent example of this behavior is with the Job DSL. I'm having this issue, too.

          Child jobs that implement a template are not updated if the template job is managed with DSL. Only when the template is opened in the web UI and saved (with no actual changes made) are the updates to all the child jobs triggered. It seems that the web UI save is performing some behavior to trigger the child jobs to go sync up, and that behavior is absent when the template job configuration is managed in any other manner than the web UI and hitting "Save". Managing job configurations by means other than the web UI is very common.

          Thanks!

           

          Michael Shuler added a comment - An excellent example of this behavior is with the Job DSL. I'm having this issue, too. Child jobs that implement a template are not updated if the template job is managed with DSL. Only when the template is opened in the web UI and saved (with no actual changes made) are the updates to all the child jobs triggered. It seems that the web UI save is performing some behavior to trigger the child jobs to go sync up, and that behavior is absent when the template job configuration is managed in any other manner than the web UI and hitting "Save". Managing job configurations by means other than the web UI is very common. Thanks!  

          Steve Cohen added a comment -

          Yes, Marc Carter, editing the xml file is what I meant by "editing manually".

          Steve Cohen added a comment - Yes, Marc Carter, editing the xml file is what I meant by "editing manually".

          Marc Carter added a comment -

          Sure, accepted.

          Any idea what hook I'm meant to be listening to pick up amendments made not by the main project config screen?

          To detect a genuinely external edit of a project's XML, I'm not sure if there is a hook that will tell me the project was reloaded with different content? I'd need to checksum the content.

          Marc Carter added a comment - Sure, accepted. Any idea what hook I'm meant to be listening to pick up amendments made not by the main project config screen? To detect a genuinely external edit of a project's XML, I'm not sure if there is a hook that will tell me the project was reloaded with different content? I'd need to checksum the content.

          Marc Carter added a comment -

          mshuler I'm working on this now to support plugins like Job DSL that make updates to projects without using the user configuration screen. I don't think it's too hard to use SaveListener for this. 

          sc1478 I don't intend to support external editing of config files. Jenkins has a great REST API that means there must be way to automate that last step of nudging the system to invoke templating.

          Marc Carter added a comment - mshuler I'm working on this now to support plugins like Job DSL that make updates to projects without using the user configuration screen. I don't think it's too hard to use SaveListener for this.  sc1478 I don't intend to support external editing of config files. Jenkins has a great REST API that means there must be way to automate that last step of nudging the system to invoke templating.

          Steve Cohen added a comment -

          That's okay, Marc.  I don't need to automate this.  It was more or less a one-time thing though it could happen again.  If I;m always updating templates, something is screwed up in my process..  If you don't want to support this, then perhaps just a line in the documentation saying so would be a nice-to-have.

          Steve Cohen added a comment - That's okay, Marc.  I don't need to automate this.  It was more or less a one-time thing though it could happen again.  If I;m always updating templates, something is screwed up in my process..  If you don't want to support this, then perhaps just a line in the documentation saying so would be a nice-to-have.

          Code changed in jenkins
          User: Marc Carter
          Path:
          README.md
          http://jenkins-ci.org/commit/ez-templates-plugin/a49948492fa1f9b6504dc64b21db54f38b4655c8
          Log:
          JENKINS-42886 Update README.md with detail on external edits

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marc Carter Path: README.md http://jenkins-ci.org/commit/ez-templates-plugin/a49948492fa1f9b6504dc64b21db54f38b4655c8 Log: JENKINS-42886 Update README.md with detail on external edits

          Code changed in jenkins
          User: Marc Carter
          Path:
          README.md
          src/main/java/com/joelj/jenkins/eztemplates/TemplateImplementationProjectListener.java
          src/main/java/com/joelj/jenkins/eztemplates/TemplateProjectListener.java
          src/main/java/com/joelj/jenkins/eztemplates/exclusion/PromotedBuildsExclusion.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/EzSaveableListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/EzTemplateChange.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/PropertyListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateImplementationProjectListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateImplementationSaveableListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateProjectListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateSaveableListener.java
          src/main/java/com/joelj/jenkins/eztemplates/listener/VersionEvaluator.java
          src/main/java/com/joelj/jenkins/eztemplates/utils/ProjectUtils.java
          src/main/java/com/joelj/jenkins/eztemplates/utils/PropertyListener.java
          src/main/java/com/joelj/jenkins/eztemplates/utils/TemplateUtils.java
          src/test/java/com/joelj/jenkins/eztemplates/BehaviourTest.java
          src/test/java/com/joelj/jenkins/eztemplates/listener/EzSaveableListenerTest.java
          src/test/java/com/joelj/jenkins/eztemplates/listener/JenkinsVersionRule.java
          src/test/java/com/joelj/jenkins/eztemplates/listener/PropertyListenerTest.java
          src/test/java/com/joelj/jenkins/eztemplates/listener/VersionEvaluatorTest.java
          http://jenkins-ci.org/commit/ez-templates-plugin/4209bf7abac4240ed30f604ffe035370683309c6
          Log:
          Feature: JENKINS-42886 Detect changes made by other plugins (not via Configure screen)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Marc Carter Path: README.md src/main/java/com/joelj/jenkins/eztemplates/TemplateImplementationProjectListener.java src/main/java/com/joelj/jenkins/eztemplates/TemplateProjectListener.java src/main/java/com/joelj/jenkins/eztemplates/exclusion/PromotedBuildsExclusion.java src/main/java/com/joelj/jenkins/eztemplates/listener/EzSaveableListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/EzTemplateChange.java src/main/java/com/joelj/jenkins/eztemplates/listener/PropertyListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateImplementationProjectListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateImplementationSaveableListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateProjectListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/TemplateSaveableListener.java src/main/java/com/joelj/jenkins/eztemplates/listener/VersionEvaluator.java src/main/java/com/joelj/jenkins/eztemplates/utils/ProjectUtils.java src/main/java/com/joelj/jenkins/eztemplates/utils/PropertyListener.java src/main/java/com/joelj/jenkins/eztemplates/utils/TemplateUtils.java src/test/java/com/joelj/jenkins/eztemplates/BehaviourTest.java src/test/java/com/joelj/jenkins/eztemplates/listener/EzSaveableListenerTest.java src/test/java/com/joelj/jenkins/eztemplates/listener/JenkinsVersionRule.java src/test/java/com/joelj/jenkins/eztemplates/listener/PropertyListenerTest.java src/test/java/com/joelj/jenkins/eztemplates/listener/VersionEvaluatorTest.java http://jenkins-ci.org/commit/ez-templates-plugin/4209bf7abac4240ed30f604ffe035370683309c6 Log: Feature: JENKINS-42886 Detect changes made by other plugins (not via Configure screen)

          Marc Carter added a comment -

          In 1.3.0

          Marc Carter added a comment - In 1.3.0

            drekbour Marc Carter
            sc1478 Steve Cohen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: