Closed rizziemma closed 1 month ago
Enabling synchronous
will not automatically cause the build to fail if policy violations occur. You must also enable either one of failOnViolationFail
or warnOnViolationWarn
to have this happen. The former will cause a build to fail, the latter will mark it as unstable.
Thank you for your time @sephiroth-j I changed my pipeline and it works as expected now :
dependencyTrackPublisher(artifact: sbomPath,
projectName: repository,
projectVersion: tag,
synchronous: true,
dependencyTrackApiKey: API_KEY,
warnOnViolationWarn: true,
failOnViolationFail: true
)
This is not mentionned in the documentation here so may this post will help anyone confused like me
Describe the bug
Trying the latest feature to set pipelines in states UNSTABLE or FAILURE is not working for us currently.
With 4 policies failure, the pipeline is still ending with state SUCCESSFUL :
Plugin Version
5.1.0
Jenkins Version
2.462.3
Java Version for Jenkins
21.0.4
Type of Jenkins Job
declarative pipeline
Dependency-Track Version
4.11.3
Steps to reproduce the behavior
configure policies
send a sbom with known vulnerabilities to fail policies
Expected behavior
The pipeline should end with FAILURE
Additional context
No response