Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for checking policy status in build conditions
- Loading branch information
Showing
7 changed files
with
133 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
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
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
151 changes: 82 additions & 69 deletions
151
src/main/resources/org/jenkinsci/plugins/codedx/CodeDxPublisher/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 |
---|---|---|
@@ -1,98 +1,111 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" escapeText="false"> | ||
<!-- | ||
This jelly script is used for per-project configuration. | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" | ||
xmlns:t="/lib/hudson" xmlns:f="/lib/form" escapeText="false"> | ||
<!-- | ||
This jelly script is used for per-project configuration. | ||
See global.jelly for a general discussion about jelly script. | ||
--> | ||
See global.jelly for a general discussion about jelly script. | ||
--> | ||
|
||
<f:entry title="Server URL" field="url" help="/plugin/codedx/help-url.html"> | ||
<f:textbox clazz="codedx-url" /> | ||
</f:entry> | ||
<f:textbox clazz="codedx-url"/> | ||
</f:entry> | ||
<f:advanced> | ||
<f:entry field="selfSignedCertificateFingerprint" title="Self-Signed Certificate Fingerprint" help="/plugin/codedx/help-fingerprint.html"> | ||
<f:entry field="selfSignedCertificateFingerprint" title="Self-Signed Certificate Fingerprint" | ||
help="/plugin/codedx/help-fingerprint.html"> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
</f:advanced> | ||
|
||
<f:entry title="Server API Key" field="key" help="/plugin/codedx/help-key.html"> | ||
<f:textbox /> | ||
</f:entry> | ||
<f:entry title="Server API Key" field="key" help="/plugin/codedx/help-key.html"> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
<f:entry title="Code Dx Project" field="projectId"> | ||
<f:select /> | ||
<f:select/> | ||
</f:entry> | ||
|
||
<f:entry title="Source and Binary Files" field="sourceAndBinaryFiles" help="/plugin/codedx/help-sourceAndBinaryFiles.html"> | ||
<f:textbox default="**" /> | ||
</f:entry> | ||
<f:entry title="Source and Binary Files" field="sourceAndBinaryFiles" | ||
help="/plugin/codedx/help-sourceAndBinaryFiles.html"> | ||
<f:textbox default="**"/> | ||
</f:entry> | ||
|
||
<f:entry title="Tool Output Files" field="toolOutputFiles" help="/plugin/codedx/help-toolOutputFiles.html"> | ||
<f:textbox /> | ||
</f:entry> | ||
<f:entry title="Tool Output Files" field="toolOutputFiles" help="/plugin/codedx/help-toolOutputFiles.html"> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
<f:entry title="Analysis Name" field="analysisName" help="/plugin/codedx/help-analysisName.html"> | ||
<f:textbox default="Build #$${BUILD_NUMBER}" /> | ||
<f:entry title="Analysis Name" field="analysisName" help="/plugin/codedx/help-analysisName.html"> | ||
<f:textbox default="Build #$${BUILD_NUMBER}"/> | ||
</f:entry> | ||
|
||
<f:entry title="Target Branch" field="targetBranchName" help="/plugin/codedx/help-targetBranch.html"> | ||
<f:textbox /> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
<f:entry title="Base Branch" field="baseBranchName" help="/plugin/codedx/help-baseBranch.html"> | ||
<f:textbox /> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
<f:block> | ||
<table id="analysisResultConfiguration"> | ||
<j:set var="analysisResultConfiguration" value="${instance.analysisResultConfiguration}"/> | ||
<f:optionalBlock title="Wait for Analysis Results" name="analysisResultConfiguration" checked="${analysisResultConfiguration != null}" help="/plugin/codedx/help-analysisResultConfiguration.html"> | ||
|
||
<f:section title="Build Failure Conditions"> | ||
<f:entry title="Analysis Error" field="breakIfFailed" help="/plugin/codedx/help-breakIfFailed.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.breakIfFailed}" default="true" /> | ||
</f:entry> | ||
|
||
<f:entry title="Severity" field="failureSeverity" help="/plugin/codedx/help-failureSeverity.html"> | ||
<f:select value="${analysisResultConfiguration.failureSeverity}"/> | ||
</f:entry> | ||
|
||
<f:entry title="Only consider new findings." field="failureOnlyNew" help="/plugin/codedx/help-failureOnlyNew.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.failureOnlyNew}"/> | ||
</f:entry> | ||
</f:section> | ||
|
||
<f:section title="Build Unstable Conditions"> | ||
<f:entry title="Severity" field="unstableSeverity" help="/plugin/codedx/help-unstableSeverity.html"> | ||
<f:select value="${analysisResultConfiguration.unstableSeverity}"/> | ||
<f:block> | ||
<table id="analysisResultConfiguration"> | ||
<j:set var="analysisResultConfiguration" value="${instance.analysisResultConfiguration}"/> | ||
<f:optionalBlock title="Wait for Analysis Results" name="analysisResultConfiguration" | ||
checked="${analysisResultConfiguration != null}" | ||
help="/plugin/codedx/help-analysisResultConfiguration.html"> | ||
|
||
<f:section title="Build Failure Conditions"> | ||
<f:entry title="Analysis Error" field="breakIfFailed" help="/plugin/codedx/help-breakIfFailed.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.breakIfFailed}" default="true"/> | ||
</f:entry> | ||
|
||
<f:entry title="'Break the build' Policy Action" field="breakForPolicy" help="/plugin/codedx/help-breakForPolicy.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.breakForPolicy}" default="true"/> | ||
</f:entry> | ||
|
||
<f:entry title="Severity" field="failureSeverity" help="/plugin/codedx/help-failureSeverity.html"> | ||
<f:select value="${analysisResultConfiguration.failureSeverity}"/> | ||
</f:entry> | ||
|
||
<f:entry title="Only consider new findings." field="failureOnlyNew" | ||
help="/plugin/codedx/help-failureOnlyNew.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.failureOnlyNew}"/> | ||
</f:entry> | ||
</f:section> | ||
|
||
<f:section title="Build Unstable Conditions"> | ||
<f:entry title="Severity" field="unstableSeverity" help="/plugin/codedx/help-unstableSeverity.html"> | ||
<f:select value="${analysisResultConfiguration.unstableSeverity}"/> | ||
</f:entry> | ||
|
||
<f:entry title="Only consider new findings." field="unstableOnlyNew" | ||
help="/plugin/codedx/help-unstableOnlyNew.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.unstableOnlyNew}"/> | ||
</f:entry> | ||
</f:section> | ||
|
||
|
||
<f:section title="Graph Options"> | ||
<f:entry title="Number of Builds in Graph" field="numBuildsInGraph" | ||
description="Any value less than 2 means unlimited."> | ||
<f:number value="${analysisResultConfiguration.numBuildsInGraph}" default="0" clazz="number"/> | ||
</f:entry> | ||
|
||
</f:section> | ||
|
||
|
||
</f:optionalBlock> | ||
</table> | ||
</f:block> | ||
|
||
<f:section title="Advanced Options"> | ||
<f:advanced> | ||
<f:entry title="Excluded Source and Binary Files" field="excludedSourceAndBinaryFiles" | ||
help="/plugin/codedx/help-excludedSourceAndBinaryFiles.html"> | ||
<f:textbox/> | ||
</f:entry> | ||
|
||
<f:entry title="Only consider new findings." field="unstableOnlyNew" help="/plugin/codedx/help-unstableOnlyNew.html"> | ||
<f:checkbox checked="${analysisResultConfiguration.unstableOnlyNew}"/> | ||
</f:entry> | ||
</f:section> | ||
|
||
|
||
<f:section title="Graph Options"> | ||
<f:entry title="Number of Builds in Graph" field="numBuildsInGraph" description="Any value less than 2 means unlimited."> | ||
<f:number value="${analysisResultConfiguration.numBuildsInGraph}" default="0" clazz="number"/> | ||
</f:entry> | ||
|
||
</f:section> | ||
|
||
|
||
</f:optionalBlock> | ||
</table> | ||
</f:block> | ||
|
||
<f:section title="Advanced Options"> | ||
<f:advanced> | ||
<f:entry title="Excluded Source and Binary Files" field="excludedSourceAndBinaryFiles" help="/plugin/codedx/help-excludedSourceAndBinaryFiles.html"> | ||
<f:textbox /> | ||
</f:entry> | ||
|
||
</f:advanced> | ||
</f:advanced> | ||
</f:section> | ||
|
||
</j: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,9 @@ | ||
<div> | ||
<p> | ||
If enabled, will consider the build a failure if at least one of the Code Dx project's violated policies has | ||
its action set to "Break the build". | ||
</p> | ||
<p> | ||
(Note: policies are supported in Code Dx 2023.1.0 and up. This option will be ignored if using an older Code Dx version.) | ||
</p> | ||
</div> |