Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/hudson/tasks/junit/JUnitResultArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,13 @@
* @return the validation result.
* @throws IOException if an error occurs.
*/
public FormValidation doCheckTestResults(@AncestorInPath AbstractProject project, @QueryParameter String value)
public FormValidation doValidateTestResults(

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing POST/RequirePOST annotation Warning

Potential CSRF vulnerability: If DescriptorImpl#doValidateTestResults connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
@AncestorInPath AbstractProject project, @QueryParameter("testResults") String testResults)
throws IOException {
if (project == null || !project.hasPermission(Item.WORKSPACE)) {
return FormValidation.ok();
}
return FilePath.validateFileMask(project.getSomeWorkspace(), value);
return FilePath.validateFileMask(project.getSomeWorkspace(), testResults);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ THE SOFTWARE.
<f:entry title="${%Test report XMLs}" field="testResults"
description="${%description('http://ant.apache.org/manual/Types/fileset.html')}">
<f:textbox />
<f:description>
${%Note: Validation is optional. Only use the validate button in small workspaces to avoid memory issues.}
</f:description>
<f:validateButton title="${%Validate Pattern}" method="validateTestResults" with="testResults" />
</f:entry>
<f:entry field="stdioRetention" title="${%Test output retention}">
<f:select />
Expand Down