TRUNK-6418: Run liquibase checks and data imports only when version of core or modules changes
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-6418
Checklist: I completed these to help reviewers :)
-
[x] My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend -
[x] I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend -
[x] I ran
mvn clean packageright before creating this pull request and added all formatting changes to my commit.No? -> execute above command
-
[x] All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
-
[x] My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master
@dkayiwa @rkorytkowski could you please review this PR, your feedback will be appreciated.
@IamMujuziMoses did you actually test this out in a running openms webapp to confirm that it works?
@dkayiwa how do you mean?
What is this change supposed to accomplish?
@dkayiwa yes, I tested this out in a running openmrs instance successfully
Other than simply running the webapp, how did you test that these changes do what they are supposed to?
@dkayiwa, I have tried to screen record the process, hope these videos help in explaining a bit, they're not very clear, apologies:
Thanks @IamMujuziMoses and I'm sorry for getting back to you after that long. I was away... Please let me know if you are able to work on it within the next week or else I'll take it over and finish up.
@rkorytkowski No worries at all, welcome back! Thanks for the review and Yes, I can work on it within the next week. I’ll keep you updated as I progress.
Thank you! I made a few minor adjustments, because I still saw some some Liquibase updates being chceked by core in startup logs. My follow up fixes are in https://github.com/rkorytkowski/openmrs-core/commit/8075bd62513ba1107c1ceccab79c2bd857362634
However, I did test the approach with the new StartupPerformanceIT and the changes didn't result in startup time improvement...
[INFO] Running org.openmrs.StartupPerformanceIT
Dec 09, 2025 12:23:45 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
INFO - StartupPerformanceIT.compareStartupPerformance(195) |2025-12-09T12:50:18,138| openmrs/openmrs-reference-application-3-backend:3.6.x started up in 38s, while openmrs/openmrs-reference-application-3-backend:2.8.x-local started up in 44s with the latter starting slower by 5s
[WARNING] Tests run: 3, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 1593 s -- in org.openmrs.StartupPerformanceIT
We may decide to apply only a portion of these changes to the master i.e. introducing new ModuleActivator methods. I need to re-run the app with a profiler and update our approach to startup performance after updating to java 17, which already gave a significant startup performance boost.
I made a few further tweaks and fixed tests to exclude container creation time (measure only actual startup time) and it did result in startup time improvement. I still have a small issue with gp not being persisted correctly in one of tests... Once fixed I'll merge it in.
Replaced by https://github.com/openmrs/openmrs-core/pull/5603