atom feed11 messages in org.codehaus.sonar.userRE: [sonar-user] SCM activity for TFS
FromSent OnAttachments
Figler, JoshJul 8, 2011 10:36 am 
Evgeny MandrikovJul 10, 2011 5:07 am 
Figler, JoshJul 11, 2011 5:31 am 
Evgeny MandrikovJul 11, 2011 7:51 am 
Figler, JoshJul 11, 2011 8:07 am 
Evgeny MandrikovJul 25, 2011 2:01 pm 
Figler, JoshJul 26, 2011 5:09 am 
Figler, JoshJul 26, 2011 5:26 am 
Figler, JoshAug 24, 2011 9:50 am 
Evgeny MandrikovAug 25, 2011 2:10 am 
Figler, JoshAug 25, 2011 3:56 am 
Subject:RE: [sonar-user] SCM activity for TFS
From:Figler, Josh (jfig@paychex.com)
Date:Jul 26, 2011 5:26:55 am
List:org.codehaus.sonar.user

I almost forgot -- the 1st time I did this, it didn't throw an exception....
but I don't think it really did anything either because there was no scm info
via the Sonar UI as described on the plug-in page... To explain further, when
viewing source, there wasn't anything in the far left column with
usernames/dates or anything like that. Here is a snippet from the output from
that job.

07:47:23 [INFO] Sensor ScmActivitySensor... 07:47:23 [INFO] Check for local modifications... 07:47:23 [INFO] Check for local modifications done: 0 ms 07:47:23 [INFO] scmUrl -
http://MyRepository:8080:Hudson-HRO_CustomTools_BuildPackager_Sonar-hapnv004:$/MyProjectPath/BuildPackager 07:47:23 [INFO] Scheme - http 07:47:23 [INFO] Retrieve changelog... 07:47:23 [INFO] It can be long this first time. Next analysis will be faster. 07:47:23 [INFO] Command line - cmd.exe /X /C "tf history
-format:detailed ." 07:47:23 [INFO] err - 07:47:23 [INFO] Retrieve changelog done: 390 ms 07:47:23 [INFO] Retrieve files SCM info... 07:47:23 [INFO] Retrieve files SCM info done: 0 ms 07:47:23 [INFO] Sensor ScmActivitySensor done: 400 ms

________________________________ From: Figler, Josh Sent: Tuesday, July 26, 2011 8:10 AM To: us@sonar.codehaus.org Subject: RE: [sonar-user] SCM activity for TFS

Definitely some progress -- the URL now works!

However, now it seems to be failing when retrieving changelogs (see below).

Thanks for the assistance!

Josh

.

.

.

08:00:55 [INFO] Sensor org.sonar.plugins.csharp.gallio.GallioSensor@bc917c
done: 7955 ms 08:00:55 [INFO] Sensor ScmActivitySensor... 08:00:55 [INFO] Check for local modifications... 08:00:55 [DEBUG] Check directory:
N:\hudson\workspace\HRO_CustomTools_BuildPackager_Sonar\BuildPackager 08:00:55 [INFO] scmUrl -
http://MyRepository:8080:Hudson-HRO_CustomTools_BuildPackager_Sonar-hapnv004:$/MyProjectPath/BuildPackager 08:00:55 [INFO] Scheme - http 08:00:55 [INFO] Command line - cmd.exe /X /C "tf status
-workspace:Hudson-HRO_CustomTools_BuildPackager_Sonar-hapnv004 -recursive
-format:detailed $/MyProjectPath/BuildPackager" 08:00:56 [DEBUG] line -There are no pending changes. 08:00:56 [INFO] err - 08:00:56 [DEBUG] Iterating 08:00:56 [INFO] Check for local modifications done: 192 ms 08:00:56 [INFO] Retrieve changelog from revision 44366... 08:00:56 [INFO] Retrieve changelog from revision 44366 done: 2 ms 08:00:56 [DEBUG] JDBC Driver [Proxy: EBA 1.2.6] deregistered 08:00:56 [DEBUG] To prevent a memory leak, the JDBC Driver
[net.sourceforge.jtds.jdbc.Driver] has been forcibly deregistered 08:00:56 [DEBUG] Delete temporary directories 08:00:56 [DEBUG] Delete temporary directory:
C:\Users\_HPOC_~1\AppData\Local\Temp\sonar-batch3917927334430589371966117678233965 08:00:56 [DEBUG] Delete temporary directory:
C:\Users\_HPOC_~1\AppData\Local\Temp\sonar-batch9151095754361483155966304276053241 08:00:56 [INFO]
------------------------------------------------------------------------ 08:00:56 [ERROR] BUILD ERROR 08:00:56 [INFO]
------------------------------------------------------------------------ 08:00:56 [INFO] Can not execute Sonar 08:00:56 08:00:56 Embedded error: Fail to retrieve changelog from revision 44366 08:00:56 Unsupported method for this provider. 08:00:56 [INFO]
------------------------------------------------------------------------ 08:00:56 [DEBUG] Trace 08:00:56 org.apache.maven.lifecycle.LifecycleExecutionException: Can not
execute Sonar 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) 08:00:56 at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) 08:00:56 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) 08:00:56 at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 08:00:56 at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 08:00:56 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 08:00:56 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 08:00:56 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 08:00:56 at java.lang.reflect.Method.invoke(Method.java:597) 08:00:56 at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) 08:00:56 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) 08:00:56 at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) 08:00:56 at org.codehaus.classworlds.Launcher.main(Launcher.java:375) 08:00:56 Caused by: org.apache.maven.plugin.MojoExecutionException: Can not
execute Sonar 08:00:56 at
org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103) 08:00:56 at
org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79) 08:00:56 at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88) 08:00:56 at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) 08:00:56 at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) 08:00:56 ... 17 more 08:00:56 Caused by: org.sonar.api.utils.SonarException: Fail to retrieve
changelog from revision 44366 08:00:56 at
org.sonar.plugins.scmactivity.Changelog.retrieveChangeSets(Changelog.java:122) 08:00:56 at
org.sonar.plugins.scmactivity.Changelog.load(Changelog.java:60) 08:00:56 at
org.sonar.plugins.scmactivity.ScmActivitySensor.analyse(ScmActivitySensor.java:83) 08:00:56 at
org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:63) 08:00:56 at org.sonar.batch.phases.Phases.execute(Phases.java:93) 08:00:56 at
org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:145) 08:00:56 at org.sonar.batch.bootstrap.Module.start(Module.java:89) 08:00:56 at
org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:106) 08:00:56 at
org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:101) 08:00:56 at
org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:96) 08:00:56 at org.sonar.batch.bootstrap.Module.start(Module.java:89) 08:00:56 at
org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:96) 08:00:56 at org.sonar.batch.bootstrap.Module.start(Module.java:89) 08:00:56 at org.sonar.batch.Batch.execute(Batch.java:74) 08:00:56 at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:154) 08:00:56 at org.sonar.maven.SonarMojo.execute(SonarMojo.java:143) 08:00:56 at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) 08:00:56 at
org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98) 08:00:56 ... 21 more 08:00:56 Caused by: org.apache.maven.scm.ScmException: Exception while
executing SCM command. 08:00:56 at
org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:63) 08:00:56 at
org.apache.maven.scm.provider.tfs.TfsScmProvider.changelog(TfsScmProvider.java:142) 08:00:56 at
org.apache.maven.scm.provider.AbstractScmProvider.changeLog(AbstractScmProvider.java:311) 08:00:56 at
org.apache.maven.scm.provider.AbstractScmProvider.changeLog(AbstractScmProvider.java:293) 08:00:56 at
org.apache.maven.scm.manager.AbstractScmManager.changeLog(AbstractScmManager.java:362) 08:00:56 at
org.sonar.plugins.scmactivity.Changelog.retrieveChangeSets(Changelog.java:107) 08:00:56 ... 38 more 08:00:56 Caused by: org.apache.maven.scm.ScmException: Unsupported method for
this provider. 08:00:56 at
org.apache.maven.scm.command.changelog.AbstractChangeLogCommand.executeChangeLogCommand(AbstractChangeLogCommand.java:53) 08:00:56 at
org.apache.maven.scm.command.changelog.AbstractChangeLogCommand.executeCommand(AbstractChangeLogCommand.java:77) 08:00:56 at
org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59) 08:00:56 ... 43 more 08:00:56 [INFO]
------------------------------------------------------------------------ 08:00:56 [INFO] Total time: 22 seconds 08:00:56 [INFO] Finished at: Tue Jul 26 08:00:56 EDT 2011

08:00:56 [INFO] Final Memory: 19M/50M 08:00:56 [INFO]
------------------------------------------------------------------------ 08:00:56 Finished: FAILURE

________________________________ From: Evgeny Mandrikov [mailto:mand@gmail.com] Sent: Monday, July 25, 2011 5:02 PM To: us@sonar.codehaus.org Subject: Re: [sonar-user] SCM activity for TFS

Hi Josh,

Based on your emails I've created two issues : one on Sonar SCM Activity Plugin
side ( SONARPLUGINS-1291<http://jira.codehaus.org/browse/SONARPLUGINS-1291> )
and another one on Maven SCM side (
SCM-626<http://jira.codehaus.org/browse/SCM-626> ).

Also I want to believe that I successfully resolved this problem on our side
(some workaround was applied), but unfortunately I can't test it in a real-life
with TFS. So could you please try snapshot version of Sonar SCM Acitivty Plugin
with TFS :
sonar-scm-activity-plugin-1.4-SNAPSHOT.jar<http://snapshots.repository.codehaus.org/org/codehaus/sonar-plugins/scm-activity/sonar-scm-activity-plugin/1.4-SNAPSHOT/sonar-scm-activity-plugin-1.4-SNAPSHOT.jar>

Thanks in advance for feedback and testing.

On Mon, Jul 11, 2011 at 19:07, Figler, Josh
<jfig@paychex.com<mailto:jfig@paychex.com>> wrote: It indeed does. See command below. When I use this, it works.

N:\hudson\workspace\HRO_CustomTools_BuildPackager_Sonar>tf history
-format:detailed N:\hudson\workspace\HRO_CustomTools_BuildPackager_Sonar

I should mention that I've tried this as a URL too, which should work (but
doesn't) if the workspace option is intended to be the local workspace:
scm:tfs:http://MyRepository:8080:${WORKSPACE}:$/MyProjectPath/BuildPackager

And I know you are familiar with Hudson/Jenkins, but for anyone who is not and
is paying attention to this, the ${WORKSPACE} variable gets the absolute path of
the workspace.

Thanks,

Josh

________________________________ From: Evgeny Mandrikov [mailto:mand@gmail.com<mailto:mand@gmail.com>] Sent: Monday, July 11, 2011 10:52 AM

To: us@sonar.codehaus.org<mailto:us@sonar.codehaus.org> Subject: Re: [sonar-user] SCM activity for TFS

Could you please confirm that command "tf history" with absolute path to
directory will provide history for specified directory ? I.E. "tf history
N:\Hudson\workspace\HRO_CustomTools_BuildPackager_Sonar" will provide changelog
for project, which was checkouted to
"N:\Hudson\workspace\HRO_CustomTools_BuildPackager_Sonar". If so, then issue
comes from Maven SCM library and I'm going to create ticket in Jira for this.

On Mon, Jul 11, 2011 at 16:32, Figler, Josh
<jfig@paychex.com<mailto:jfig@paychex.com>> wrote: No, I don't use Maven to build my project, but I do use it as the runner for
Sonar analysis.

________________________________ From: Evgeny Mandrikov [mailto:mand@gmail.com<mailto:mand@gmail.com>] Sent: Sunday, July 10, 2011 8:08 AM To: us@sonar.codehaus.org<mailto:us@sonar.codehaus.org> Subject: Re: [sonar-user] SCM activity for TFS

Hi Josh,

As stated on page http://docs.codehaus.org/display/SONAR/SCM+Activity+Plugin
support for Team Foundation Server was implemented, but never really tested in
real environment as we don't have an TFS experts, thus we don't guarantee that
it works.

I believe that command "tf history" with absolute path to directory will provide
history for specified directory, so in fact underlying question - why command
contains just a directory name, but not a full path. Unfortunately I can't do
tests on my side, but most probably problem comes from library Maven
SCM<http://maven.apache.org/scm/>, which is used by Sonar SCM Activity Plugin.
So also question - do you use Maven to build your project ?

On Fri, Jul 8, 2011 at 21:37, Figler, Josh
<jfig@paychex.com<mailto:jfig@paychex.com>> wrote: I'm trying to use the SCM activity plug-in (version 1.3 with Sonar 2.7) for TFS,
and am having no luck.

My scm url is this --
scm:tfs:http://MyRepository:8080:Hudson-${JOB_NAME}-${NODE_NAME}:$/MyProjectPath/BuildPackager Breakdown or url:

* Repository url -- http://MyRepository:8080 * Workspace -- Hudson-${JOB_NAME}-${NODE_NAME} * Project path in TFS -- $/MyProjectPath/BuildPackager

The mapped location on the local machine is
N:\Hudson\workspace\HRO_CustomTools_BuildPackager_Sonar. The JOB_NAME is
HRO_CustomTools_BuildPackager and the NODE_NAME is hapnv004.

From within Hudson, this errors out, and I see why but I don't understand why it
would behave like this ;)

13:19:18 [INFO] Sensor ScmActivitySensor... 13:19:18 [INFO] Check for local modifications... 13:19:18 [INFO] Check for local modifications done: 0 ms 13:19:19 [INFO] scmUrl -
http://MyRepository:8080:Hudson-HRO_CustomTools_BuildPackager_Sonar-hapnv004:$/MyProjectPath/BuildPackager 13:19:19 [INFO] Scheme - http 13:19:19 [INFO] Retrieve changelog... 13:19:19 [INFO] It can be long this first time. Next analysis will be faster. 13:19:19 [INFO] Command line - cmd.exe /X /C "tf history
-format:detailed HRO_CustomTools_BuildPackager_Sonar" 13:19:19 [INFO] err - The item
$/MyProjectPath/BuildPackager/HRO_CustomTools_BuildPackager_Sonar does not exist
at the specified version. 13:19:19 13:19:19 [INFO] Retrieve changelog done: 280 ms

I believe the command should be "tf history -format:detailed
$/MyProjectPath/BuildPackager" but instead it is tossing the locally mapped
folder on the end of the project path, which obviously doesn't exist because
that's simply the mapped folder I've created to insert my checkout out source...

Just as an additional side note, if I make my scm url simply
scm:tfs:http://MyRepository:8080 I get the same result... It's able to figure
out the project path somehow...

Is there a way I can craft my url to fit my scenario? It would seem like there
is, but I'm having no luck...

Thanks!

Josh Figler Paychex, Inc. Enterprise Build Automation (585)216-2859