Skip to content
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

MCHECKSTYLE-374 remove deprecated method calls #14

Closed
wants to merge 1 commit into from

Conversation

rnveach
Copy link
Contributor

@rnveach rnveach commented Apr 23, 2019

Since maven-checkstyle upgrade it's default version of checkstyle, we are hoping that we can replace the use of deprecated methods. This replaces deprecated methods with their newer replacements.
These methods have been deprecated since probably 8.2 but can't be removed from main repo because the plugin still uses them and this would break our own CI which relies on the plugin. This would break backward compatibility in the plugin as these only came around at 8.2.

ConfigurationLoader.loadConfiguration is also deprecated but hasn't been converted yet because I wanted your input on how you wanted to convert request.isOmitIgnoredModules() to the enumeration IgnoredModulesOptions as there is no conversion method.

MCHECKSTYLE-XXX

Let me know if you are willing to accept this and it needs a JIRA.

mvn -Prun-its clean verify

This doesn't pass for me even on master.

[INFO] --- maven-invoker-plugin:3.1.0:integration-test (integration-test) @ maven-checkstyle-plugin ---
[INFO] Building: check-fail\pom.xml
[INFO] run post-build script verify.groovy
[INFO]           check-fail\pom.xml ............................... FAILED (0.5 s)
[INFO]   The post-build script did not succeed. assert buildLog.text.contains( "You have 1 Checkstyle violation" )
       |        |    |
       |        |    false
       |        Running post-build script: D:\Rickys\Java\checkstyleWorkspaceEclipse\maven-checkstyle-plugin\target\it\check-fail\verify.groovy
       D:\Rickys\Java\checkstyleWorkspaceEclipse\maven-checkstyle-plugin\target\it\check-fail\build.log

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    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.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MCHECKSTYLE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MCHECKSTYLE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (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.

@rnveach
Copy link
Contributor Author

rnveach commented Apr 23, 2019

Hmm somehow I was under the impression #13 had already been merged. Sorry for jumping the gun.

@eolivelli
Copy link
Contributor

Yes, the upgrade of checkstyle has been merged

@eolivelli
Copy link
Contributor

I am investigating the failures on Travis.
meanwhile can you @rnveach please create a JIRA and follow the guidelines?
Having the JIRA will help us taking care of release notes and bug tracking/new features

@rnveach
Copy link
Contributor Author

rnveach commented Apr 23, 2019

please create a JIRA and follow the guidelines?

Done. I will fix the commit message shortly.
https://issues.apache.org/jira/browse/MCHECKSTYLE-374

@rnveach
Copy link
Contributor Author

rnveach commented Apr 23, 2019

Commit message was updated.

ConfigurationLoader.loadConfiguration is also deprecated but hasn't been converted yet

This was done too.

@rnveach
Copy link
Contributor Author

rnveach commented Apr 24, 2019

@eolivelli

I am investigating the failures on Travis.

As stated above, these methods were just introduced into Checkstyle 8.2, so anything before that will not work as this is a breaking compatibility change.
These tests force usage of an old checkstyle version.

https://github.com/apache/maven-checkstyle-plugin/blob/master/src/it/MCHECKSTYLE-332_cache-treewalker/pom.xml#L46
https://github.com/apache/maven-checkstyle-plugin/blob/master/src/it/MCHECKSTYLE-332_cache-checker/pom.xml#L46

The one for the cache in checker can use the newer version. The one in treewalker will have to be removed as there will be no version that can test it.
Are you ok with these changes?

@romani
Copy link

romani commented Apr 27, 2019

@eolivelli, please review proposal of removal of old tests from @rnveach .

after this update plugin will not be compatible with checkstyle version less than 8.2.
Here is commit checkstyle/checkstyle@dc88a99

This update is very desirable by checkstyle project, as maven plugin is the only reason why we keep this methods as deprecated for long time. This update would allow us to move further in API cleanup.
It would very helpful for checkstyle project to have such fix in next release.

@rnveach, lets propose you update as second commit. Please also put ticks on all items in description.

@eolivelli
Copy link
Contributor

Okay, let's drop the test which is not compatible with new checkstyle API.

You can do it in this commit

Thank you all guys, I hope we will hve soon a great brand new release of this plugin

@rnveach
Copy link
Contributor Author

rnveach commented Apr 28, 2019

@eolivelli done but it looks like travis is facing the same issue our repo is having, downloading open jdk 9+.

I also made some additional changes to DefaultCheckstyleExecutor and removed the outdated form of setting the cache since the old ITs that supported it are gone.

@rnveach
Copy link
Contributor Author

rnveach commented Apr 28, 2019

mvn -Prun-its clean verify

This doesn't pass for me even on master.

I figured out my problem. It won't work with Eclipse's embedded maven and needs a real maven installation. I ran all the tests and they pass.

@eolivelli eolivelli changed the title remove deprecated method calls MCHECKSTYLE-374 remove deprecated method calls May 1, 2019
@eolivelli
Copy link
Contributor

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work

merged as 29ebada

@eolivelli eolivelli closed this May 1, 2019
@rnveach rnveach deleted the deprecated_methods branch May 1, 2019 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants