Skip to content

TRUNK-5731: Ensure the Lucene index is upgraded#6157

Open
jwnasambu wants to merge 4 commits into
openmrs:masterfrom
jwnasambu:TRUNK-5731
Open

TRUNK-5731: Ensure the Lucene index is upgraded#6157
jwnasambu wants to merge 4 commits into
openmrs:masterfrom
jwnasambu:TRUNK-5731

Conversation

@jwnasambu

Copy link
Copy Markdown
Contributor

Description of what I changed

I moved OpenmrsUtil.startup(props) and getContextDAO().setupSearchIndex() to execute before the version change
check and Liquibase update (runCoreSetupOnVersionChange()). This ensures that the Lucene search index is properly initialized and upgraded to the current version's format before any Liquibase changes run, which might otherwise trigger Hibernate Search with an outdated index.

Issue I worked on

https://openmrs.atlassian.net/issues?filter=10641&selectedIssue=TRUNK-5731

Checklist: I completed these to help reviewers :)

  • 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

  • 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

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

    No? -> execute above command

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

  • My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

@codecov-commenter

codecov-commenter commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.40%. Comparing base (0a6d15c) to head (7d31fee).

Files with missing lines Patch % Lines
...eb/filter/initialization/InitializationFilter.java 93.33% 1 Missing and 2 partials ⚠️
...src/main/java/org/openmrs/api/context/Context.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6157      +/-   ##
============================================
+ Coverage     59.31%   59.40%   +0.09%     
- Complexity     9335     9343       +8     
============================================
  Files           695      695              
  Lines         37460    37462       +2     
  Branches       5517     5518       +1     
============================================
+ Hits          22219    22256      +37     
+ Misses        13242    13195      -47     
- Partials       1999     2011      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

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

Successfully merging this pull request may close these issues.

2 participants