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

          Mykola Ulianytskyi created issue -
          Mykola Ulianytskyi made changes -
          Description Original: Hello

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

          Example:

          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:

           

           
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

           

           

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          *Cause:*

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

           

          ConnectionHelper.java: 
          {code: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 + "*");
          }
          }
          {code}
          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.

          Thank you
          New: Hello

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

          Example:

          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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          *Cause:*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

          Thank you
          Karl Wirth made changes -
          Labels New: P4_B
          Mykola Ulianytskyi made changes -
          Description Original: Hello

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

          Example:

          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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          *Cause:*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

          Thank you
          New: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR

          Thank you
          Mykola Ulianytskyi made changes -
          Description Original: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR

          Thank you
          New: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR
          h2.  

          Thank you
          Mykola Ulianytskyi made changes -
          Description Original: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR
          h2.  

          Thank you
          New: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR 

          [https://github.com/jenkinsci/p4-plugin/pull/93]

          Thank you
          Mykola Ulianytskyi made changes -
          Description Original: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          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.

           
          h2. PR 

          [https://github.com/jenkinsci/p4-plugin/pull/93]

          Thank you
          New: Hello

          It is impossible to add streams with exact names to multibranch pipeline.
          h2. 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:
          {code:java}
          //k02/foo
          //k02/bar
          {code}
          P4Plugin will add all six streams to created job.

          *Scan Multibranch Pipeline Log*
          {code:java}
          p4 streams //k02/foo* //k02/bar*
          {code}
          h2. *Cause*

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

          *ConnectionHelper.java:* 
          {code: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 + "*");
          }
          }
          {code}
          h2. 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
          Mykola Ulianytskyi made changes -
          Comment [ I have created a pull request with a possible fix of this problem:

          https://github.com/jenkinsci/p4-plugin/pull/93 ]
          Paul Allen made changes -
          Priority Original: Blocker [ 1 ] New: Major [ 3 ]
          Charusheela Bopardikar made changes -
          Assignee New: Charusheela Bopardikar [ cbopardikar ]
          Charusheela Bopardikar made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

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

              Created:
              Updated:
              Resolved: