TFS SCM blame plugin does not support spaces in user name field

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TFS SCM blame plugin does not support spaces in user name field

jabbera

Hello,

 

I’m running the latest 2.0 snapshot of the TFS plugin with sonarqube 5.1 and TFS 2013.

 

There appears to be an issue where the parser of the SonarTfsAnnotate output won’t support spaces in the username of a checkin field. (This is supported by TFS)

 

Running sonar-runner with TFS SCM enabled results in the following abbreviated exception:

 

Caused by: java.lang.NumberFormatException: For input string: "Build"

        at java.lang.NumberFormatException.forInputString(Unknown Source)

        at java.lang.Long.parseLong(Unknown Source)

        at org.sonar.plugins.scm.tfs.TfsBlameCommand.blame(TfsBlameCommand.java:116)

        at org.sonar.batch.scm.ScmSensor.execute(ScmSensor.java:84)

        at org.sonar.batch.scan.SensorWrapper.analyse(SensorWrapper.java:59)

 

As you can see it’s trying to turn the word Build into a number.

 

Here is the tail of the TFS blame for the file it’s having issues with:

 

210210 [hidden email] 1320321472733 // by using the '*' as shown below:

281840 Versioning Build Process 1383062082897 [assembly: AssemblyVersion("1.1.0.0")]

348400 BBB 1431338438423 [assembly: AssemblyFileVersion("2.0.15131.1")]

 

As you can see the username for the second line is “Versioning Build Process”

 

Please consider using a different delimiter instead of spaces in these locations.

 

https://github.com/SonarCommunity/sonar-tfs/blob/485b71b135ccd703218038babe6240513ea3984d/sonar-scm-tfs-plugin/src/main/java/org/sonar/plugins/scm/tfs/TfsBlameCommand.java#L49

https://github.com/SonarCommunity/sonar-tfs/blob/eccae65df3be16d42ad099695db03971d063e5f1/SonarTfsAnnotate/Program.cs#L131

 

Thanks,

Mike

 

 

Reply | Threaded
Open this post in threaded view
|

Re: TFS SCM blame plugin does not support spaces in user name field

Dinesh Bolkensteyn-2
Thank you Mike

I will try to reproduce the issue today, and follow up on your pull request: https://github.com/SonarCommunity/sonar-tfs/pull/3


On Wed, May 13, 2015 at 7:55 PM, Michael Barry <[hidden email]> wrote:

Hello,

 

I’m running the latest 2.0 snapshot of the TFS plugin with sonarqube 5.1 and TFS 2013.

 

There appears to be an issue where the parser of the SonarTfsAnnotate output won’t support spaces in the username of a checkin field. (This is supported by TFS)

 

Running sonar-runner with TFS SCM enabled results in the following abbreviated exception:

 

Caused by: java.lang.NumberFormatException: For input string: "Build"

        at java.lang.NumberFormatException.forInputString(Unknown Source)

        at java.lang.Long.parseLong(Unknown Source)

        at org.sonar.plugins.scm.tfs.TfsBlameCommand.blame(TfsBlameCommand.java:116)

        at org.sonar.batch.scm.ScmSensor.execute(ScmSensor.java:84)

        at org.sonar.batch.scan.SensorWrapper.analyse(SensorWrapper.java:59)

 

As you can see it’s trying to turn the word Build into a number.

 

Here is the tail of the TFS blame for the file it’s having issues with:

 

210210 [hidden email] 1320321472733 // by using the '*' as shown below:

281840 Versioning Build Process 1383062082897 [assembly: AssemblyVersion("1.1.0.0")]

348400 BBB 1431338438423 [assembly: AssemblyFileVersion("2.0.15131.1")]

 

As you can see the username for the second line is “Versioning Build Process”

 

Please consider using a different delimiter instead of spaces in these locations.

 

https://github.com/SonarCommunity/sonar-tfs/blob/485b71b135ccd703218038babe6240513ea3984d/sonar-scm-tfs-plugin/src/main/java/org/sonar/plugins/scm/tfs/TfsBlameCommand.java#L49

https://github.com/SonarCommunity/sonar-tfs/blob/eccae65df3be16d42ad099695db03971d063e5f1/SonarTfsAnnotate/Program.cs#L131

 

Thanks,

Mike