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

[JENKINS-72015] Make reference build computation more flexible #519

Merged
merged 18 commits into from
Feb 23, 2024

Conversation

uhafner
Copy link
Member

@uhafner uhafner commented Jan 30, 2024

Add new property requiredResult for reference jobs.

When a reference build is searched for in the baseline (see the parameter reference job) then it
sometimes makes sense to only consider builds that have a certain result. For example, you may want to skip the computation of a delta coverage when the reference build has failed tests. Or you may want to skip the computation of new warnings when the reference build has a compilation error.

See also:

@uhafner uhafner added the enhancement Enhancement of existing functionality label Jan 30, 2024
*/
public Optional<Delta> calculateDelta(final Run<?, ?> build, final Run<?, ?> referenceBuild,
final FilteredLog logger) {
return calculateDelta(build, referenceBuild, StringUtils.EMPTY, logger);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [DeltaCalculator.calculateDelta](1) should be avoided because it has been deprecated.
@uhafner uhafner changed the title Make reference build computation more flexible [JENKINS-72015] Make reference build computation more flexible Jan 30, 2024
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: Patch coverage is 76.40449% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 72.35%. Comparing base (5826a40) to head (4c3ec58).
Report is 12 commits behind head on main.

❗ Current head 4c3ec58 differs from pull request most recent head 5aeffde. Consider uploading reports for the commit 5aeffde to get more accurate results

Files Patch % Lines
...plugins/forensics/reference/ReferenceRecorder.java 56.52% 8 Missing and 2 partials ⚠️
...s/forensics/reference/SimpleReferenceRecorder.java 88.23% 3 Missing and 3 partials ⚠️
...ns/plugins/forensics/reference/ReferenceBuild.java 61.53% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #519      +/-   ##
============================================
+ Coverage     71.58%   72.35%   +0.76%     
- Complexity      386      398      +12     
============================================
  Files            48       48              
  Lines          1172     1219      +47     
  Branches        102      108       +6     
============================================
+ Hits            839      882      +43     
- Misses          298      302       +4     
  Partials         35       35              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import static io.jenkins.plugins.forensics.assertions.Assertions.*;
import static org.mockito.Mockito.*;

class SimpleReferenceRecorderTest {

Check notice

Code scanning / CodeQL

Unused classes and interfaces

Unused class: SimpleReferenceRecorderTest is not referenced within this codebase. If not used as an external API it should be removed.
@uhafner uhafner marked this pull request as ready for review February 23, 2024 18:14
@uhafner uhafner merged commit e375f1c into main Feb 23, 2024
3 of 13 checks passed
@uhafner uhafner deleted the reference-job branch February 23, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant