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

DRAFT: Tracking of changes from 'hazendaz' which will be managed via smaller pull requests #1120

Closed
wants to merge 8 commits into from

Conversation

hazendaz
Copy link
Contributor

@hazendaz hazendaz commented Dec 2, 2023

In an effort to get rid of libraries coming into code bases that are long obsolete, coming here to the source for us to clear these out. This is somewhat big pull request. Each item has been constructively broken down into individual commits. All tests continue to pass. This can be further broken down if wished into smaller PRs.

General list of items

  • Maven cleanup work
  • Use only powermock instead of jmockit (I'm currently the maintainer of jmockit and highly suggest this)
  • Update all libraries
  • Update all plugins
  • Add GHA for java 17 and 21 along with support on add opens to allow processing of framework.

As to powermock, it is obsolete too except for its whitebox which is still extremely useful but there is no activity there. If this goes well, I don't mind upgrading this repo to junit 5 jupiter as well with mockito and replacing all the major parts of powermock as well. As to extra throws with powermock reflect, that is sort of needed here since jmockit, since I toke it over, does not yet have deencapsulation back (but that is in flight) and it should only be considered maintenance anyways. While there are other solutions out there, powermocks whitebox still seems best there and it can be isolated to just that module rather than how it is today. Other than that, I think rest would be fairly modern here, still java 8 compatible, and now shows java 21 compatibility.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.51%. Comparing base (019385d) to head (38f697f).
Report is 5 commits behind head on master.

Current head 38f697f differs from pull request most recent head e5c7160

Please upload reports for the commit e5c7160 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1120      +/-   ##
============================================
+ Coverage     98.27%   98.51%   +0.24%     
+ Complexity      565      561       -4     
============================================
  Files            55       55              
  Lines          1214     1209       -5     
  Branches        105      105              
============================================
- Hits           1193     1191       -2     
+ Misses           10        7       -3     
  Partials         11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@damianszczepanik
Copy link
Owner

This is great job to have it merged. Can you split this into smaller PR so I can easily review them one by one ?

@hazendaz
Copy link
Contributor Author

hazendaz commented Dec 9, 2023

Thanks, will be maybe a week to get back to this but will break it up for you in smaller commits.

@hazendaz
Copy link
Contributor Author

keeping open for moment but splitting out into smaller PRs as noted as well as rebased against master.

@hazendaz
Copy link
Contributor Author

@damianszczepanik For now I sent as much to review as feasible for the moment. Some of what I did not send requires some of the other items to be in place. If you could review those when you have time, as merged I will rebase this branch until such time its cleared out. Its otherwise just for reference now. When done, I'll move forward and upgrade to full junit 5 jupiter here too.

I did see you added dependabot, I would suggest Renovate as a much better alternative. Dependabot will still get used in some regard for security alerts but Renovate now also supports those too and dependabot will fail to find all. If not familar with Renovate, please check out this repo of mine that has a lot of PRs on it as well as a dependency issue tracker that shows what the repo has going on. Its a more advanced config setup as I'm getting ready to split that said repo between javax and jakarta namespaces so I have it running twice on 2 different branches for that longer term need. Renovate dashboard psi-probe/psi-probe#2205 and see open PRs https://github.com/psi-probe/psi-probe/pulls to get an idea on how that one works.

@hazendaz
Copy link
Contributor Author

You can find renovate in the marketplace!

@hazendaz hazendaz force-pushed the master branch 2 times, most recently from d4e0f7c to f2c9ab8 Compare December 26, 2023 22:26
@@ -8,6 +8,7 @@ on:

jobs:
build:
if: github.repository_owner == 'damianszczepanik'
Copy link
Owner

Choose a reason for hiding this comment

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

I like this one, can you move it to separate branch and merge with comment d6281b4 so we can test it?

@hazendaz hazendaz force-pushed the master branch 2 times, most recently from 143ee09 to 1633776 Compare December 28, 2023 18:12
@@ -36,7 +36,7 @@ public void getWebPage_ReturnsFailureReportFileName() {
}

@Test
public void prepareReport_AddsCustomProperties() {
void prepareReport_AddsCustomProperties() {
Copy link
Owner

Choose a reason for hiding this comment

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

why public is unwanted for every signature ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See from junit 5 comment on stack overflow https://stackoverflow.com/questions/55215949/why-junit-5-default-access-modifier-changed-to-package-private

All the various scanners at this point flag these. For example, I use sonarlint, it flags most of it, it misses a few that are also unnecessary but does for the bulk of them. Also when running tools like openrewrite, it will also do the same. As junit states, its not forced but its preferred. Back with junit 4 and before they had to have them public, it would not work otherwise, now it doesn't matter except in odd case where someone would want to see static analysis scanning complaining for not following suite with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do have to admit it is hard to get use to. I've been writing junit 5 since it was still in beta and migrated so many repos by hand that I now appreciate the reason its done this way as well as all the tools now can handle it for us when coming from older versions.

@hazendaz hazendaz force-pushed the master branch 3 times, most recently from 772d96e to 2bd927b Compare January 2, 2024 03:24
@hazendaz hazendaz marked this pull request as draft January 13, 2024 19:46
@hazendaz hazendaz changed the title Use only non deprecated libraries DRAFT: Tracking of changes from 'hazendaz' which will be managed via smaller pull requests Jan 13, 2024
hazendaz added 8 commits May 29, 2024 13:29
An impossible default to use a switch here is not remotely valuable as its impossible to reach without completely replacing the enum as was done in the tests to solve for non existent default throws.  That hack lights up the IDE's as the class is entirely duplicated.  After enough stack overflows on this then finally reading a write up from the original creator of Jmockit that it was a wrong solution, just wrote it correctly.

In other words, there are 2 enums.  Its either one or the other.  It cannot be something else.  Therefore, it doesn't need a switch statement.  It should only be an 'if' statement.  If it later becomes more, it could change but not seeing why now or why a about 10 year old hack suggested then contested was used here.  Personally I prefer my IDE to be free of errors ;)
@hazendaz
Copy link
Contributor Author

going to close this one as it was for tracking and these can start coming in normally at this point.

@hazendaz hazendaz closed this May 29, 2024
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.

2 participants