[ 
https://issues.jenkins-ci.org/browse/JENKINS-12599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158555#comment-158555
 ] 

Tom Jordan commented on JENKINS-12599:
--------------------------------------

The Netbeans CVS Client Library can handle :ext: protocol.
http://koders.com/java/fid00F4DB19E77C32A586555794A36AB065C70650A3.aspx#L57
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L131
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L80

However, a port specification is only valid for any protocol except for 
gserver, kserver or pserver.

[quote]
# cvs -d :ext:[email protected]:22/cvs co aProject
cvs checkout: CVSROOT port specification is only valid for gserver, kserver,
cvs checkout: and pserver connection methods.
cvs [checkout aborted]: Bad CVSROOT: `:ext:[email protected]:22/cvs'.
[/quote]

This is why the cvsclient lib doesn't use the port number for ExtConnection by 
returning 0.
http://koders.com/java/fid00F4DB19E77C32A586555794A36AB065C70650A3.aspx#L109

The CVSSCM file is setting the port to PServerConnection.DEFAULT_PORT if the 
port is 0.
https://github.com/jenkinsci/cvs-plugin/blob/master/src/main/java/hudson/scm/CVSSCM.java#L567

This forces the :ext: protocol to specify port 2401 which is incorrect.
http://koders.com/java/fid4CF355726BC066586D9EA513CFC6B4C74666BFBE.aspx#L128
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L129

The code should be something like this:

[code]
if (cvsRoot.getPort() => 0) {
    connectionProperties.setProperty("port", "" + cvsRoot.getPort());
} else if (cvsRoot.getMethod() == cvsRoot.METHOD_PSERVER) {
    connectionProperties.setProperty("port", "" + 
PServerConnection.DEFAULT_PORT);
} else {
    // Do nothing or throw.
}
[/code]

However, even this doesn't work because this logic is incorrect when the 
library parses a Properties object into a new CVSRoot instance.
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L160
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L192

Why not just pass the cvsroot directly to CVSRootl.parse as a string?
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L152

Which seems to do the right thing.
http://koders.com/java/fidFCF537AA5557065A72DA2B5B104B417A6159A281.aspx#L229
                
> IllegalArgumentException after Upgrade to 2.0
> ---------------------------------------------
>
>                 Key: JENKINS-12599
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-12599
>             Project: Jenkins
>          Issue Type: Bug
>          Components: cvs
>            Reporter: Ulli Hafner
>            Assignee: Michael Clarke
>            Priority: Blocker
>
> 12:00:14  Started by user hafner
> 12:00:14  Building on master
> 12:00:14  FATAL: Unrecognized CVS Root: 
> :ext:[email protected]:/projekte/cvs.com.f10.ips4fspm
> 12:00:14  java.lang.IllegalArgumentException: Unrecognized CVS Root: 
> :ext:[email protected]:/projekte/cvs.com.f10.ips4fspm
> 12:00:14      at 
> org.netbeans.lib.cvsclient.connection.ConnectionFactory.getConnection(ConnectionFactory.java:117)
> 12:00:14      at hudson.scm.CVSSCM.getCvsClient(CVSSCM.java:570)
> 12:00:14      at hudson.scm.CVSSCM.checkout(CVSSCM.java:702)
> 12:00:14      at 
> hudson.model.AbstractProject.checkout(AbstractProject.java:1193)
> 12:00:14      at 
> hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:555)
> 12:00:14      at 
> hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:443)
> 12:00:14      at hudson.model.Run.run(Run.java:1376)
> 12:00:14      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
> 12:00:14      at 
> hudson.model.ResourceController.execute(ResourceController.java:88)
> 12:00:14      at hudson.model.Executor.run(Executor.java:175)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to