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

Upgrade to Micronaut 4 #289

Closed
wants to merge 20 commits into from
Closed

Conversation

jeremyg484
Copy link
Contributor

@jeremyg484 jeremyg484 commented Sep 12, 2023

I have made some significant progress towards migrating the blueprint to JHipster 8 Beta 3 and Micronaut 4, but it is still very rough and there is quite a bit of work that will yet need to be done. At the moment, I have other Micronaut work that will need to take priority, but I wanted to go ahead and get this pushed up as a starting point for anyone who may be interested in taking up the work and making further progress.

I have marked the PR as a draft for now since it is still rather incomplete. The ideal thing to do might be to merge this work into a public jhipster 8 feature branch rather than leaving it hanging here in this PR, in order to make it easier for anyone else interested to collaborate. Let me know what ya'll would prefer and I can change the PR settings accordingly.

The current status:

  • The generators run successfully and essentially the same Java code from the v2.0.0 blueprint - but updated to work with Micronaut 4 - gets generated and will compile with Maven. I have been testing using just mhipster jdl default for the moment. Just getting to this baseline with JHipster 8 proved to be quite a bit of work, but I think further updates will be easier now that this foundation is in place.

Futher work that needs to be done:

  • Fully merge the Micronaut 4 Gradle configuration with the latest JHipster Gradle config. The generated Gradle files have been updated for Micronaut 4, but are still based on the JHipster 7 config.

  • Restore the blueprint-specific CLI prompts - I had temporarily disabled them in the process of upgrading to JHipster 8.

  • Get an actual running app working. :) I've been focused on just getting the basic output (equivalent to the JHipster 7 version) correct and haven't been testing the full running application. There is much to be done there, I think, to get everything fully functional and bring it to parity with the default JHipster 8 apps. I suspect there is a good bit more refactoring that will need to be done to the code that is being generated.

I will need to turn my attention to other Micronaut projects for the time being, but for anyone who is interested in trying to make further progress, I will keep an eye on things here and will be happy to chime in if any guidance is needed specific to the details of Micronaut.

@mraible mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels Sep 14, 2023
@mraible
Copy link
Contributor

mraible commented Sep 14, 2023

Added a bug bounty to try and move this along.

@mshima Do blueprint changes need to be made for v8? If so, is there a guide I can use to make those changes?

@mshima
Copy link
Member

mshima commented Sep 18, 2023

@mraible documentation is been written in jhipster/generator-jhipster#23305.
I don’t recommend doing both, micronaut 4 and v8 together.
Some tasks:

  • update to main, the newly exported test utilities are quite useful.
  • need to drop entity-* generators.
  • adjust files that are reused.
  • maybe export generator-jhipster files.

We should cherry-pick last commit and start from there.

@mshima
Copy link
Member

mshima commented Sep 18, 2023

I will take a look.

@DanielFran DanielFran changed the title Upgrade to JHipster 8 + Micronaut 4 Upgrade to Micronaut 4 Sep 21, 2023
@mraible
Copy link
Contributor

mraible commented Sep 27, 2023

Conflict time!

@jeremyg484
Copy link
Contributor Author

jeremyg484 commented Sep 28, 2023

Conflict time!

Yes, indeed @mraible . I see @mshima has been quite busy! It looks like the important bits for upgrading to JHipster 8 have been merged from this branch already and then much more work already done to get everything up and running using the existing Micronaut 3.10 back-end bits. Awesome!

