openmrs-core icon indicating copy to clipboard operation
openmrs-core copied to clipboard

TRUNK-6418: Run liquibase checks and data imports only when version of core or modules changes

Open IamMujuziMoses opened this issue 2 months ago • 10 comments

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 package right 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

IamMujuziMoses avatar Oct 30 '25 16:10 IamMujuziMoses

@dkayiwa @rkorytkowski could you please review this PR, your feedback will be appreciated.

IamMujuziMoses avatar Oct 30 '25 17:10 IamMujuziMoses

@IamMujuziMoses did you actually test this out in a running openms webapp to confirm that it works?

dkayiwa avatar Oct 30 '25 22:10 dkayiwa

@dkayiwa how do you mean?

IamMujuziMoses avatar Oct 31 '25 04:10 IamMujuziMoses

What is this change supposed to accomplish?

dkayiwa avatar Oct 31 '25 10:10 dkayiwa

@dkayiwa yes, I tested this out in a running openmrs instance successfully

IamMujuziMoses avatar Nov 06 '25 19:11 IamMujuziMoses

Other than simply running the webapp, how did you test that these changes do what they are supposed to?

dkayiwa avatar Nov 06 '25 21:11 dkayiwa

@dkayiwa, I have tried to screen record the process, hope these videos help in explaining a bit, they're not very clear, apologies:

  • The first video shows initial startup run, upload test module and a startup without any module version or core version changes.
  • The second video shows a startup with module version and core version changes and a startup with force.setup GP.

IamMujuziMoses avatar Nov 14 '25 17:11 IamMujuziMoses

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 avatar Nov 28 '25 12:11 rkorytkowski

@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.

IamMujuziMoses avatar Nov 28 '25 18:11 IamMujuziMoses

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.

rkorytkowski avatar Dec 09 '25 12:12 rkorytkowski

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.

rkorytkowski avatar Dec 16 '25 12:12 rkorytkowski

Replaced by https://github.com/openmrs/openmrs-core/pull/5603

rkorytkowski avatar Dec 16 '25 13:12 rkorytkowski