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

       

          [JENKINS-45856] support view Mask filters with wildcards

          Joel Brown created issue -

          Paul Allen added a comment -

          You can do this in the Workspace View (Manual Workspace) or 'checkout' step in the DSL.

          Or are you talking about polling filters?

          Paul Allen added a comment - You can do this in the Workspace View (Manual Workspace) or 'checkout' step in the DSL. Or are you talking about polling filters?

          Joel Brown added a comment -

          Joel Brown added a comment - p4paul polling filters.  This code: https://swarm.workshop.perforce.com/files/guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/tasks/PollTask.java
          Karl Wirth made changes -
          Labels New: P4_VERIFY

          Karl Wirth added a comment -

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

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

          Karl Wirth added a comment - Would also be good if we could have nested wildcards. For example: //depot/..../bin/...
          Karl Wirth made changes -
          Description Original: support viewMask filters with wildcards

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

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

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

           
          New: 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

           
          W Basu Perforce made changes -
          Rank New: Ranked lower
          W Basu Perforce made changes -
          Labels Original: P4_VERIFY New: P4_BACKLOG

          Requires map code improvments in P4Java.

          W Basu Perforce added a comment - Requires map code improvments in P4Java.

          Brian Jackson added a comment -

          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;
           		}
          

           

          Brian Jackson added a comment - 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 ; }  

            Unassigned Unassigned
            joel_brown Joel Brown
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: