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

13 views
Skip to first unread message

lystor@gmail.com (JIRA)

unread,
Feb 26, 2019, 9:43:02 AM2/26/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi created an issue
 
Jenkins / Bug JENKINS-56290
Impossible to Add Streams with Exact Names to Multibranch Pipeline
Issue Type: Bug Bug
Assignee: Unassigned
Components: p4-plugin
Created: 2019-02-26 14:42
Environment: Jenkins: 2.150.3 (official docker image)
P4 Plugin: 1.9.6
Priority: Blocker Blocker
Reporter: Mykola Ulianytskyi

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:

 

 

//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 + "*");
			}
		}

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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

lystor@gmail.com (JIRA)

unread,
Feb 26, 2019, 9:44:02 AM2/26/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi updated an issue
Change By: Mykola Ulianytskyi
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

kwirth@perforce.com (JIRA)

unread,
Feb 26, 2019, 10:14:02 AM2/26/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-56290
 
Re: Impossible to Add Streams with Exact Names to Multibranch Pipeline

Mykola Ulianytskyi 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.

kwirth@perforce.com (JIRA)

unread,
Feb 26, 2019, 10:14:02 AM2/26/19
to jenkinsc...@googlegroups.com

lystor@gmail.com (JIRA)

unread,
Mar 5, 2019, 4:00:02 AM3/5/19
to jenkinsc...@googlegroups.com

lystor@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:36:02 AM3/6/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi updated an issue
 
Change By: Mykola Ulianytskyi
Hello

It is impossible to add streams with exact names to multibranch pipeline.
h2. Steps to reproduce
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}
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

lystor@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:36:02 AM3/6/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi updated an issue
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

lystor@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:37:02 AM3/6/19
to jenkinsc...@googlegroups.com

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

Thank you

lystor@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:38:02 AM3/6/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi updated an issue
Change By: Mykola Ulianytskyi
Comment:
I have created a pull request with a possible fix of this problem:

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

lystor@gmail.com (JIRA)

unread,
Mar 6, 2019, 4:38:02 AM3/6/19
to jenkinsc...@googlegroups.com
Mykola Ulianytskyi updated an issue
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.


 
h2. PR 
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

pallen@perforce.com (JIRA)

unread,
Dec 5, 2019, 10:12:03 AM12/5/19
to jenkinsc...@googlegroups.com
Paul Allen updated an issue
Change By: Paul Allen
Priority: Blocker Major
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

cbopardikar@perforce.com (JIRA)

unread,
Dec 18, 2019, 4:53:03 AM12/18/19
to jenkinsc...@googlegroups.com
Charusheela Bopardikar started work on Bug JENKINS-56290
 
Change By: Charusheela Bopardikar
Status: Open In Progress

cbopardikar@perforce.com (JIRA)

unread,
Dec 18, 2019, 4:53:03 AM12/18/19
to jenkinsc...@googlegroups.com

cbopardikar@perforce.com (JIRA)

unread,
Dec 19, 2019, 6:56:03 AM12/19/19
to jenkinsc...@googlegroups.com
Charusheela Bopardikar commented on Bug JENKINS-56290
 
Re: Impossible to Add Streams with Exact Names to Multibranch Pipeline

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

Updated help bubble to match the change in behaviour.

Doc changes required.

cbopardikar@perforce.com (JIRA)

unread,
Dec 19, 2019, 6:57:02 AM12/19/19
to jenkinsc...@googlegroups.com

kwilliamson@perforce.com (JIRA)

unread,
Dec 20, 2019, 9:42:02 AM12/20/19
to jenkinsc...@googlegroups.com

kwilliamson@perforce.com (JIRA)

unread,
Dec 20, 2019, 10:00:07 AM12/20/19
to jenkinsc...@googlegroups.com
 

Docs updated and ready for release

Change By: Kevin Williamson
Status: In Review Fixed but Unreleased
Resolution: Fixed

cbopardikar@perforce.com (JIRA)

unread,
Jan 8, 2020, 10:57:04 AM1/8/20
to jenkinsc...@googlegroups.com

kwilliamson@perforce.com (JIRA)

unread,
Jan 13, 2020, 11:11:04 AM1/13/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages