[JIRA] (JENKINS-58109) Perforce ditto mappings from clientspec do not work

35 views
Skip to first unread message

swatichilka@gmail.com (JIRA)

unread,
Jun 19, 2019, 11:19:02 PM6/19/19
to jenkinsc...@googlegroups.com
sc1234 c created an issue
 
Jenkins / Bug JENKINS-58109
Perforce ditto mappings from clientspec do not work
Issue Type: Bug Bug
Assignee: Unassigned
Components: p4-plugin
Created: 2019-06-20 03:18
Environment: Jenkins version 2.158
P4-Plugin version 1.9.5
Jenkins master server running on a centOS 7.3 VM. Jenkins slave launched through jenkins console. Slaves are also centos 7.3 VMs.
Priority: Minor Minor
Reporter: sc1234 c

Hi

 

I use p4 plugin in my free style jenkins jobs to sync down source from our perforce server with a clientspec. We use perforce  [ditto mappings |https://www.perforce.com/manuals/p4guide/Content/P4Guide/configuration.workspace_view.one-to-many.html]  in our clientspec to map few files from one to many locations. While this works on our own machines with the p4 client, it fails on our jenkins job with warning like below.

 

Warning: Client Spec line invalid, ignoring. (&//depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml)

 

My clientspec view file has lines like 

+/depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml
&/depot/mysource/a.xml //sc1234-ws/mysource/v2/a.xml

+/depot/mysource/b.xml //sc1234-ws/mysource/v1/b.xml
&/depot/mysource/b.xml //sc1234-ws/mysource/v2/b.xml

 

Are ditto mapping supported by this p4-plugin? And if yes, is this a bug? Please help.

 

Thanks

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

swatichilka@gmail.com (JIRA)

unread,
Jun 19, 2019, 11:20:02 PM6/19/19
to jenkinsc...@googlegroups.com
sc1234 c updated an issue
Change By: sc1234 c
Hi

 

I use p4 plugin in my free style jenkins jobs to sync down source from our perforce server with a clientspec. We use perforce
  [ditto mappings   |[https://www.perforce.com/manuals/p4guide/Content/P4Guide/configuration.workspace_view.one-to-many.html]]  in our clientspec to map few files from one to many locations. While this works on our own machines with the p4 client, it fails on our jenkins job with warning like below.

 

Warning: Client Spec line invalid, ignoring. (&//depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml)

 

My clientspec view file has lines like 

+/depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml
&/depot/mysource/a.xml //sc1234-ws/mysource/v2/a.xml

+/depot/mysource/b.xml //sc1234-ws/mysource/v1/b.xml
&/depot/mysource/b.xml //sc1234-ws/mysource/v2/b.xml

 

Are ditto mapping supported by this p4-plugin? And if yes, is this a bug? Please help.

 

Thanks
Add Comment Add Comment
 

swatichilka@gmail.com (JIRA)

unread,
Jun 19, 2019, 11:43:02 PM6/19/19
to jenkinsc...@googlegroups.com
sc1234 c updated an issue
Hi

 

I use p4 plugin in my free style jenkins jobs to sync down source from our perforce server with a
clientspec spec file located in depot . We use perforce [ditto mappings|[https://www.perforce.com/manuals/p4guide/Content/P4Guide/configuration.workspace_view.one-to-many.html]]  in our clientspec to map few files from one to many locations. While this works on our own machines with the p4 client, it fails on our jenkins job with warning like below.


 

Warning: Client Spec line invalid, ignoring. (&//depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml)

 

My clientspec view file has lines like 

+/depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml
&/depot/mysource/a.xml //sc1234-ws/mysource/v2/a.xml

+/depot/mysource/b.xml //sc1234-ws/mysource/v1/b.xml
&/depot/mysource/b.xml //sc1234-ws/mysource/v2/b.xml

 

Are ditto mapping supported by this p4-plugin? And if yes, is this a bug? Please help.

 

Thanks

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 3:40:02 AM6/20/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-58109
 
Re: Perforce ditto mappings from clientspec do not work

Hi sc1234 c - Thanks for highlighting this. I have never tried ditto mappings with P4Jenkins so will test and let you know what I find.

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 3:40:03 AM6/20/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 4:02:03 AM6/20/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 4:02:03 AM6/20/19
to jenkinsc...@googlegroups.com
 
Re: Perforce ditto mappings from clientspec do not work

Hi sc1234 c, Thanks again. I get a slightly different error but confirm that ditto mappings do not work so I will pass this to the developers. The workaround would be a build step that manually copies the files to the other locations in the workspace.

 

Reproduction Steps:

(1) Add '//depot/f1' to Perforce server.

(2) Create a workspace with the following view and sync using P4 to prove it is valid:

View:
	//depot/f1 //ws_ditto/f1
	&//depot/f1 //ws_ditto/f1_ditto

(3) Create a Jenkins freestyle job with the following mapping:

//depot/f1 //${P4_CLIENT}/f1
&//depot/f1 //${P4_CLIENT}/f1_ditto

(4) Build the job and the following error is seen:

Console Output

Started by user unknown or anonymous
[EnvInject] - Loading node environment variables.
Building on master in workspace /var/lib/jenkins/workspace/JENKINS-58109 Ditto Mappings Freestyle
... p4 client -o jenkins-master-JENKINS-58109_Ditto_Mappings_Freestyle-7 +
... p4 info +
... p4 info +
... p4 client -o jenkins-master-JENKINS-58109_Ditto_Mappings_Freestyle-7 +
... p4 client -i +

P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
Error detected at line 17.
Null directory (//) not allowed in '&//depot/f1'.

	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleErrorStr(ResultMapParser.java:145)
	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString(ResultMapParser.java:96)
	at com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator.updateClient(ClientDelegator.java:195)
	at com.perforce.p4java.impl.mapbased.server.Server.updateClient(Server.java:1506)
	at com.perforce.p4java.impl.mapbased.client.Client.update(Client.java:516)
	at org.jenkinsci.plugins.p4.client.ClientHelper.updateClient(ClientHelper.java:180)
	at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:159)
	at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:101)
	at org.jenkinsci.plugins.p4.tasks.CheckoutTask.initialise(CheckoutTask.java:61)
	at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:522)
	at hudson.scm.SCM.checkout(SCM.java:504)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
	at hudson.model.Run.execute(Run.java:1815)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

ERROR: P4: Unable to initialise CheckoutTask: hudson.AbortException: Error in client specification.
Error detected at line 17.
Null directory (//) not allowed in '&//depot/f1'.

Finished: FAILURE

#

 

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 4:02:04 AM6/20/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Unassigned
 
Change By: Karl Wirth
Assignee: Karl Wirth

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 5:30:02 AM6/20/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Comment: Additional comment:

"cleanup" without a paramater is not valid. Therefore if it is not used the 'cleanup' function must be fixed to not take true/false.

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 5:30:02 AM6/20/19
to jenkinsc...@googlegroups.com

Additional comment:

"cleanup" without a paramater is not valid. Therefore if it is not used the 'cleanup' function must be fixed to not take true/false.

Add Comment Add Comment
 

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 8:19:03 AM6/20/19
to jenkinsc...@googlegroups.com

jdavis@ipswitch.com (JIRA)

unread,
Jun 20, 2019, 8:32:03 AM6/20/19
to jenkinsc...@googlegroups.com
Jason Davis commented on Bug JENKINS-58109
 
Re: Perforce ditto mappings from clientspec do not work

FWIW - I have a ditto path that I use in a script block in a declarative pipeline.  It looks like this:

script {
    PerforceViewMap = """//Path1/... //jenkins-${JOB_BASE_NAME}-${NODE_NAME}/Path1/...
        //DittoPath1/... //jenkins-${JOB_BASE_NAME}-${NODE_NAME}/Path1/DittoPathA/...
        //Path2/... //jenkins-${JOB_BASE_NAME}-${NODE_NAME}/Path2/...
        &//DittoPath1/... //jenkins-${JOB_BASE_NAME}-${NODE_NAME}/Path2/DittoPathB/...
        //Path3/... //jenkins-${JOB_BASE_NAME}-${NODE_NAME}/Path3/..."""
                        
    PerforceSource = perforce(browser: swarm('http://swarm.myserver.com'), 
    credential: 'creds', 
    populate: forceClean(have: true, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], 
        pin: '', quiet: true), 
    workspace: manualSpec(charset: 'none', 
    name: 'jenkins-${JOB_BASE_NAME}-${NODE_NAME}', pinHost: false, 
        spec: clientSpec(allwrite: true, backup: false, clobber: true, compress: false, 
            line: 'LOCAL', locked: false, modtime: false, rmdir: true, serverID: '', streamName: '', type: 'WRITABLE', 
        view: PerforceViewMap)))    
}
                    
checkout scm: PerforceSource

pallen@perforce.com (JIRA)

unread,
Jun 20, 2019, 9:45:03 AM6/20/19
to jenkinsc...@googlegroups.com

swatichilka@gmail.com (JIRA)

unread,
Jun 20, 2019, 11:52:02 AM6/20/19
to jenkinsc...@googlegroups.com
sc1234 c commented on Bug JENKINS-58109
 
Re: Perforce ditto mappings from clientspec do not work

Thanks Karl Wirth and Jason Davis . I've applied the workaround for now. Thanks! 

 

Karl Wirth You're right about the error. We have both old and new perforce plugins on our jenkins and some jobs are still using the old plugin, hence the different error.  I will update the description here to make that correction.

 

In any case, a low-priority bug in p4-plugin still exists and will be good to fix. Thanks again for checking.

swatichilka@gmail.com (JIRA)

unread,
Jun 20, 2019, 11:54:03 AM6/20/19
to jenkinsc...@googlegroups.com
sc1234 c updated an issue
 
Change By: sc1234 c
Hi

 

Please refer to [~p4karl] comment below for exact repro steps and error message. Error message pasted by me few lines below is incorrect.

 

----------------

I use p4 plugin in my free style jenkins jobs to sync down source from our perforce server with a spec file located in depot. We use perforce [ditto mappings|[https://www.perforce.com/manuals/p4guide/Content/P4Guide/configuration.workspace_view.one-to-many.html]]  in our clientspec to map few files from one to many locations. While this works on our own machines with the p4 client, it fails on our jenkins job with warning like below.


 

Warning: Client Spec line invalid, ignoring. (&//depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml)

 

My clientspec view file has lines like 

+/depot/mysource/a.xml //sc1234-ws/mysource/v1/a.xml
&/depot/mysource/a.xml //sc1234-ws/mysource/v2/a.xml

+/depot/mysource/b.xml //sc1234-ws/mysource/v1/b.xml
&/depot/mysource/b.xml //sc1234-ws/mysource/v2/b.xml

 

Are ditto mapping supported by this p4-plugin? And if yes, is this a bug? Please help.

 

Thanks

swatichilka@gmail.com (JIRA)

unread,
Jun 20, 2019, 11:54:03 AM6/20/19
to jenkinsc...@googlegroups.com
sc1234 c edited a comment on Bug JENKINS-58109
 
Re: Perforce ditto mappings from clientspec do not work
Thanks [~p4karl] and [~jedavis] . I' ve applied ll be applying the workaround for now. Thanks! 

 

[~p4karl] You're right about the error. We have both old and new perforce plugins on our jenkins and some jobs are still using the old plugin, hence the different error.  I will update the description here to make that correction.


 

In any case, a low-priority bug in p4-plugin still exists and will be good to fix. Thanks again for checking.

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 12:10:20 PM6/20/19
to jenkinsc...@googlegroups.com

Hi sc1234 c. Thanks and happy we can help. I will pass this onto the developers.

pallen@perforce.com (JIRA)

unread,
Jul 15, 2019, 6:24:02 AM7/15/19
to jenkinsc...@googlegroups.com
Paul Allen closed an issue as Fixed
 

Released in 1.10.1

Change By: Paul Allen
Status: Open Closed
Assignee: Paul Allen
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages