-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add methods to configure context lines for fingerprinting #1943
base: 13.0.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI elements are missing:
- https://github.com/jenkinsci/warnings-ng-plugin/blob/main/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ReportScanningTool/config.jelly
- a help HTML file in the same folder
(There is also a test missing but this is optional here as this requires more work than the actual feature.)
@@ -365,7 +372,13 @@ private void createFingerprints(final Report report) { | |||
report.logInfo("Creating fingerprints for all affected code blocks to track issues over different builds"); | |||
|
|||
FingerprintGenerator generator = new FingerprintGenerator(); | |||
generator.run(new FullTextFingerprint(), report, getCharset()); | |||
if (linesLookAhead < 0) { | |||
//Empty constructor defaults context lines to 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//Empty constructor defaults context lines to 3 | |
// no-arg constructor defaults context lines to 3 |
The broken tests are not you fault: somehow the Java 17 Jenkins release does not work with my docker tests right now. I am still trying to understand what is going on here... |
I'd be happy to help if you could guide me on the steps to get started with the tests. |
@@ -35,6 +35,11 @@ | |||
<f:combobox/> | |||
</f:entry> | |||
|
|||
<f:entry title="${%title.configureContextLines}" field="linesLookAhead" | |||
help="${descriptor.getHelpFile('contextLines')}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should conform to the default naming scheme
help="${descriptor.getHelpFile('contextLines')}"> | |
"> |
@@ -0,0 +1,6 @@ | |||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move that to help-linesLookAhead.html, then we do not need to specify the name in the entry.
For a test a good staring point are the test cases in Currently theses test have one build to show a warning in a file. What we need is: two builds where the warning is moved in the file by e.g. one line in the second build (so we need the same source code file slightly modified by inserting a new line somewhere before). This warning should be marked as existing warning based on a small value of the fingerprint. But when the changed line is included in the fingerprint then the warning should still be marked as existing. |
This PR introduces a tool-based configuration for setting the context lines considered during the fingerprinting process in FullTextFingerprint.
See :
https://issues.jenkins.io/browse/JENKINS-61607
jenkinsci/analysis-model#1136
jenkinsci/analysis-model-api-plugin#184
Submitter checklist