It seems to me that a fresh start (a new branch based of the new main with all of @mshima's updates) is warranted for the Micronaut 4 upgrade part, perhaps cherry-picking some more of the server template bits from this branch as needed (my updates to MailService to convert it to using Micronaut Mail come to mind as a candidate for that).

I will see if I can carve out some time for that sometime in the next few weeks.

In the meantime, if anyone else is eager to tackle it, the best workflow I can recommend would be to take the Micronaut 3.10 backend that is being generated and run our OpenRewrite recipes on it (they should get you at least 95% of the way there - I think there is something they miss due to some peculiarities with your build files, but forget what it was off the top of my head), get the app back into a running state, and then reverse-engineer the necessary template changes from there.

See https://micronaut.io/2023/07/14/upgrade-to-micronaut-framework-4-with-openrewrite-and-gradle/ and https://micronaut.io/2023/07/14/upgrade-to-micronaut-framework-4-with-openrewrite-and-maven/ for the OpenRewrite instructions, and https://micronaut.io/2023/05/09/upgrade-to-micronaut-framework-4-0-0/ for the manual approach (good for understanding the upgrade process and catching anything missed by the recipes).

@mraible
Copy link
Contributor

mraible commented Nov 3, 2023

@jeremyg484 What's your workload like these days? I'm happy to try and fix this or collaborate with you on it. Please let me know your preference!

@jeremyg484
Copy link
Contributor Author

@jeremyg484 What's your workload like these days? I'm happy to try and fix this or collaborate with you on it. Please let me know your preference!

@mraible Sorry, I just noticed the notification for this. I've still got my hands pretty full with other Micronaut stuff at the moment. I'll have to discuss it within the foundation first, but perhaps I can make some time after we get 4.2.0 out. That said, no guarantees at the moment as far as my being able to primarily drive this imminently, so if you'd like to go ahead and take the lead, I can definitely keep my eye on things and make myself available to provide any feedback and guidance as needed.

@atomfrede
Copy link
Member

I can try to fix conflicts and move it forward. First wanted to try the current state based on jh7 and if we can make native images work.

@mshima
Copy link
Member

mshima commented Nov 8, 2023

@atomfrede is there a reason for use jh7 instead of jh8 support that landed in main?

@atomfrede
Copy link
Member

atomfrede commented Nov 8, 2023 via email

@mraible
Copy link
Contributor

mraible commented Nov 29, 2023

@atomfrede Do you have time to resolve the conflicts in this PR? If you don't, I can take a look on Friday.

@atomfrede
Copy link
Member

Sorry @mraible pretty sure I don't have enough time till next week.

@atomfrede
Copy link
Member

@mraible Did you start already? If not I can have a look on tuesday or wednesday evening

@mraible
Copy link
Contributor

mraible commented Dec 3, 2023

I haven't started, but I should have time in the next 24 hours.

@mraible
Copy link
Contributor

mraible commented Dec 4, 2023

@atomfrede @jeremyg484 @mshima I just finished merging main into micronaut-4. Please let me know if you see any issues.

@atomfrede
Copy link
Member

I will try it when the children are sleeping.

@atomfrede
Copy link
Member

@mraible I tried codespaces, but it seems I can't push changes to @jeremyg484 branch. How did you manage to update the PR?

Anyways, I have changed following, which might help to fix maven compilation errors at least

mn.patch.txt

@mraible
Copy link
Contributor

mraible commented Dec 4, 2023

@atomfrede I committed and pushed your changes. I was able to update the PR by adding a jeremy remote for [email protected]:jeremyg484/generator-jhipster-micronaut.git and then pushing to it with git push jeremy micronaut-4.

@atomfrede
Copy link
Member

Usually I do that too, but this time I tried devcontainers :) Maybe not a good idea

@mraible
Copy link
Contributor

mraible commented Dec 5, 2023

I noticed tonight that the logo isn't working.

Screenshot 2023-12-04 at 6 04 27 PM

@mshima
Copy link
Member

mshima commented Dec 5, 2023

I don't have permission in this repo. I will create a new PR.

@mshima mshima mentioned this pull request Feb 21, 2024
@mraible mraible closed this in #295 Feb 21, 2024
@mshima
Copy link
Member

mshima commented May 20, 2024

@mraible @atomfrede @jeremyg484 I am not sure how we should split this bounty.

@mraible
Copy link
Contributor

mraible commented May 20, 2024

I don't feel like I did a whole lot on this one, so I'm happy to remove myself from the bounty. My feeling is that @jeremyg484 did a lot of work to get things to work with Micronaut 4 and @mshima did a lot to get it upgraded to JHipster 8. I might be wrong.

@jeremyg484
Copy link
Contributor Author

@mraible @mshima I'd be happy to remove myself as well since I was working on this as part of my paid engineering duties on the Micronaut team.

@atomfrede
Copy link
Member

Same here, I think I did not very much to be honest (at least I can't remember any significant stuff).

@mshima
Copy link
Member

mshima commented Dec 28, 2024

@DanielFran
Copy link
Member

@mshima approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants