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

Impossible to Add Streams with Exact Names to Multibranch Pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • Jenkins: 2.150.3 (official docker image)
      P4 Plugin: 1.9.6

      Hello

      It is impossible to add streams with exact names to multibranch pipeline.

      Steps to reproduce

      Perforce has six streams:

      • //k02/foo
      • //k02/foo-01
      • //k02/foo-02
      • //k02/bar
      • //k02/bar-01
      • //k02/bar-02

      Task: create multibranch pipeline for //k02/foo and //k02/bar streams only.

      If we set "Include streams" value in Branch Sources to:

      //k02/foo
      //k02/bar
      

      P4Plugin will add all six streams to created job.

      Scan Multibranch Pipeline Log

      p4 streams //k02/foo* //k02/bar*
      

      Cause

      P4Plugin adds * to the end of each stream's name if it is not ended by ... or *.

      ConnectionHelper.java: 

      	public List<IStreamSummary> getStreams(List<String> paths) throws Exception {
      		ListIterator<String> list = paths.listIterator();
      		while (list.hasNext()) {
      			String i = list.next();
      			if (!i.contains("...") && !i.contains("*")) {
      				list.set(i + "*");
      			}
      		}
      

      PR 

      Please don't add * to the end of stream paths automatically.

      It will give the possibility to add only specified streams.

      Users can add * to stream names manually or use supported //depot/stream/... syntax. 

      I have created a pull request with a possible fix of this problem:
      https://github.com/jenkinsci/p4-plugin/pull/93

       

      Please fix this bug.

      Thank you

            p4kevin Kevin Williamson
            lystor Mykola Ulianytskyi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: