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

Impossible to Add Streams with Exact Names to Multibranch Pipeline

    • 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

          [JENKINS-56290] Impossible to Add Streams with Exact Names to Multibranch Pipeline

          Karl Wirth added a comment -

          lystor Thanks for highlighting this.

          Confirm that this is the behavior and that exclusionary mapping do not work when streams are involved. For example the following will not work as a workaround:

          //k02/foo
          -//k02/foo-*
          

          Passing to developers.

          Karl Wirth added a comment - lystor Thanks for highlighting this. Confirm that this is the behavior and that exclusionary mapping do not work when streams are involved. For example the following will not work as a workaround: //k02/foo - //k02/foo-* Passing to developers.

          Merged PR https://github.com/jenkinsci/p4-plugin/pull/93

          Updated help bubble to match the change in behaviour.

          Doc changes required.

          Charusheela Bopardikar added a comment - Merged PR  https://github.com/jenkinsci/p4-plugin/pull/93 Updated help bubble to match the change in behaviour. Doc changes required.

          Docs updated and ready for release

          Kevin Williamson added a comment - Docs updated and ready for release

          Released in 1.10.9

          Charusheela Bopardikar added a comment - Released in 1.10.9

          Doc update released

          Kevin Williamson added a comment - Doc update released

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

              Created:
              Updated:
              Resolved: