-
Notifications
You must be signed in to change notification settings - Fork 45
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
[MPMD-379] Upgrade to use PMD 7.0.0 by default #144
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.
Thanks for the PR!
As mentioned in the comments, I'm going to release PMD 7.0.0 tomorrow, so this PR should be updated to use the final version then (which requires some more changes).
Since the switch from PMD6 to PMD7 is a major change, that impacts end users, this needs a bit more thought: The end users might need to migrate the rulesets as well, to be PMD 7 compatible. It's not just a change of the version...
I'm personally undecided, whether it would be OK to ship such an update in a minor version of maven-pmd-plugin. We obviously did this last time with 3.9.0, when upgrading from PMD 5.x to PMD 6.0.1.
In any case, we should also add this to the docs, e.g. here:
maven-pmd-plugin/src/site/apt/index.apt.vm
Lines 90 to 95 in d00a765
* Upgrading Notes | |
<<Note:>> Starting with PMD 6.0.0 and Maven PMD Plugin 3.9.0, the rules have been reorganized | |
into categories, e.g. <<</category/java/bestpractices.xml>>>. So when upgrading to | |
Maven PMD Plugin 3.9.0 you should review your plugin configuration and/or custom ruleset. | |
See {{{./examples/usingRuleSets.html}Using Rule Sets}} for more information. |
Since there is already a solution on how to use maven-pmd-plugin with PMD 7 (see pmd/pmd#4478), which will also work with the final PMD 7.0.0 release, there is no pressure to hurry this upgrade. MPMD-379 should be maybe renamed to be "Upgrade to use PMD 7.0.0 by default".
For what's worth, my previous work on this topic:
- branch pmd7 - this was not updated for a while: master...pmd7
- current m-pmd-p with pmd7+pmd7-compat: adangel@e8e1bc6
src/main/java/org/apache/maven/plugins/pmd/ExcludeViolationsFromFile.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/pmd/exec/CpdExecutor.java
Outdated
Show resolved
Hide resolved
@adangel any blocker still with this one or could the plugin be released with the PMD 7 support? 🙂 |
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.
Thanks for the updates.
I've finished review now and will shortly push some commits to fix the remaining issues.
any blocker still with this one or could the plugin be released with the PMD 7 support?
The only point is: @mkolesnikov Could you indicate on the PR that you either have signed the Apache ICLA or "declare this contribution to be licenced under the Apache License" by ticking the checkbox? Thanks!
If there are no objections against the plan to ship this upgrade in the next minor version 3.22.0, I'll merge this the next days.
src/main/java/org/apache/maven/plugins/pmd/exec/CpdExecutor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/pmd/exec/CpdExecutor.java
Outdated
Show resolved
Hide resolved
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.
A few small issues
src/main/java/org/apache/maven/plugins/pmd/exec/CpdExecutor.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/pmd/exec/CpdExecutor.java
Outdated
Show resolved
Hide resolved
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.
LGTM now
Is there anything holding this up now? Really keen to start using this without the version workarounds |
Hey @adangel, thanks for getting the PR merged! |
@lapostoj - release under vote - https://lists.apache.org/thread/d0lkjhqv8ddwkw7vz7brlgv93mv1n86n |
Ah my bad I didn't know that part of the process! |
@adangel That merge was a pile of junk. You imported all intermediate work into master making it impossible to trace down the actual change. Don't do that again please, always squash and rebase first. Clearly a -1 for the methodology. |
@michael-o please abstain from statements like these. Any contribution is welcome, and mistakes do happen (yes, squashing the PR would be good, but this is not the end of the world). @adangel Thank you! |
I don't have a problem with the change, it is mostly fine. The merge is what I totally dislike. |
This change introduced now a failing test which did no bubble up in CI, but should have:
Verififed against The actual reason is this change:
and the reason why it does not bubble up is because
There is an exception thrown because the test file des not set
|
} | ||
}); | ||
} catch (IOException e) { | ||
LOG.error("Error while executing CPD", e); |
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.
This is a bad change -- it swallows the exception, build continues.
writeFormattedReport(report); | ||
} | ||
} catch (MavenReportException e) { | ||
LOG.error("Error while writing CPD report", e); |
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.
This is a bad change -- it swallows the exception, build continues.
@mkolesnikov Please rework this with a followup PR. for now, the flow is broken. |
Reminds of apache/maven-fluido-skin#39 (comment) |
I was not aware, that the general rule of thumb for merging PRs is "squash and rebase". If this is the common Following the discussion on apache/maven-fluido-skin#39 (comment) - which is very helpful - it seems
This decision should be somehow officially be documented to be transparent for everyone... For me, as a casual committer, who only pushes once every blue moon and working mostly on other projects, I would suggest to
|
https://issues.apache.org/jira/projects/MPMD/issues/MPMD-379
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MPMD-XXX] - Subject of the JIRA Ticket
,where you replace
MPMD-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.