-
Notifications
You must be signed in to change notification settings - Fork 274
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
Abstracted descriptor matching. #897
Conversation
That would imply that you need a prefix for the new IDs. And we would need to override that method at multiple places. Wouldn't it be much simpler if we would additionally store the original tool ID side by side and then use it as fallback if the label descriptor with the new ID is empty? |
If we will store the original tool ID what would be the point to search descriptor using also the custom ID? Isn't it perfectly pointless? |
Hmm, I'm not sure if I understand your point. Maybe it would be helpful if you can create a small integration tests that shows the problem. You can take one of the tests here as a template: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/plugin/src/test/java/io/jenkins/plugins/analysis/warnings/steps/StepsITest.java#L462 From your description I expected that you want something like
That should show up with 2 URLs But maybe I misunderstand your plan? Should the pull request above already show the results without any additional work for |
Is this what you mean with the above message?
My original proposal is far less invasive and permits to a Descriptor to be associated to a set of custom Id's. |
As Abramo wrote above, another possibility is to use always the toolId to create StaticAnalysisLabelProvider, |
Are you planning to add a small test that shows the new functionality? |
Yes I will. |
I added the test. |
Codecov Report
@@ Coverage Diff @@
## master #897 +/- ##
============================================
+ Coverage 79.89% 79.98% +0.08%
+ Complexity 1467 1423 -44
============================================
Files 246 237 -9
Lines 5417 5240 -177
Branches 424 411 -13
============================================
- Hits 4328 4191 -137
+ Misses 939 895 -44
- Partials 150 154 +4
Continue to review full report at Codecov.
|
@uhafner |
I did not find the time yet to check if that does not break anything else. Did you check what happens if we have two parser IDs that share the same prefix? (Or where one parser ID is prefix of another one?) Otherwise the PR looks fine! |
It takes the first one it finds. |
@uhafner |
As mentioned above, the code looks fine. I just creates a new problem:
Currently some parsers already share the same prefix, this cannot be changed without breaking existing jobs: |
So I am somewhat unsure what to do. I think when I am finished with my current feature implementation (see #889) I will have some more time to dig into that problem. |
This will permit to have different id's for two different recordIssue preserving the correct Descriptor (Icon, DetailsTableModel, DisplayName).
To do that it is enough to override the "describes" method in the class extending ReportScanningTool,
e.g.:
@OverRide
public boolean describes(String id){
return id.startsWith("my-scanning-tool");
}