[JENKINS-61940] Improve `Issue` so that multiple files and locations can be stored
Currently, issues refer to a line, a line range, or multiple line ranges in a single file. It would make sense to extend this concept so that issues refer to multiple locations, that may span multiple files.
One parser that already supports that concept is the CPPCheck. Multiple files are currently ignored.
Another example is GNU CC's reorder warning for C++ where the warning shows up in the initializer list, but references the header file.
See
Tasks:
- [ ] Update version number in serialization of issue and report
- [ ] Create new serialization objects for issue, report, and duplications: issue.ser, report.ser, dry.ser
- [ ] Make sure that filenames are updated when the absolute file names are resolved
- [ ] Mark fileName, lineStart, lineEnd, columnStart, columnEnd, lineRanges as deprecated, as well as all setters and getters
- [ ] Use first
Locationinstance to obtain lineStart, lineEnd, etc... - [ ] Use new elements in CPP Check parser
- [ ] Use new elements in Gcc parser
This PR requires a lot of work as we need to ensure that existing serializations will not break. It makes sense to handle JENKINS-61946 within the same PR as well. If this approach sounds too complex, please let me know.
This PR requires a lot of work as we need to ensure that existing serializations will not break. It makes sense to handle JENKINS-61946 within the same PR as well. If this approach sounds too complex, please let me know.
Yes this one is very complex. I tried it many times, but still still build failed. So please help me how to tackle this issue.
I have implemented the requested changes but failing. Please review the changes and tell if any more changes are required. @uhafner
When I run the test on my machine, there are two failing test. The test is creating an Issue with pathName "C:\Windows" (uppercase C) but it's getting "c:/Windows" (lowercase c). Is this issue related with PR #1273
Please review the changes so far. @uhafner
One more thing, I have exams starting on 18th November, so I’ll be able to work on this issue later this month. Please keep this PR and as well as PR #1273 open in the meantime.
Thanks!
One more thing, I have exams starting on 18th November, so I’ll be able to work on this issue later this month. Please keep this PR and as well as PR #1273 open in the meantime.
No worries. Good luck for your exams!
Now I am ready to start working on this issue. Please review the changes so far. @uhafner
Now I am ready to start working on this issue. Please review the changes so far. @uhafner
It makes sense to look at the task list and the existing comments first. When the PR is in a reviewable shape I will make another review.
Now I am ready to start working on this issue. Please review the changes so far. @uhafner
It makes sense to look at the task list and the existing comments first. When the PR is in a reviewable shape I will make another review.
I have tried to implement all task list, but still build is fail. Can you help me?
Can you check the tasks in the list? And make sure that every commit has a commit message that describes what you did in that commit!
I'll have a look at your changes...
The build failures are due to the fact that the API changed. We need to bump the version to a new major release. Then the tools will be quite again.
✔️ What I have implemented :
-
serialVersionUID
Issue.java:2LReport.java:5L
-
.ser files created
issue.ser,report.ser,dry.serunderanalysis/
-
Filename resolution
getFileName()/getFileNameTreeString()useadditionalLocations.get(0).getFileName()
-
Deprecated fields
fileName,lineStart,lineEnd,columnStart,columnEnd,lineRangesmarked@Deprecatedwith Javadoc
-
Use first Location
getLineStart(),getLineEnd(),getColumnStart(),getColumnEnd(),getFileName()useadditionalLocations.get(0)
-
Parser updates
- CppCheck:
issueBuilder.addLocation(new Location(fileName, violation.getStartLine())) - GCC (
collectNotes()):builder.addLocation(new Location(fileName, line, line, column, column))
- CppCheck:
And for this one I am still working and trying to fix. I think this is a major PR and major changes are required where we are handling two issues in one PR. This one seems little bit difficult for me, so it may take time. So please do not close the PR. There are over 50 comments and over 15 commits, looks PR becomes messy, but I must try to solve the issue. I also request you to review, comment and also to commit directly to this PR if you have time. Thank you!
Yes, this is a big change which needs to be carefully done, since the serialization is affected. That means need to ensure for > 20k installations that the new format is backward compatible.
I will not find time for this PR in this week, this is something for the Christmas break...