Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid usage of an empty distribution for the first build #113

Merged

Conversation

lsoumille
Copy link

@lsoumille lsoumille commented Jul 7, 2022

We are using this plugin with only the newFindings thresholds. By default this plugin has the side effect to interrupt the first build as it creates a distribution with 0 vulnerability if there's no previous build. I don't see the point to have this behaviour.

The purpose of this PR is to ignore the newFindings checks for the first build in Jenkins. This has no effect if totalFindings thresholds are used.

We've tested succesfully in our Jenkins instance. If you think that this PR is appropriate I will update the changelog file.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@HagarJNode HagarJNode mentioned this pull request Aug 30, 2022
6 tasks
@sephiroth-j sephiroth-j modified the milestone: v5.0.0 Jan 14, 2024
@sephiroth-j
Copy link
Member

I don't see the point to have this behaviour.

The original intention was to first create a build without thresholds that represents a baseline of the current (and perhaps accepted set of vulnerabilities) that is then used as a reference for newer builds with thresholds. If you do not have a "baseline build", it is necessary to treat non-existent vulnerabilities as zero for the "new findings" feature to work. In this situation, new findings where the same as total findings.

I think your change makes sense as it allows the "new findings" feature to work in the intended way, namely only when a baseline has been set.

@sephiroth-j sephiroth-j added this to the v5.0.0 milestone Jan 17, 2024
@sephiroth-j sephiroth-j force-pushed the null_previous_distribution_first_build branch from cad630c to 17a9a22 Compare January 17, 2024 18:00
@sephiroth-j sephiroth-j force-pushed the null_previous_distribution_first_build branch from 17a9a22 to e5c2b95 Compare January 17, 2024 18:02
@sephiroth-j sephiroth-j added the enhancement New feature or request label Jan 17, 2024
@sephiroth-j sephiroth-j merged commit bc4c31c into jenkinsci:master Jan 17, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants