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

Changelist parsing fails when description contains jobs without fix status

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Perforce 2010.2
    • Similar Issues:

      Description

      Versions are:
      Jenkins ver. 1.466.1
      Perforce Plugin: 1.3.17

      The perforce plug-in is currently throwing exceptions for any changelists which have jobs attached but do not have any "closed or fixed" status associated.

      I checked the code and seems like there is one more case to be checked (<-- below):

      // Line looks like:
      // EXT-84 on 2007/09/25 by mwille closed
      // or
      // EXT-84 on 2007/09/25 closed
      // or
      // EXT-84 on 2007/09/25
      // or
      // EXT-84 on 2007/09/25 by mwille <-- The new case

      Adding details.hasMoreTokens() at line 136 may fix it - I have not checked it of course.

      Exception thrown by the plugin is:

      ===== begin =====
      [xyz] $ p4 describe -s 51820
      Caught exception communicating with perforce. Failed to retrieve changelist.
      Response from perforce was:
      Change 51820 by me@my_workspace on 2012/09/05 04:31:37

      jenkins test

      Jobs fixed ...

      job000162 on 2012/08/25 by p4dtguser

      Test it thoroughly.

      Affected files ...

      ... //Main/Tools/bar.txt#17 edit

      com.tek42.perforce.PerforceException: Failed to retrieve changelist.
      Response from perforce was:
      Change 51820 by me@my_workspace on 2012/09/05 04:31:37

      jenkins test

      Jobs fixed ...

      job000162 on 2012/08/25 by p4dtguser

      Test it thoroughly.

      Affected files ...

      ... //Main/Tools/bar.txt#17 edit

      at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:207)
      at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:71)
      at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:433)
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:924)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1226)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:586)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
      at hudson.model.Run.run(Run.java:1438)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:239)
      Caused by: java.util.NoSuchElementException
      at java.util.StringTokenizer.nextToken(Unknown Source)
      at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:136)
      ... 10 more
      ERROR: Unable to communicate with perforce. Failed to retrieve changelist.
      Response from perforce was:
      Change 51820 by me@my_workspace on 2012/09/05 04:31:37

      jenkins test

      Jobs fixed ...

      job000162 on 2012/08/25 by p4dtguser

      Test it thoroughly.

      Affected files ...

      ... //Main/Tools/bar.txt#17 edit

      ===== end =====

      Thanks.

        Attachments

          Activity

          Hide
          ajay_kanade Ajay Kanade added a comment -

          Adding details.hasMoreTokens() at line 136 may fix it - I have not checked it of course.

          Show
          ajay_kanade Ajay Kanade added a comment - Adding details.hasMoreTokens() at line 136 may fix it - I have not checked it of course.
          Hide
          rpetti Rob Petti added a comment -

          So, is there no longer an issue with reserved phrases (ie, "Jobs fixed ...")?

          Show
          rpetti Rob Petti added a comment - So, is there no longer an issue with reserved phrases (ie, "Jobs fixed ...")?
          Hide
          ajay_kanade Ajay Kanade added a comment -

          Rob,
          No. There is no issue with the reserved phrases. I see it handled in ChangelistBuilder.Build.
          Below is fixed by you (if that's your concern)
          https://issues.jenkins-ci.org/browse/JENKINS-7679

          Show
          ajay_kanade Ajay Kanade added a comment - Rob, No. There is no issue with the reserved phrases. I see it handled in ChangelistBuilder.Build. Below is fixed by you (if that's your concern) https://issues.jenkins-ci.org/browse/JENKINS-7679
          Hide
          rpetti Rob Petti added a comment -

          Ok, I was confused since the original description on this ticket described that problem, not this one. I'll take a look. From your description it sounds like a simple fix.

          Show
          rpetti Rob Petti added a comment - Ok, I was confused since the original description on this ticket described that problem, not this one. I'll take a look. From your description it sounds like a simple fix.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java
          http://jenkins-ci.org/commit/perforce-plugin/0e5b7c4d1d94e0c614873d66f9d3197e23ed9500
          Log:
          [FIXED JENKINS-15043] 'status' field in perforce job descriptions is now optional

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/com/tek42/perforce/parse/ChangelistBuilder.java http://jenkins-ci.org/commit/perforce-plugin/0e5b7c4d1d94e0c614873d66f9d3197e23ed9500 Log: [FIXED JENKINS-15043] 'status' field in perforce job descriptions is now optional
          Hide
          ajay_kanade Ajay Kanade added a comment -

          Oh - May be because I cloned & then modified the description.
          Thanks for the fast turn around.

          Show
          ajay_kanade Ajay Kanade added a comment - Oh - May be because I cloned & then modified the description. Thanks for the fast turn around.

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              ajay_kanade Ajay Kanade
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: