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

p4jenkins to be able to use folder properties

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin

      Per the customer's description and rational:

      Now my feature request: it would be helpful if as part of a pipeline job definition one could specify the "Stream" by using an environment variable - see
       
      p4jenkins_image1.png attached
      In this case it would be nice if I could use a folder property like:

       
      p4jenkins_image2.png attached
      Rational behind this: I have some tree of jobs which all relate to a project which is based on a single stream. It is error prone to have this stream name explicit in each job: a symbolic expression pointing some environment variable which is stored as a folder property is better.

          [JENKINS-75317] p4jenkins to be able to use folder properties

          Heiko Nardmann added a comment -

          This does not help in this case: it is not related to JENKINS-39107.

          Heiko Nardmann added a comment - This does not help in this case: it is not related to JENKINS-39107 .

          Dhaval added a comment - - edited

          heiko_nardmann Thanks for pointing it out. Whats the difference between 2 tickets requirements?

          Dhaval added a comment - - edited heiko_nardmann Thanks for pointing it out. Whats the difference between 2 tickets requirements?

          Heiko Nardmann added a comment -

          I'm not sure what you mean? The description and screenshots have been provided.

          Could you explain what is unclear here?

          Heiko Nardmann added a comment - I'm not sure what you mean? The description and screenshots have been provided. Could you explain what is unclear here?

          Jessie added a comment -

          Hi patdhaval30. For this request, I believe this deals more with extracting the Name value from Folder Properties list to be used as an environment variable, for example, the Stream field (when workspace behavior is set to Manual (custom view)). 

           

          Ticket https://issues.jenkins.io/browse/JENKINS-39107 deals more with the ability to get value of (at least) "Stream Codeline" to be used inside the customer's pipeline script. This is configured when the Workspace behavior is set to Streams.

           

          Jessie added a comment - Hi patdhaval30 . For this request, I believe this deals more with extracting the Name value from Folder Properties list to be used as an environment variable, for example, the Stream field (when workspace behavior is set to Manual (custom view)).    Ticket https://issues.jenkins.io/browse/JENKINS-39107 deals more with the ability to get value of (at least) "Stream Codeline" to be used inside the customer's pipeline script. This is configured when the Workspace behavior is set to Streams.  

          Dhaval added a comment -

          Dhaval added a comment - jessie_fernandez_perforce Thank you.

          Dhaval added a comment - - edited

          jessie_fernandez_perforce heiko_nardmann The expectation here is that, there are 2 plugins folder and folder properties. With these plugins we can create new item of type "Folder". Inside it we can create properties with a value that can be used in pipeline like "CI_STREAM".
          Currently problem is that these static properties cannot be read in pipeline where perforce is used used as SCM?
          So properties from "folder" item, should be enabled to be used when perforce is used as SCM?
          Is this expectation correct?

          Dhaval added a comment - - edited jessie_fernandez_perforce heiko_nardmann The expectation here is that, there are 2 plugins folder and folder properties. With these plugins we can create new item of type "Folder". Inside it we can create properties with a value that can be used in pipeline like "CI_STREAM". Currently problem is that these static properties cannot be read in pipeline where perforce is used used as SCM? So properties from "folder" item, should be enabled to be used when perforce is used as SCM? Is this expectation correct?

          Heiko Nardmann added a comment -

          Yes, this request makes only sense in the context of these plugins:

          1. https://plugins.jenkins.io/cloudbees-folder/
          2. https://plugins.jenkins.io/folder-properties/

          I assume that at least the first one - "cloudbees-folder" - should be available more or less everywhere.

          For the "folder-properties" plugin one needs to check whether the plugin is available. The user should be able to enable the usage of folder properties then anywhere within the SCM definition - sounds like some checkbox is needed within the SCM configuration for a pipeline job.

          The "folder-properties" documentation only states using this within a Freestyle job or within pipeline code - it is missing a way to use it when defining a pipeline job itself. Okay, maybe it might even be a better idea to ask that plugin author whether this should be integrated independent of a specific SCM plugin but make it more generally available within a pipeline definition.

          Heiko Nardmann added a comment - Yes, this request makes only sense in the context of these plugins: https://plugins.jenkins.io/cloudbees-folder/ https://plugins.jenkins.io/folder-properties/ I assume that at least the first one - "cloudbees-folder" - should be available more or less everywhere. For the "folder-properties" plugin one needs to check whether the plugin is available. The user should be able to enable the usage of folder properties then anywhere within the SCM definition - sounds like some checkbox is needed within the SCM configuration for a pipeline job. The "folder-properties" documentation only states using this within a Freestyle job or within pipeline code - it is missing a way to use it when defining a pipeline job itself. Okay, maybe it might even be a better idea to ask that plugin author whether this should be integrated independent of a specific SCM plugin but make it more generally available within a pipeline definition.

          Heiko Nardmann added a comment - - edited

          Created JENKINS-75368.

          Heiko Nardmann added a comment - - edited Created JENKINS-75368 .

          Dhaval added a comment - - edited

          heiko_nardmann Whats the expectation from p4 plugin?

          1) Should it be available for use in pipeline code in jenkinsfile?

          2) Should it be available in pipeline configure while constructing name of workspace etc?

          Dhaval added a comment - - edited heiko_nardmann Whats the expectation from p4 plugin? 1) Should it be available for use in pipeline code in jenkinsfile? 2) Should it be available in pipeline configure while constructing name of workspace etc?

          Heiko Nardmann added a comment -

          The "folder-properties" plugin already provides support for item 1.

          So P4 plugin needs to support item 2.

          Heiko Nardmann added a comment - The "folder-properties" plugin already provides support for item 1. So P4 plugin needs to support item 2.

            Unassigned Unassigned
            jessie_fernandez_perforce Jessie
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: