Skip to content

Issue #7190: remove deprecated setClassLoader methods#7778

Merged
rnveach merged 4 commits intocheckstyle:masterfrom
nrmancuso:issue-7190-remove-dep-setclassloader-methods
Mar 12, 2020
Merged

Issue #7190: remove deprecated setClassLoader methods#7778
rnveach merged 4 commits intocheckstyle:masterfrom
nrmancuso:issue-7190-remove-dep-setclassloader-methods

Conversation

@nrmancuso
Copy link
Copy Markdown
Contributor

@nrmancuso nrmancuso commented Mar 3, 2020

Issue #7190: remove deprecated setClassLoader methods

@nrmancuso nrmancuso force-pushed the issue-7190-remove-dep-setclassloader-methods branch 2 times, most recently from 44e9aac to 1034af4 Compare March 3, 2020 22:15
@romani
Copy link
Copy Markdown
Member

romani commented Mar 4, 2020

Same problem in pgjdbc project Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check

Did you send PR to them ?

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 4, 2020

PR was sent to pgjdbc/pgjdbc#1726 .

@romani
Copy link
Copy Markdown
Member

romani commented Mar 4, 2020

New failure org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check (default-cli) on project orekit: no surprise :).

@nmancus1 , please review at https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh all execution points with prefix "no-error" and create PR for such projects.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 4, 2020

@nmancus1 When providing this update PRs to external groups, please add some context to the PR information so they know why we need this change accepted.

See some of my previous PRs as examples:
pgjdbc/pgjdbc#904
pgjdbc/pgjdbc#1434

@nrmancuso
Copy link
Copy Markdown
Contributor Author

@romani I'm on it.
@rnveach Thanks for the pointers. I will do a more thorough job in the future when submitting PR's to other projects.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 4, 2020

@rnveach How can I generate the failing regression locally, so that I can provide that output in the PRs I'm submitting (similar to your example)?

PR's sent( I'll update as I make them ):
xwiki: xwiki/xwiki-commons#88
apex-core: https://issues.apache.org/jira/browse/APEXCORE-820
equalsverifier(already merged, commited by dependabot): jqno/equalsverifier@a8d7ad4
orekit: https://gitlab.orekit.org/orekit/orekit/-/merge_requests/50
Sevuntu-checks: sevntu-checkstyle/sevntu.checkstyle#804
Hibernate-Search: hibernate/hibernate-search#2238

@romani
Copy link
Copy Markdown
Member

romani commented Mar 5, 2020

CI is simply execute single command line that we can execute on linux local, example -

./.ci/wercker.sh no-error-xwiki

same commands should work on your linux local laptop, execution if from repo root directory.

@romani
Copy link
Copy Markdown
Member

romani commented Mar 5, 2020

@nmancus1 , please remove from commit not your changes.
Please resolve all conflicts and .... . Looks we are waiting for xwiki only .

apex-core did not update for 3 years, according to github https://github.com/apache/apex-core , I did a fork https://github.com/checkstyle/apex-core , @nmancus1 , please send PR to our fork, please update https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L103 to use checkstyle's fork.
We might remove this project from testing as it is looks like dead.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 5, 2020

CI is simply execute single command line that we can execute on linux local, example -

I'm lazy, I wanted to run all of the commands via script, without writing a new one :)

Please resolve all conflicts and .... . Looks we are waiting for xwiki only .

apex-core did not update for 3 years, according to github https://github.com/apache/apex-core , I did a fork https://github.com/checkstyle/apex-core , @nmancus1 , please send PR to our fork, please update https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L103 to use checkstyle's fork.
We might remove this project from testing as it is looks like dead.

I'll get this fixed up this today.

@romani
Copy link
Copy Markdown
Member

romani commented Mar 5, 2020

I wanted to run all of the commands via script,

Just copy single command from CI config, like
./.ci/wercker.sh no-error-xwiki paste it to Linux terminal, and you will have the same result. It is applicable for all CIs.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 5, 2020

I wanted to run all of the commands via script, without writing a new one :)

I understand this and want something similar so I can execute same CI commands locally on my checkstyle VM server which I use for regression reports. The issue is going to be keeping it in-synch with the YMLs as CI can change regulary.

For now, you will have to create such a script manually. I would move this type of discussion to a new issue if you want to continue to add it to checkstyle in some form.

@nrmancuso nrmancuso force-pushed the issue-7190-remove-dep-setclassloader-methods branch from 1034af4 to 7dffd09 Compare March 5, 2020 18:29
@nrmancuso
Copy link
Copy Markdown
Contributor Author

@romani I have ran all of the wercker scripts locally, and none are failing for me, but CI still fails when I push. Can you let me know what is failing since I can't view the logs?

@romani
Copy link
Copy Markdown
Member

romani commented Mar 6, 2020

Wercker is failing on orekit

Command: ./.ci/wercker.sh no-error-orekit
CS_version: 8.31-SNAPSHOT
Cloning into 'hipparchus'...
Note: checking out '4c6c6fc45e859eae2d4eb091a3a3c0a7a458b8d9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

We need to update checkout commit in wercker.sh.
Please send PR to our apex fork.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 6, 2020

I have ran all of the wercker scripts locally, and none are failing for me, but CI still fails

Without seeing what you did,

Wercker is special in that it has a pre-execution command before each command run.

https://github.com/checkstyle/checkstyle/blob/master/wercker.yml#L58
You must run install on your current checkstyle branch that is this PR and then run each SH command from the same directory using the commands in the rest of the YML.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 7, 2020

Please send PR to our apex fork.

@romani I am struggling to get apex past mvn clean verify so that I can send PR. Lots of failing tests. Where can we discuss?

We need to update checkout commit in wercker.sh.

Should I submit a PR for this as 'minor"?

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 7, 2020

I am struggling to get apex past mvn clean verify

Verify will run the tests of the repo. For regression, we don't want any tests being run. Please look at the original command used for apex. https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L105

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 7, 2020

Verify will run the tests of the repo. For regression, we don't want any tests being run. Please look at the original command used for apex.

So, just to be clear, it is ok to submit a PR to checkstyle's apex repo that will not pass mvn clean verify? The contribution rules still link to the old Apache site, so I thought it best to be thorough.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 7, 2020

It is the 3 year old project @romani mentioned. If they have failing tests on a clean master, then you would be wasting your time on fixing a project that is not even maintained by the owners. If it was an active project, yes, the PR sent to them should pass their CI and we could ask their maintainers for their help resolving any CI issues. None of us know their project in any details to know how to help. From our end, these projects are only used for regression. We just need to make sure we have a command to run regression on them and ensure a stable build, only for regression purposes. We always skip tests on these projects to speed up execution time and because we are not involved in testing their own project. Just their checkstyle portion.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

Ok. Thanks for explaining.

@romani
Copy link
Copy Markdown
Member

romani commented Mar 7, 2020

@nmancus1 ,
please review code at https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L62
there are two checkouts to certain SHAs, please update second to any SHA from orekit repo after your fix is merged, first SHA is related to dependeing library, any recent SHA will be ok.

apex PR is merged - https://github.com/checkstyle/apex-core/pull/1
so please update https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L103 to use our fork instead of original repo.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 7, 2020

so please update https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L103 to use our fork instead of original repo.

PR is here: #7786

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 7, 2020

orekit: https://gitlab.orekit.org/orekit/orekit/-/merge_requests/50

Orekit was merged, but we specific commit in regression because of their unstable CI.
See https://github.com/checkstyle/checkstyle/blob/master/.ci/wercker.sh#L78

This needs to be updated for the CI in this PR to pass.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

@rnveach I just submitted pull request for updated Orekit commit at #7793

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

./.ci/wercker.sh no-error-methods-distance
All of these build for me.

Then why does methods distance in wercker fail, which looks because its maven-checkstyle-plugin was not updated to the newest version?
https://github.com/sevntu-checkstyle/methods-distance/blob/master/pom.xml#L21

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 11, 2020

Then why does methods distance in wercker fail, which looks because its maven-checkstyle-plugin was not updated to the newest version?

I failed to clean install. After doing that, I can reproduce this error. I'll submit PR now, and recheck the rest. My apologies.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

Please reconfirm the others with the clean install too.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 11, 2020

@rnveach ./.ci/wercker.sh no-error-contribution is the only other one failing. What can I do to fix this, considering the variable used here: https://github.com/checkstyle/contribution/blob/fdc04f5789658cf002832c6eb5ea33ccd1c5b09a/checkstyle-tester/pom.xml#L65 ?

Can we add arguments to maven to specify the correct plugin version?

@romani
Copy link
Copy Markdown
Member

romani commented Mar 11, 2020

Wercker is restarted, Travis is failing on spelling from Sha commit value.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

./.ci/wercker.sh no-error-contribution is the only other one failing. What can I do to fix this, considering the variable used here: https://github.com/checkstyle/contribution/blob/fdc04f5789658cf002832c6eb5ea33ccd1c5b09a/checkstyle-tester/pom.xml#L65 ?

I am not seeing your issue. Why can't you update the version number at https://github.com/checkstyle/contribution/blob/fdc04f5789658cf002832c6eb5ea33ccd1c5b09a/checkstyle-tester/pom.xml#L14 ?
Please expand on the issue more.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

Please expand on the issue more.

Lack of sleep and inexperience. Thanks for pointing that out. PR submitted.

@nrmancuso nrmancuso force-pushed the issue-7190-remove-dep-setclassloader-methods branch from 86e9c7c to 980a3b0 Compare March 11, 2020 11:42
@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 11, 2020

What should I do about htmlunit: #7778 (comment) ? I thought it would be easier to move to GitHub, but if that complicates things, I'll submit a PR over there, too, and stick with SVN.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

Update to contribution merged. Wecker doesn't need a restart as it hasn't started yet.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

I thought it would be easier to move to GitHub, but if that complicates things, I'll submit a PR over there, too, and stick with SVN.

Have they fully switched to Github and put SVN in a read only state? If so, switch to Github should be in this PR unless @romani has a complaint since it now seems it is directly tied to their maven version.

Either this PR or another, you are relied on this change for this PR.

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

minor: remove hipparchus temp directory

This doesn't look like it is connected to this issue. If so, move this to another PR so it can be merged faster.

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

wercker is passed.
I am approving this PR, could be merged when all CIs green.

@rnveach , please finalize.

.ci/wercker.sh Outdated
mvn -e compile checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
checkout_from https://github.com/HtmlUnit/htmlunit
cd .ci-temp/htmlunit
mvn -e compile -DskipTests=true -Dcheckstyle.version=${CS_POM_VERSION}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This command is incomplete. We need more than a compile. Please see the pervious command and commands from other places. I don't see why actual command would change since they just moved from SVN to Git.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@nrmancuso
Copy link
Copy Markdown
Contributor Author

nrmancuso commented Mar 11, 2020

Have they fully switched to Github and put SVN in a read only state?

It appears so: https://github.com/HtmlUnit/htmlunit/releases/tag/2.33

I'm not sure how to determine if their SVN is in a read only state, but there hasn't been any commits to SVN since 2018 that I can see.

I have reverted 599231b . I need to uncomment this block of script, right? #7778 (comment). What else do I need to take care of so that this can get merged? Do you want me to squash all commits besides ef07590 and 09f466b?

@rnveach
Copy link
Copy Markdown
Contributor

rnveach commented Mar 11, 2020

there hasn't been any commits to SVN since 2018 that I can see.

Since its been 2 years and if the Git repository is still active, then it seems highly likely that SVN isn't used anymore and so the commit must remain here. If it is not literally read only, then if usage seems that way, then it is good enough for me. They won't push a commit to it after 2 years of abandoning it.

What else do I need to take care of so that this can get merged?

#7778 (comment)
Move this commit to another PR unless you can tell me how it is connected to this issue. We should not see a revert commit or anything left of this change in this PR. When moved to other PR, it can be marked as a "minor" change.

#7778 (comment)
Resolve this item. This one looks like blocking problem.

Any commits remaining that are attached to this issue must have the issue in the commit message. IE: Issue #7190:

Make CI happy. We will only merge when CI is green. I am not talking about random failures like timeout issues which we see happen from time to time. I am talking full on errors, violations, etc...

Don't forget to rebase on latest master.

Do you want me to squash all commits besides ef07590 and 09f466b?

No. Leave them all separate.

@nrmancuso nrmancuso force-pushed the issue-7190-remove-dep-setclassloader-methods branch 2 times, most recently from 1df00c6 to 9f3a670 Compare March 11, 2020 21:14
@rnveach rnveach self-assigned this Mar 11, 2020
checkout_from https://github.com/HtmlUnit/htmlunit
cd .ci-temp/htmlunit
mvn -e compile checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
cd ../
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cd changed from cd htmlunit to cd .ci-temp/htmlunit. Since we are cding into a second directory, don't we need to cd out an additional directory too?

Copy link
Copy Markdown
Contributor

@rnveach rnveach Mar 11, 2020

Choose a reason for hiding this comment

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

Actually, we are deleting the htmlunit folder so we should only go out 1. Please double confirm. I am seeing out projects with a double cd and I think atleast 1 might be wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What I have is correct, there are other errors in this file, like what you've mentioned. There are a few that do that, but they end up living in .ci-temp and never getting deleted, just updated, which I guess could be either good or bad, but the intended action of rm'ing the directories isn't carried out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would you like me to tidy this file up along with the hipparchus directory removal and submit as one PR?

Copy link
Copy Markdown
Contributor

@rnveach rnveach Mar 11, 2020

Choose a reason for hiding this comment

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

Yes, feel free to make another PR ensure the temp folder is tidied up. Not in this PR. I was asking @romani since he knows linux better than me: can we remove the f option for rm -rf but not make it prompt? This way it will complain if directory doesn't exist and catch this problem for us.
http://man7.org/linux/man-pages/man1/rm.1.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In my experience (I have much more with Linux than with programming), only the -i flag will make it prompt when rm'ing, despite what the man page says. Since it is a git repo though, it might be necessary to use -f because of the protected files. I'll take a look tonight.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's move all noticed points to improve to separate issue/PRs .

It is better to merge this PR sooner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nmancus1 Do you still plan to do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rnveach yes, I completed it today. I just wanted to run through and test each one again before submitting PR.

@rnveach rnveach merged commit 13f067c into checkstyle:master Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants