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

test entities don't get enhanced after upgrade to 13.6.5 #2889

Closed
Incanus3 opened this issue Nov 15, 2022 · 14 comments
Closed

test entities don't get enhanced after upgrade to 13.6.5 #2889

Incanus3 opened this issue Nov 15, 2022 · 14 comments
Assignees
Milestone

Comments

@Incanus3
Copy link
Contributor

Incanus3 commented Nov 15, 2022

Sorry to bother again, but after resolving #2888 we encountered another problem with the upgrade to 13.6.5.

Expected behavior

enhance test entities correctly

Actual behavior

DatabaseFactory.create() call fails with BeanNotEnhancedException

Steps to reproduce

Notes

@Incanus3
Copy link
Contributor Author

just for completeness, the query beans and _Ebean$ModuleInfo seem to be generated correctly and the entity-packages value in ebean-generated-info.mf is also correct. it's only the entity enhancement itself that seems broken.

@Incanus3
Copy link
Contributor Author

maybe I found the source of the problem - shouldn't this line https:/ebean-orm-tools/ebean-gradle-plugin/blob/master/src/main/groovy/io/ebean/gradle/EnhancePlugin.groovy#L112 also check for 'compileTestKotlin'? that would explain why this works with kotlin 1.6, because there the task still subclasses AbstractCompile.

@Incanus3
Copy link
Contributor Author

btw the fact that compileTestFixtures(Java|Kotlin|...) isn't in supportedCompilerTasks (and the kotlin variant also in the check mentioned in my previous comment) also explains why enhancement doesn't work for test fixtures, right?

@Incanus3
Copy link
Contributor Author

I checked this by adding the ebean-gradle-plugin to my local buildSrc and making the aforementioned change there and it indeed fixes the problem. This can be seen in this branch Incanus3/ebean-test@main...fix-test-fixture-enhancement-locally and specifically this commit Incanus3/ebean-test@d6bba45, which fixes the test

@Incanus3
Copy link
Contributor Author

I have also opened a PR here ebean-orm-tools/ebean-gradle-plugin#34

@jnehlmeier
Copy link

Yes that seems to be the reason. Generally the Gradle plugin needs some love to support configuration avoidance and to make it iterate through all source sets to configure them (then java-text-fixture plugin would have worked).

@Incanus3
Copy link
Contributor Author

ok, so is there anything else I can do at this stage, or is my PR acceptable as it is for now?

@Incanus3
Copy link
Contributor Author

btw before this gets fixed and released in upstream, is it ok if I temporarily add the plugin source code to our (commercial) project's buildSrc, or does that somehow break the licensing laws? I'll of course keep the license file there, but I don't see any authoring comments in the source files.

@rbygrave
Copy link
Member

is it ok if I temporarily add the plugin source code to our (commercial) project's buildSrc

Yes you can, its standard Apache2 license and yes you can copy and redistribute source with the usual Apache2 license restrictions on copyright, patent, etc.
https:/ebean-orm-tools/ebean-gradle-plugin/blob/master/LICENSE

In a similar way of thinking you can have and maintain your own private fork or public fork.

@Incanus3
Copy link
Contributor Author

ok, thanks for the reply. and I see you've already merged my PR, so thanks again. btw, do you already have some timeline for the 13.10.2 release?

@rbygrave rbygrave self-assigned this Nov 21, 2022
@rbygrave rbygrave added this to the 13.10.2 milestone Nov 21, 2022
@rbygrave
Copy link
Member

Fixed with ebean-gradle-plugin 13.10.2 via ebean-orm-tools/ebean-gradle-plugin#34

@rbygrave
Copy link
Member

timeline for the 13.10.2 release?

Just released. Should be in central in about 15 minutes.

@Incanus3
Copy link
Contributor Author

you're amazing. just upgraded and everything works like a charm. the local buildSrc copy of the patched plugin didn't even make it to master ;). also appreciate the platforms added to the BOM. thanks again so much for the great work you're doing.

@rbygrave
Copy link
Member

Thanks. It's great to get positive feedback and know that people appreciate the work that goes into this project.

Cheers, Rob.

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

No branches or pull requests

3 participants