Plugin does not fail Jenkins build when failing policy
Opened this issue · 1 comments
jbisabel commented
Jenkins version: 2.289.2 LTS
Plugin version: 6.1.0
Reproduction steps
Create a pipeline with the following pipeline step:
stage('Fortify check') {
steps {
fodStaticAssessment bsiToken: '',
entitlementPreference: 'SubscriptionOnly',
inProgressBuildResultType: 'WarnBuild',
inProgressScanActionType: 'Queue',
releaseId: '12345',
remediationScanPreferenceType: 'RemediationScanIfAvailable',
srcLocation: 'src/main/java'
fodPollResults bsiToken: '',
policyFailureBuildResultPreference: 2,
pollingInterval: 2,
releaseId: '12345'
}
post {
always {
script {
echo currentBuild.result
}
}
}
}
Results
Expected result:
With policyFailureBuildResultPreference: 2
I'd expect the currentBuild.result
status to be set to FAILURE and the job to be terminated.
Actual result:
The build status is SUCCESS regardless of scan result and the job continues unhindered
11:45:20 Begin polling Fortify on Demand for results.
11:45:20 1) Poll Status: Queued
11:47:21 2) Poll Status: Completed
11:47:21 Critical: 0
11:47:21 High: 1
11:47:21 Medium: 0
11:47:21 Low: 0
11:47:21 For application status details see the customer portal:
11:47:21 https://emea.fortify.com/Redirect/Releases/12345
11:47:21 Scan failed established policy check
11:47:21 Failure Reason: Pass/Fail Policy requirements not met
Post stage
[Pipeline] script
[Pipeline] {
[Pipeline] echo
11:47:21 SUCCESS