Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(@StuartR) Implementing View Mask Filter.
JENKINS-30622 JENKINS-28225
- Loading branch information
Showing
5 changed files
with
271 additions
and
56 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/org/jenkinsci/plugins/p4/filters/FilterViewMaskImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.jenkinsci.plugins.p4.filters; | ||
|
||
import hudson.Extension; | ||
|
||
import java.io.Serializable; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
public class FilterViewMaskImpl extends Filter implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final String viewMask; | ||
|
||
@DataBoundConstructor | ||
public FilterViewMaskImpl(String viewMask) { | ||
this.viewMask = viewMask; | ||
} | ||
|
||
public String getViewMask() { | ||
return viewMask; | ||
} | ||
|
||
@Extension | ||
public static final class DescriptorImpl extends FilterDescriptor { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Exclude changes outside view mask"; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/org/jenkinsci/plugins/p4/filters/FilterViewMaskImpl/config.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form"> | ||
|
||
<f:entry title="${%Perforce View Mask}" field="viewMask"> | ||
<f:textarea/> | ||
</f:entry> | ||
|
||
</j:jelly> |
55 changes: 55 additions & 0 deletions
55
src/main/resources/org/jenkinsci/plugins/p4/filters/FilterViewMaskImpl/help-viewMask.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<div> | ||
<b>View Mask filter</b> | ||
<p>Changes can be filtered to not trigger a build; if none of the files | ||
within a change are contained in the view mask, the build is filtered.</p> | ||
<p style="margin-left: 30.0px;"> | ||
For example, with a View Mask Filter of: | ||
<br/> | ||
<code style="margin-left: 60.0px;">//depot/main/tests</code> | ||
<br/> | ||
<code style="margin-left: 60.0px;">-//depot/main/tests/001</code> | ||
<br/> | ||
</p> | ||
<p style="margin-left: 60.0px;"> | ||
<strong>Case A</strong> (change will not be filtered, as index.xml is | ||
in the view mask): | ||
</p> | ||
<p style="margin-left: 90.0px;">Files:</p> | ||
<ul> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/tests/index.xml</code> | ||
</li> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/tests/001/test.xml</code> | ||
</li> | ||
</ul> | ||
<p style="margin-left: 60.0px;"> | ||
<strong>Case B</strong> (change will not be filtered, as index.xml is | ||
in the view mask): | ||
</p> | ||
<p style="margin-left: 90.0px;">Files:</p> | ||
<ul> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/test/index.xml</code> | ||
</li> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/src/build.xml</code> | ||
</li> | ||
</ul> | ||
<p style="margin-left: 60.0px;"> | ||
<strong>Case C</strong> (change will be filtered, as no file is | ||
in the view mask): | ||
</p> | ||
<p style="margin-left: 90.0px;">Files:</p> | ||
<ul> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/src/build.xml</code> | ||
</li> | ||
</ul> | ||
<p style="margin-left: 60.0px;"> | ||
<strong>Case D</strong> (change will be filtered, as no file is | ||
in the view mask): | ||
</p> | ||
<p style="margin-left: 90.0px;">Files:</p> | ||
<ul> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/src/build.xml</code> | ||
</li> | ||
<li style="margin-left: 90.0px;"><code>//depot/main/tests/001/test.xml</code> | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters