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

Expose Stream location instead/in addition to the stream name for multi-branch pipelines

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None

      When using a multi-branch pipeline we have no means of obtaining the stream location (full path to the stream) instead getting the stream name in the BRANCH_NAME variable.

      This represents the stream name which is essentially a display name for the stream that can be changed by users. This in itself causes some issues when they rename a stream as it will create new jobs in the multibranch pipeline.

      The biggest issue however is that most commands will require to know the stream location, rather than the name (say to create a workspace). We could search for the stream location using the name but we dont even know which depot so that search is likely to generate a lot of duplicates. And even with the depot known, if this depot was created to support more than 1 levels (folders before streams) then duplicates are still a strong possibility.

      so getting the stream location as a complete path would allow us to perforce additional perforce commands without having to hard-code the stream location somewhere (job properties, directly in jenkinsfile etc)

      We h ave tried and searched and could not find a means to retrieve this information programmatically from within the pipeline.

      Closest we got was with this function
      https://javadoc.jenkins.io/plugin/p4/org/jenkinsci/plugins/p4/PerforceScm.DescriptorImpl.html#getDepotPath--
      which returns an empty string

            Unassigned Unassigned
            newtopian Eric Daigneault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: