-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
DevUI pages for Hibernate ORM #16764
Conversation
@Sanne I linked a PR with the first draft of the DevUI pages. Vision: I think the useful things to show in the DevUI could be:
Problems: In order to generate the schema via the SchemaExport tool, I need to obtain the
|
@TomasHofman ! sorry for the delay, I've been off - need to catch up on things and then I'll have a better look at this. Thanks! |
@Sanne thanks and no problem, I'm catching up on other stuff too... |
906907a
to
ed51b55
Compare
ed51b55
to
675f909
Compare
I can't comment on any of this stuff, but having a DevUI entry for Hibernate ORM with such info is an awesome idea! |
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.
It's starting to look cool :) But the ORM initialization code is a bit complex, I'll try to find some time to help with that.
I'm thinking there's a lot of functionality which we could add, but it's probably best to split it in smaller tasks.
For example, we could have:
- also the "drop" script
- a button to reset the DB state (actually runs the drop script, followed by the create and optionally the import.sql if there's any)
But IMO such additional things could be done via follow-up PRs, not least to get you some help from other people as well.
Let's focus first on the ORM boostrap changes and get the basics integrated first.
The "Names Query" table probably needs a column to show to which persistence unit it belongs; or alternatively maybe it's best to show multiple tables, one each for each PU.
...rnate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/PersistenceUnitsHolder.java
Outdated
Show resolved
Hide resolved
...java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java
Outdated
Show resolved
Hide resolved
I can squash the commits when we are done, but I will keep adding updates in separate commits for now to make it easier to review. |
Good idea, I would use the separate-table-for-each-PU approach for "Managed entities" page too, so that the pages are consistent. |
cd26682
to
7e87bb0
Compare
@TomasHofman @Sanne I pushed a commit to change how we retrieve the information: instead of being pulled at runtime, it's now generated on bootstrap. This works around all the problems related to generation of the schema after bootstrap. Theoretically it should only have an impact in dev mode (not in tests nor in production), but let's wait for the build results :) I also took the liberty of rebase this PR on the main branch since I don't think it makes sense to work on 1.13 right now, but let me know if that was a mistake. @TomasHofman I know it's been a while, but do you think you could address the remaining comments? Feel free to ping me if you need help. I believe y'all wanted to move to "one page per persistence unit", but after that's done I think it's going to be a great start and we can merge it? |
@yrodiere that sounds great. I will take a look hopefully next week when I'm back from PTO and try to move it forward. Thanks! Definitely the master branch - I had some problems with it at the time, which is why I started to work on 1.13. |
Sounds great, many thanks @TomasHofman |
7e87bb0
to
270a50c
Compare
Hello, I updated the PR with additional changes.
I think this should cover all the requested changes, apart from providing a button to reset the database, which I would leave to a follow up PR. Attaching current screenshots: |
* provide information about persistence units and their managed entities * allow user to generate create-schema script
It's only there for DevUI
270a50c
to
5bec537
Compare
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.
Thanks!
I pushed two more commits to address minor problems (one about dependencies, one about the javascript) and rebased it all on main
.
Good to merge as soon as CI finishes the build.
Awesome, many thanks @TomasHofman and @yrodiere ! Lots of people will find this useful. |
Would it be a problem to add a small test as done here: https://github.com/quarkusio/quarkus/pull/18738/files ? The idea is mostly to check we don't break the pages with a 500 at some point. |
I will have a look at the test. |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 5bec537
Full information is available in the Build summary check run. Test Failures⚙️ JVM Tests - JDK 11 Windows #📦 extensions/hibernate-orm/deployment✖
|
The import file name was not correctly handed over to the SchemaExport utility.
I added test test and a fix for a problem where the import.sql file name was not determined correctly. Waiting for CI to complete. |
@TomasHofman small detail: could we change the ordering with a comparator to get the |
Also I wonder if I wouldn't make the scripts in the persistence units view foldable (and folded by default). It sorta works for a small db but will be more challenging with a bunch of entities. I think we have an example in the score page of the RESTEasy Reactive Dev UI. I would add a simple icon to fold/unfold. It would work well with your existing UI, you could put the copy button and the folding button at the end of the |
Failing Jobs - Building 66e1b37
Full information is available in the Build summary check run. Test Failures⚙️ Native Tests - Misc4 #📦 integration-tests/gradle✖
|
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.
Let's merge this, it's a very good step forward. We can tweak things in follow-up PRs. Thanks!
Sounds like a good idea. I will create a new PR for that in couple of days after finish other work. Thanks! |
Fixes #16553