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
[core] CPD: Include processing errors in XML report #4992
base: master
Are you sure you want to change the base?
Conversation
[skip ci]
Generated by 🚫 Danger |
I'm torn on this change… it may break any tool parsing this XML if it's not defensive… At the same time, for CPD, unlike PMD, we don't have an XML Schema for these reports (we should!), so it's not like we have made any explicit promises… I can't really make up my mind to be honest… |
I think it's fine to introduce new elements. We also have added attributes in the past. My intuition here is that if you integrate PMD via parsing the report, you allow using any PMD version, and despite that you are not minimally defensive, then you're doing it wrong. PMD is actively developed and it should be understood that the report format might vary somewhat between versions in compatible ways. Although we should probably write up in an ADR what we understand are "compatible ways". |
Adding additional elements definitely creates the risk to break some tools, because they didn't expect this (whether this is good or wrong that the tool is not developed defensive doesn't matter).
For tools, that use the report, it is no difference: If they want to handle errors (e.g. for displaying), they anyway need to change. And then they would just need an additional change to enable this feature to use it. If they don't want to use this feature, they are not forced to change anything (they would also not need to change, if they ignored additional unknown elements in the report). Not sure, if that would be overengineered already. But I think, we somehow should consider the XML formats (and JSON formats) as API... In that sense: enhancements are possible in minor versions. And yes, it boils down to describe "what we understand are "compatible ways"."... |
I'd rather not… more classes, duplication, having to deprecate them, the switch for customer is more complicated and needed even if they don't care about errors / are parsing the report defensively, so we are impacting a 100% of users for something we expect to be an issue for a minority of integrations.
This is a viable option. Unfortunately, a rather slow one…
Also viable, same timeline and execution as the previous one.
We can actually introduce the schema right now for all alternatives… the schema will state that there will be 0 or more |
Describe the PR
Collects processing errors and includes them in CPD report and renders them
in XML. It uses the same format as the PMD report (although we have no formal
schema for CPD XML reports).
This is a nice addition to #4991 - it allows you to look at the report file
rather then at the log output to find any processing errors.
This extends the CPD XML report format. We extends the format in the past (adding file elements,
adding attributes) without bigger problems in e.g. maven-pmd-plugin, which reads this format.
Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)