Quantcast

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Affects Versions: current
Assignee: Rob Petti
Components: perforce
Created: 04/Sep/12 8:47 PM
Description:

The Hudson perforce plug-in is currently throwing exceptions for any changelists which contain "reserved" text in the changelist description. This appears to be introduced by the p4v client when creating changelist descriptions. Here is an example of a changelist which contains the problem (i.e. containing "Jobs fixed ..." in the changelist description):

===== begin output of "p4 describe -s 470718 =====
Change 470718 by someuser@someclient on 2010/10/01 15:32:59

Additional logic for org assoc validations at doc import time.

Jobs fixed ...

Jobs fixed ...

SDRLS98139 on 2010/10/01 by pdbugs closed
Affected files ...

... //depotxyz/fileabc#6 edit
====== end output of "p4 describe -s 470718 ======

In this case, the Hudson perforce plug-in fails and throws an exception:

18:16:46 [5.5_Continuous_Build] $ /usr/local/bin/p4 describe -s 470718
18:16:46 Caught exception communicating with perforce. Failed to retrieve changelist.com.tek42.perforce.PerforceException: Failed to retrieve changelist.
18:16:46 at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:185)
18:16:46 at com.tek42.perforce.parse.Changes.getChangelist(Changes.java:63)
18:16:46 at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java:381)
18:16:46 at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:552)
18:16:46 at hudson.model.AbstractProject.checkout(AbstractProject.java:1082)
18:16:46 at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
18:16:46 at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
18:16:46 at hudson.model.Run.run(Run.java:1273)
18:16:46 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
18:16:46 at hudson.model.ResourceController.execute(ResourceController.java:88)
18:16:46 at hudson.model.Executor.run(Executor.java:137)
18:16:46 Caused by: java.util.NoSuchElementException
18:16:46 at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
18:16:46 at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java:120)
18:16:46 ... 10 more

The problem exists because the StringTokenizer used inside the ChangelistBuilder class also considers tabs as a delimiter when parsing the output of the "p4 describe" command. This means that the parser is incapable of using the indenting provided by the "p4 describe" output to distinguish between keywords generated by the Perforce server and keyword text that is part of the changelist description.

Steps to reproduce:
1) Create a changelist which contains "Jobs fixed ..." within the changelist description
2) Create a Hudson job which syncs from Perforce (i.e. Poll SCM)

When the job attempts to obtain changelist information for the changelist which contains "Jobs fixed ..." in the changelist description, it will throw an exception and will fail to advance to the next changelist. This effectively causes the job to continually fail at the same point, unable to obtain information about subsequent changelists.

Environment: Perforce 2007.2
Project: Jenkins
Priority: Major Major
Reporter: Ajay Kanade
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org

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

Change By: Ajay Kanade (04/Sep/12 9:02 PM)
Environment: Perforce  2007  2010 .2
Description: Versions are:
Jenkins ver. 1.466.1
Perforce Plugin: 1.3.17

The  Hudson  perforce plug-in is currently throwing exceptions for any changelists which  contain  have jobs attached but *do not* have any  " reserved closed or fixed "  text in the changelist description  status associated .   This appears

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

// Line looks like:
// EXT-84 on 2007/09/25
 by  the p4v client when creating changelist descriptions  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
.   Here is an example of a changelist which contains the problem hasMoreTokens  ( i ) at line 136 *may* fix it - I have not checked it of course . e. containing "Jobs fixed ..." in

Exception thrown by
 the  changelist description)  plugin is :

===== begin
 output of "p4 describe -s 470718  =====
[xyz] $ p4 describe -s 51820
Caught exception communicating with perforce. Failed to retrieve changelist.
Response from perforce was:
Change  470718  51820  by  someuser  me @ someclient my_workspace  on  2010  2012 / 10 09 / 01 15 05 04 : 32 31 : 59 37

        Additional logic for org assoc validations at doc import time. jenkins test

        Jobs fixed ...

Jobs fixed ...

SDRLS98139
job000162  on  2010  2012 / 10 08 / 01 25  by  pdbugs *closed*  p4dtguser

Test it thoroughly. 

Affected files ...

... //
depotxyz Main / fileabc Tools/bar.txt # 6 17  edit
====== end output of "p4 describe -s 470718 ======
com.tek42.perforce.PerforceException: Failed to retrieve changelist.
In this case, the Hudson Response from  perforce  plug-in fails and throws an exception  was :

18
Change 51820 by me@my_workspace on 2012/09/05 04 : 16 31 : 46  [5 37

jenkins test

Jobs fixed
. 5_Continuous_Build] $ ..

job000162 on 2012
 / usr 08 / local/bin/p4 describe -s 470718 25 by p4dtguser
18:16:46  Caught exception communicating with perforce
Test it thoroughly
.  Failed to retrieve changelist  

Affected files
. com . tek42 . perforce

. PerforceException: Failed to retrieve changelist . . //Main/Tools/bar.txt#17 edit
18:16:46

   at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java: 185 207 )
18:16:46    at com.tek42.perforce.parse.Changes.getChangelist(Changes.java: 63 71 )
18:16:46    at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java: 381 433 )
18:16:46    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java: 552 924 )
18:16:46    at hudson.model.AbstractProject.checkout(AbstractProject.java: 1082 1226 )
18:16:46    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java: 479 586 )
18:16:46    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java: 411 475 )
18:16:46    at hudson.model.Run.run(Run.java: 1273 1438 )
18:16:46    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
18:16:46    at hudson.model.ResourceController.execute(ResourceController.java:88)
18:16:46    at hudson.model.Executor.run(Executor.java: 137 239 )
18:16:46   Caused by: java.util.NoSuchElementException
18:16:46    at java.util.StringTokenizer.nextToken( StringTokenizer.java:332 Unknown Source )
18:16:46    at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java: 120 136 )
18:16:46    ... 10 more

The problem exists because the StringTokenizer used inside the ChangelistBuilder class also considers tabs as a delimiter when parsing the output of the "p4 describe" command
ERROR: Unable to communicate with perforce .   This means that the parser is incapable of using the indenting provided by the "p4 describe" output  Failed  to  distinguish between keywords generated by the Perforce server and keyword text that is part of the  retrieve  changelist  description .
Response from perforce was:

Steps to reproduce
Change 51820 by me@my_workspace on 2012/09/05 04 : 31:37
1)  Create a changelist which contains "
jenkins test

Jobs fixed ... " within the changelist description
2)  Create a Hudson job which syncs from Perforce  (i
job000162 on 2012/08/25 by p4dtguser

Test it thoroughly
. e. Poll SCM)

When the job attempts to obtain changelist information for the changelist which contains "Jobs fixed Affected files  ... " in the changelist description, it will throw an exception and will fail to advance to the next changelist

.   This effectively causes the job to continually fail at the same point, unable to obtain information about subsequent changelists . . //Main/Tools/bar.txt#17 edit

===== end =====

Thanks.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Rob Petti commented on Bug JENKINS-15043

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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Ajay Kanade commented on Bug JENKINS-15043

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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Rob Petti commented on Bug JENKINS-15043

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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Change By: SCM/JIRA link daemon (05/Sep/12 2:09 PM)
Status: Open Resolved
Resolution: Fixed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15043) Changelist parsing fails when description contains jobs without fix status

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Ajay Kanade commented on Bug JENKINS-15043

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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Loading...