-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
review: chore: Migrate Javadoc regression script to python #4032
review: chore: Migrate Javadoc regression script to python #4032
Conversation
743fe02
to
5d80907
Compare
Ugh. Well, that's too much of a bother IMO. Unless someone says anything, let's leave it as explicitly *NIX compatible.
As this runs in CI, I would tend to say no. Maybe it'll be fine but it triggers my spidey sense pretty badly.
I don't think it's worth the bother. To my eyes it adds very little here since the output is so simple anyway. It makes the code just a little bit harder to read, and a little bit harder to edit (have to consider what color something should have). That's just my opinion and I don't feel strongly enough about it to say nay, though. If you feel like the colors add enough value to be worth it, then go ahead. |
5d80907
to
2d1c7cc
Compare
2d1c7cc
to
8880d8f
Compare
I adjusted a few things while trying it out and it should work on windows, barring the potential PATH issue. So that might be good enough for now :)
Yea, it will probably be alright but you don't exactly have to add an possible attack vector if you can help it...
I probably wrote too many weird websites and programs but I think it's quite nice and helps. I initially added color support because I was having trouble reading the plain white output at a glance. I'll leave it in there and you can always rip it out if you feel it gets a bit cumbersome. I do hope nobody will be unfortunate enough to touch this area in the near future though :P The CI in this PR here runs with my changes so you can find the output here. I probably didn't have to enable them in my fork, as I could have just looked at the output in here. |
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.
Overall it LGTM, functionality seems like what we need. Definite improvement from the bash script. I just have a few comments on the code that I think can be improved, and a few general comments that you don't really need to worry about (more as FYIs).
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 looks good to me, will merge today! Thanks for taking the time, this is much better than a bash script.
No worries, it was annoying me ;) Maybe it would be worth it to update the referenced issue #3923 a bit? Not sure if it's needed, but we still link to it and a few things have changed. It will e.g. fail to checkout if you have incompatible files:
This won't happen in CI as it doesn't edit any files here and as a user it sounded a bit nicer than bold warnings in a document you might not read. But this and a few other things might benefit from some updating. Now that I re-read the issue I think a I'll also prepare an updated version of your issue and post it in a comment here, then you can decide whether you want to use some parts of it. |
Feel free to suggest changes for the help and change what you feel is reasonable (nothing to more than listed here) in your issue comment. I hope this is finally actually ready to be merged... Sorry about that. Outdated parts of the comment: - To facilitate this, we have a script to find checkstyle errors in method Javadoc at chore/ci-checkstyle-javadoc.
+ To facilitate this, we have a script to find checkstyle errors in method Javadoc at chore/check-javadoc-regressions. The script compatibility is a bit of a mixed bag. It should work everywhere, but if you add maven and git to your user path settings it might fail on Windows. We should probably still caution against using it on plain Windows. - Bug: At the time of writing, the script doesn't work at all if you're on the master branch, so checkout to another branch to use it! It works, but it doesn't really make much sense to compare - chore/ci-checkstyle-javadoc.sh
+ chore/check-javadoc-regressions.py - but do note that running in this mode destroys uncommitted changes. So don't run it unless you've committed all changes!
+ And we might want to mention the |
Thanks @I-Al-Istannen, very nice work! I'll update the issue. |
Motivation
After #4025 we now have a python script that tries to find the new errors and a bash script that actually runs the checkstyle. This PR will try to consolidate this into a single python script that should also work on Windows.
Content
This PR will expand the regression-finding Python script to also run the checkstyle and replace the existing bash script.
Question: Paths
subprocess
on Windows is apparently pretty broken and won't scan through the full (user + system)PATH
. This might cause themvn
invocation to fail, if the user has installed maven into their userPATH
(e.g. via scoop). I couldn't find any proper workaround for this, but I could setshell=True
and pass all commands as simple strings. We control them so we should be able to avoid security vulnerabilities along the way.Question: Colors
Most terminal emulators and Github Actions (see here and here) do support ANSI escape codes (and we could disable it on windows by default). This allows us to color the output of the script to make it a bit easier to read. This is probably a bit controversial, but would you be opposed to that?
Current draft:
And if the user (likely) screwed up their maven setup: