[JIRA] (JENKINS-45856) support view Mask filters with wildcards

9 views
Skip to first unread message

kwirth@perforce.com (JIRA)

unread,
Mar 6, 2018, 7:02:02 AM3/6/18
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
 
Jenkins / Improvement JENKINS-45856
support view Mask filters with wildcards
Change By: Karl Wirth
Labels: P4_VERIFY
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Mar 6, 2018, 7:03:02 AM3/6/18
to jenkinsc...@googlegroups.com
Karl Wirth commented on Improvement JENKINS-45856
 
Re: support view Mask filters with wildcards

Would also be good if we could have nested wildcards. For example:

//depot/..../bin/...

kwirth@perforce.com (JIRA)

unread,
Apr 5, 2018, 11:54:02 AM4/5/18
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
support Support polling viewMask filters with wildcards

For example, we want to list source files in any directory.

//depot/main/project/....cpp

//depot/main/project/....h

 

wbasu@perforce.com (JIRA)

unread,
Apr 19, 2018, 10:16:01 AM4/19/18
to jenkinsc...@googlegroups.com
W Basu updated an issue
Change By: W Basu
Labels: P4_VERIFY P4_BACKLOG

wbasu@perforce.com (JIRA)

unread,
Apr 19, 2018, 10:17:02 AM4/19/18
to jenkinsc...@googlegroups.com
W Basu commented on Improvement JENKINS-45856
 
Re: support view Mask filters with wildcards

Requires map code improvments in P4Java.

brian@jaxzin.com (JIRA)

unread,
Apr 19, 2018, 11:14:02 AM4/19/18
to jenkinsc...@googlegroups.com

I'm not clear on how you'd like to implement it with p4java, but I've been using a private fork with this small hack to PollTask.java since July and it meets our needs for a single `...` wildcard embedded within the path (ex. "//depot/path/....java"):

	boolean isFileInViewMask = false;
	String p = s.getDepotPathString();
	for (String maskPath : viewMask.split("\n")) {
-		if (p.startsWith(maskPath)) {
+
+		// If there is a '...' wildcard
+		String[] maskPathParts = maskPath.split("[.]{3}");
+		if(maskPathParts.length == 2 && p.startsWith(maskPathParts[0]) && p.endsWith(maskPathParts[1])) {
+			isFileInViewMask = true;
+		} else if (p.startsWith(maskPath)) {
 			isFileInViewMask = true;
 		}

 

pallen@perforce.com (JIRA)

unread,
Apr 20, 2018, 4:34:02 AM4/20/18
to jenkinsc...@googlegroups.com

Hi Brian, thank you for sharing the code snippet.  That would work for most customers and I am tempted to merge that into the code for the time being.   To fully support the Perforce mapping we would need to include exclusionary mappings '-', overlay mappings '', multiple '...' and '*' wild cards, and possibly '%%n' mappings.  The other derived APIs inherit this from the C+ API, but p4java is native and we would need to implement the map code in full.

pallen@perforce.com (JIRA)

unread,
Apr 20, 2018, 4:35:02 AM4/20/18
to jenkinsc...@googlegroups.com
Paul Allen edited a comment on Improvement JENKINS-45856
Hi Brian, thank you for sharing the code snippet.  That would work for most customers and I am tempted to merge that into the code for the time being.   To fully support the Perforce mapping we would need to include exclusionary mappings ' ( - ' ) , overlay mappings ' ( + ' ) , multiple '...' and '*' wild cards, and possibly '%%n' mappings.  The other derived APIs inherit this from the C++ API, but p4java is native and we would need to implement the map code in full.

pallen@perforce.com (JIRA)

unread,
Apr 20, 2018, 5:35:03 AM4/20/18
to jenkinsc...@googlegroups.com
Paul Allen started work on Improvement JENKINS-45856
 
Change By: Paul Allen
Status: Open In Progress

kwirth@perforce.com (JIRA)

unread,
Dec 3, 2019, 8:57:03 AM12/3/19
to jenkinsc...@googlegroups.com

++Usage case - Need to exclude changes that include *.inf files. For example not trigger the build if it matches:

//depot/MyProject/....inf
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Dec 3, 2019, 9:05:02 AM12/3/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Improvement JENKINS-45856
++Usage case - Need to exclude changes that include *.inf files. For example not trigger the build if it matches:
{code:java}
//depot/MyProject/....inf{code}

 

*NOTE FOR DEVELOPERS: Is this now possible with the new map code in P4JAVA?*

kwirth@perforce.com (JIRA)

unread,
Dec 3, 2019, 9:06:03 AM12/3/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
 
Change By: Karl Wirth
Labels: P4_A P4_BACKLOG
Reply all
Reply to author
Forward
0 new messages