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

Workspaces created via Templates don't use template's client type

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • Jenkins: 2.89.1
      p4-plugin: 1.8.3

      I'm having an issue where workspaces that are created during a pipeline sync based upon a template are not using that template's defined client type. The newly created workspace always defaults to Writeable. (See the attached images).

      I'm not sure if this is intentional behaviour as I couldn't find anywhere in the plugin docs that state otherwise.

      Let me know if you need any more information,

      Thanks!

          [JENKINS-48471] Workspaces created via Templates don't use template's client type

          Dave Knight added a comment -

          I've found the same issue, which is still present in 1.13.0.

          Given that the recommended type of workspace to use for continuous integration with Perforce is "partitioned" or "readonly", it's a shame that templates always produce "writeable" workspaces.

          Reading https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_client.html#Working_with_read-only_clients, automated builds should use "readonly" workspaces to avoid fragmenting and bloating the server's "db.have" file. The same is true of "partitioned" workspaces.

          Dave Knight added a comment - I've found the same issue, which is still present in 1.13.0. Given that the recommended type of workspace to use for continuous integration with Perforce is "partitioned" or "readonly", it's a shame that templates always produce "writeable" workspaces. Reading https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_client.html#Working_with_read-only_clients , automated builds should use "readonly" workspaces to avoid fragmenting and bloating the server's "db.have" file. The same is true of "partitioned" workspaces.

          Karl Wirth added a comment -

          Reproduction steps:

          (1) Create a client that has type partitioned. For example:

          Client:	part_template
          Update:	2024/12/20 16:45:04
          Access:	2024/12/20 16:45:04
          Owner:	super
          Host:	MyPC
          Description:	Created by super.
          Root:	/filestoreSSD/Vagrant/Swarm/CURRENT/ws
          Options:	noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync
          SubmitOptions:	submitunchanged
          LineEnd:	local
          Type:	partitioned
          View:	//depot/karl/... //part_template/...
           

          (2) Create a freestyle job in jenkins that uses this client as a template:

          (3) Run the job. The client created is not Type 'partitioned':

          Client:	jenkins-built-in-Freestyle_Partitioned_Template-7
          Update:	2024/12/20 16:46:24
          Access:	2024/12/20 16:46:23
          Owner:	super
          Root:	/var/lib/jenkins/workspace/Freestyle_Partitioned_Template
          Options:	noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync
          SubmitOptions:	submitunchanged
          LineEnd:	local
          View:	//depot/karl/... //jenkins-built-in-Freestyle_Partitioned_Template-7/...
           

           

          Karl Wirth added a comment - Reproduction steps: (1) Create a client that has type partitioned. For example: Client: part_template Update: 2024/12/20 16:45:04 Access: 2024/12/20 16:45:04 Owner: super Host: MyPC Description: Created by super . Root: /filestoreSSD/Vagrant/Swarm/CURRENT/ws Options: noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync SubmitOptions: submitunchanged LineEnd: local Type: partitioned View: //depot/karl/... //part_template/... (2) Create a freestyle job in jenkins that uses this client as a template: (3) Run the job. The client created is not Type 'partitioned': Client: jenkins-built-in-Freestyle_Partitioned_Template-7 Update: 2024/12/20 16:46:24 Access: 2024/12/20 16:46:23 Owner: super Root: / var /lib/jenkins/workspace/Freestyle_Partitioned_Template Options: noallwrite noclobber nocompress unlocked nomodtime normdir noaltsync SubmitOptions: submitunchanged LineEnd: local View: //depot/karl/... //jenkins-built-in-Freestyle_Partitioned_Template-7/...  

          I've run into this issue as well, now that we are using a p4d that supports readonly/partitioned client.
          I use the groovy pipline jenkins syntax anda the p4 templates and notice the same problem, when the jenkins p4 plugin is using 'template' mode, it does not keep the Type: partitioned to match.
          An alternative to propogating the template type, would be to add the Type: field into the plugin syntax for using the template. It does exist for the 'Manual' workspace in the plugin.

          In order to make use of the reduction of backup overhead due to our 'ephemeral clients' I am likely going to have to build my own p4 command line library to properly use my p4 template and propogate the -T partitioned (or readonly) values through making it not useful to even have the p4 plugin installed on my jenkins instance.

          Heather Mardis added a comment - I've run into this issue as well, now that we are using a p4d that supports readonly/partitioned client. I use the groovy pipline jenkins syntax anda the p4 templates and notice the same problem, when the jenkins p4 plugin is using 'template' mode, it does not keep the Type: partitioned to match. An alternative to propogating the template type, would be to add the Type: field into the plugin syntax for using the template. It does exist for the 'Manual' workspace in the plugin. In order to make use of the reduction of backup overhead due to our 'ephemeral clients' I am likely going to have to build my own p4 command line library to properly use my p4 template and propogate the -T partitioned (or readonly) values through making it not useful to even have the p4 plugin installed on my jenkins instance.

            Unassigned Unassigned
            jknobel Jack Knobel
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: