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

HockeyApp Configuration Lost after Jenkins Restart

    Details

    • Similar Issues:

      Description

      1. Configure a Jenkins job to have the HockeyApp post-build action with template parameters for the API Token and App File fields.
      2. Restart Jenkins
      3. The configuration for HockeyApp in the job is gone.

      Reproduced on several Jenkins instances running Jenkins 1.598 (and older) and HockeyApp 1.2.0
      The issue does not exist in HockeyApp 1.1.0

        Attachments

          Activity

          Hide
          jedi_lewis Jedi Lewis added a comment -

          The problem appears to be the way the plugin is saving the schemaVersion parameter.

          When you save the job, it saves the schemaVersion is an XML element, Jenkins will lose the configuration:

          <hockeyapp.HockeyappRecorder>
                <schemaVersion>2</schemaVersion>
          

          Here is the fixed version. When it's saved as an attribute of hockeyapp.HockeyappRecorder, it will retain the HockeyApp configuration across Jenkins restarts, but saving the job again will reset the attribute to be an Element instead and thus break the plugin.

              <hockeyapp.HockeyappRecorder schemaVersion="2">
          
          Show
          jedi_lewis Jedi Lewis added a comment - The problem appears to be the way the plugin is saving the schemaVersion parameter. When you save the job, it saves the schemaVersion is an XML element, Jenkins will lose the configuration: <hockeyapp.HockeyappRecorder> <schemaVersion>2</schemaVersion> Here is the fixed version. When it's saved as an attribute of hockeyapp.HockeyappRecorder, it will retain the HockeyApp configuration across Jenkins restarts, but saving the job again will reset the attribute to be an Element instead and thus break the plugin. <hockeyapp.HockeyappRecorder schemaVersion= "2" >
          Hide
          sandorhadasdig Sandor Hadas added a comment - - edited

          Suggested fix in file https://github.com/jenkinsci/hockeyapp-plugin/blob/master/src/main/java/hockeyapp/HockeyappRecorderConverter.java

          [code]
          private long unmarshalPluginVersion(HierarchicalStreamReader reader)

          { final String versionString = reader.getAttribute("schemaVersion"); return versionString == null ? 0L : Long.parseLong(versionString); }

          [/code]

          to

          [code]
          private long unmarshalPluginVersion(HierarchicalStreamReader reader) {
          String versionString = reader.getAttribute("schemaVersion");
          if (versionString == null) {
          while (reader.hasMoreChildren()) {
          reader.moveDown();
          if (reader.getNodeName() == "schemaVersion")

          { versionString = reader.getValue(); }

          reader.moveUp();
          }
          }
          return versionString == null ? 0L : Long.parseLong(versionString);
          }
          [/code]

          Show
          sandorhadasdig Sandor Hadas added a comment - - edited Suggested fix in file https://github.com/jenkinsci/hockeyapp-plugin/blob/master/src/main/java/hockeyapp/HockeyappRecorderConverter.java [code] private long unmarshalPluginVersion(HierarchicalStreamReader reader) { final String versionString = reader.getAttribute("schemaVersion"); return versionString == null ? 0L : Long.parseLong(versionString); } [/code] to [code] private long unmarshalPluginVersion(HierarchicalStreamReader reader) { String versionString = reader.getAttribute("schemaVersion"); if (versionString == null) { while (reader.hasMoreChildren()) { reader.moveDown(); if (reader.getNodeName() == "schemaVersion") { versionString = reader.getValue(); } reader.moveUp(); } } return versionString == null ? 0L : Long.parseLong(versionString); } [/code]
          Hide
          darragh Darragh Sherwin added a comment -

          The issue is incorrect, the configuration is saved in the config.xml for the job but the configuration is not loaded properly when the plugin is started up again

          Show
          darragh Darragh Sherwin added a comment - The issue is incorrect, the configuration is saved in the config.xml for the job but the configuration is not loaded properly when the plugin is started up again
          Hide
          darragh Darragh Sherwin added a comment -

          Thanks to some of the cloudbees folks at Jenkins World, we found a fix for this issue.
          See https://github.com/ohoeltke/hockeyapp-plugin/commit/84a31cef8fce00afcad94249e35783a6c0b6160c

          A pull request has been submitted

          Show
          darragh Darragh Sherwin added a comment - Thanks to some of the cloudbees folks at Jenkins World, we found a fix for this issue. See https://github.com/ohoeltke/hockeyapp-plugin/commit/84a31cef8fce00afcad94249e35783a6c0b6160c A pull request has been submitted
          Hide
          darragh Darragh Sherwin added a comment -

          Hi Oliver,
          Can you please look into my pull request ?

          Thanks
          Darragh

          Show
          darragh Darragh Sherwin added a comment - Hi Oliver, Can you please look into my pull request ? Thanks Darragh
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Darragh Sherwin
          Path:
          src/main/java/hockeyapp/HockeyappRecorder.java
          http://jenkins-ci.org/commit/hockeyapp-plugin/84a31cef8fce00afcad94249e35783a6c0b6160c
          Log:
          Fix for JENKINS-26907

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Darragh Sherwin Path: src/main/java/hockeyapp/HockeyappRecorder.java http://jenkins-ci.org/commit/hockeyapp-plugin/84a31cef8fce00afcad94249e35783a6c0b6160c Log: Fix for JENKINS-26907
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Brantone
          Path:
          src/main/java/hockeyapp/HockeyappRecorder.java
          http://jenkins-ci.org/commit/hockeyapp-plugin/3095b194ff58612dcdedbbeaf8df6a74184af01f
          Log:
          Merge pull request #33 from darraghs/master

          Fix for JENKINS-26907

          Compare: https://github.com/jenkinsci/hockeyapp-plugin/compare/0e4cecd10988...3095b194ff58

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Brantone Path: src/main/java/hockeyapp/HockeyappRecorder.java http://jenkins-ci.org/commit/hockeyapp-plugin/3095b194ff58612dcdedbbeaf8df6a74184af01f Log: Merge pull request #33 from darraghs/master Fix for JENKINS-26907 Compare: https://github.com/jenkinsci/hockeyapp-plugin/compare/0e4cecd10988...3095b194ff58
          Hide
          brantone Brantone added a comment -

          Fixed in 1.2.2

          Show
          brantone Brantone added a comment - Fixed in 1.2.2

            People

            • Assignee:
              ohoeltke Oliver H
              Reporter:
              jedi_lewis Jedi Lewis
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: