Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66147

Usage of parameters as branches in View mappings of Perforce plugin does not work for P4 polling

    XMLWordPrintable

Details

    Description

      If branch is defined as parameter, e.g.

      TC_BRANCH=//depot/path1

      and then that parameter is used in p4 view mappings, e.g. 

      ${TC_Branch}/... //myworkspace/...

      the p4 polling functionality fails with following error:

      Error in client specification.

      Mapping '/...' is not under '//USER/...'.

       

      P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.

      Mapping '/...' is not under '//USER/...'.

       

                     at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleErrorStr(ResultMapParser.java:151)

                     at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString(ResultMapParser.java:102)

                     at com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator.updateClient(ClientDelegator.java:212)

                     at com.perforce.p4java.impl.mapbased.server.Server.updateClient(Server.java:1522)

                     at com.perforce.p4java.impl.mapbased.client.Client.update(Client.java:516)

                     at org.jenkinsci.plugins.p4.client.ClientHelper.updateClient(ClientHelper.java:181)

                     at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:160)

                     at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:100)

                     at org.jenkinsci.plugins.p4.tasks.AbstractTask.tryTask(AbstractTask.java:166)

                     at org.jenkinsci.plugins.p4.tasks.PollTask.invoke(PollTask.java:50)

                     at org.jenkinsci.plugins.p4.tasks.PollTask.invoke(PollTask.java:33)

                     at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2760)

                     at hudson.remoting.UserRequest.perform(UserRequest.java:181)

                     at hudson.remoting.UserRequest.perform(UserRequest.java:52)

                     at hudson.remoting.Request$2.run(Request.java:336)

                     at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)

                     at java.util.concurrent.FutureTask.run(FutureTask.java:266)

                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

                     at hudson.remoting.Engine$1$1.run(Engine.java:98)

                     at java.lang.Thread.run(Thread.java:748)

       

      ERROR: P4: Task Exception: Error in client specification.

      Mapping '/...' is not under '//USER/...'.

       

      Finished: FAILURE

       

      This funcionality is working fine with old Perforce plugin.

      We are using the branches as parameters as we reference this parameter in multiple places within the job, e.g. pass it to another job or use it in jelly.script for branches to be displayed in email

       

      Attachments

        Activity

          p4karl Karl Wirth added a comment -

          For Dev - Have confirmed this behavior with Sylwia.

          Current polling must have a defined branch otherwsie it doesnt know what to poll for. Cannot figure out how the deprecated plugin knows what to poll for? Possibly it has the equivalent of syncID for every paramater that has ever been specified?

          Multibranch is the solution is you want everything under atree to be polled for but that requires coding and mass changes of all jobs.

          Reproduction Steps:

          • Add files to //depot/path1/... in Perforce.
          • Create a Freestyle job with variable TC_BRANCH. Set default to be '//depot/path1'.
          • Workspace should be type manual and contain 'View Mapping' set to '${TC_BRANCH}/... //${P4_CLIENT}/...
          • Set job to be polled (Poll SCM).
          • Run job manually.
          • Submit an update to a file under //depot/path1/... in Perforce.
          • Run 'Poll Now' (if you have that plugin) or wait till next polling interval.
          • See error:

           

          P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
          Mapping '/...' is not under '//depot/...'.
          

           

           

          p4karl Karl Wirth added a comment - For Dev - Have confirmed this behavior with Sylwia. Current polling must have a defined branch otherwsie it doesnt know what to poll for. Cannot figure out how the deprecated plugin knows what to poll for? Possibly it has the equivalent of syncID for every paramater that has ever been specified? Multibranch is the solution is you want everything under atree to be polled for but that requires coding and mass changes of all jobs. Reproduction Steps: Add files to //depot/path1/... in Perforce. Create a Freestyle job with variable TC_BRANCH. Set default to be '//depot/path1'. Workspace should be type manual and contain 'View Mapping' set to '${TC_BRANCH}/... //${P4_CLIENT}/... Set job to be polled (Poll SCM). Run job manually. Submit an update to a file under //depot/path1/... in Perforce. Run 'Poll Now' (if you have that plugin) or wait till next polling interval. See error:   P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Mapping '/...' is not under ' //depot/...' .    

          p4karl The deprecated Perforce plugin is polling for all changes since last build CLs in all the branches defined in View Mapping. If it finds parameter in left part of view mappings , it substitutes that parameter with parameter value which in this case is always branch.

          skl Sylwia Kludacz added a comment - p4karl The deprecated Perforce plugin is polling for all changes since last build CLs in all the branches defined in View Mapping. If it finds parameter in left part of view mappings , it substitutes that parameter with parameter value which in this case is always branch.

          People

            Unassigned Unassigned
            skl Sylwia Kludacz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: