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
TRUNK-4830 Avoid running legacy liquibase changesets #2712
Conversation
api/src/test/java/org/openmrs/util/LiquibaseVersionFinderTest.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/openmrs/util/databasechange/Database1_9_7UpgradeIT.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/openmrs/util/databasechange/DatabaseUpgradeTestUtil.java
Show resolved
Hide resolved
1b2089b
to
8c7b65c
Compare
8c7b65c
to
e2e9ed0
Compare
api/src/test/java/org/openmrs/util/databasechange/Database1_9_7UpgradeIT.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/openmrs/util/databasechange/Database1_9_7UpgradeIT.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/openmrs/util/databasechange/Database1_9_7UpgradeIT.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/openmrs/util/databasechange/Database1_9_7UpgradeIT.java
Outdated
Show resolved
Hide resolved
e2e9ed0
to
1e48d70
Compare
@WolfSchlegel great to see you resume working on this. 😊 |
edd560a
to
b00a9c5
Compare
Hey there, I fixed all review comments but one, rebased upstream master and created new liquibase snapshot files for OpenMRS 2.2.x. Could you please resume the review? In the meantime I look into the pending fix of the comment on the datatype in DatabaseUpgradeTestUtil.java. Thanks, |
Also, some pom files fail the security.snyk check but I cannot view the details. Snyk says: "Unable to display this organization. The organization does not exist, or you do not have permissions to access it." Could you please have a look at the reported vulnerability and let me know what it is about? Thank you, |
That sounds doable enough, in particular changing the commit message :). Regarding the old modify column jar, let me see if that is actually needed at all in the Come to think of it, I guess I copied everything in the pom file that had liquibase in its name into the |
2d95a98
to
1a049a0
Compare
* **not to add demo data** in step 3 of the installation wizard | ||
|
||
#### Step 3 - Create a snapshot of the OpenMRS schema | ||
cd <some root folder>/openmrs-core/liquibase |
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.
Do you remember how long this command took to finish on your computer? For me, it takes around 3hours. Is that the expected time frame?
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.
No, definitely not for hours, I need to re-run this when removing the old jar files from the pom.xml but it was maybe some 10 minutes.
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.
What kind of machine are you using pls?
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.
MacBook Pro (Retina, 15-inch, Mid 2015)
Processor 2.8 GHz Intel Core i7
Memory 16 GB 1600 MHz DDR3
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.
~/Projects/OpenMRS/code10/openmrs-core/liquibase(TRUNK-4830-N) $ mvn -DoutputChangelogfile=liquibase-schema-only-SNAPSHOT.xml -Dusername=root -Dpassword=Admin123 liquibase:generateChangeLog
[INFO] Scanning for projects...
[INFO]
...
[INFO] changeSets count: 881
[INFO] ../api/src/main/resources/liquibase-schema-only-SNAPSHOT.xml does not exist, creating and adding 881 changesets.
[INFO] Output written to Change Log file, ../api/src/main/resources/liquibase-schema-only-SNAPSHOT.xml
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2020-05-12T17:44:02+02:00
[INFO] ------------------------------------------------------------------------
~/Projects/OpenMRS/code10/openmrs-core/liquibase(TRUNK-4830-N) $ mvn -DdiffTypes=data -DoutputChangelogfile=liquibase-core-data-SNAPSHOT.xml -Dusername=root -Dpassword=Admin123 liquibase:generateChangeLog
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< org.openmrs.liquibase:openmrs-liquibase >---------------
[INFO] Building openmrs-liquibase 2.4.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- liquibase-maven-plugin:3.8.9:generateChangeLog (default-cli) @ openmrs-liquibase ---
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO]
[INFO] Liquibase Community 3.8.9 by Datical
[INFO] Starting Liquibase at Tue, 12 May 2020 17:46:53 CEST (version 3.8.9 #73 built at Mon Apr 06 09:32:58 UTC 2020)
[INFO] Executing on Database: jdbc:mysql://127.0.0.1:3306/openmrs
[INFO] Generating Change Log from database root@localhost @ jdbc:mysql://127.0.0.1:3306/openmrs (Default Schema: openmrs)
[INFO] changeSets count: 27
[INFO] ../api/src/main/resources/liquibase-core-data-SNAPSHOT.xml does not exist, creating and adding 27 changesets.
[INFO] Output written to Change Log file, ../api/src/main/resources/liquibase-core-data-SNAPSHOT.xml
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.047 s
[INFO] Finished at: 2020-05-12T17:46:56+02:00
[INFO] ------------------------------------------------------------------------
~/Projects/OpenMRS/code10/openmrs-core/liquibase(TRUNK-4830-N) $
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.
01:30 minutes for schema-only and 3 seconds for core-data.
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.
And it worked well w/o the legacy libraries, so I can remove them from the module's pom file.
@dkayiwa please hold your fire before you re-run the generation of snapshots for a few minutes and use the next commit.
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.
The update is out, without the old modify column jar (which ticks the second box on @ibacher 's list)
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.
Re hardware I am using an 2018 Macbook Pro, the 2015 model should be perfectly ok.
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.
A few colleagues of mine had tested the generation of snapshots and they would have let me know if it had taken ages for them...
1a049a0
to
a62b5f7
Compare
@dkayiwa I just received your questions about the
Messages must have overlapped, I had removed the dependency yesterday from So all should be good now with respect to that task, there are no references to that liibrary left. |
@WolfSchlegel am referring to the |
@dkayiwa got you, could you please let me know the steps of your test? Me and a colleague of mine found that bug independently when testing the 2.2.x -> 2.4.x scenario. I would then validate your steps on my side. |
@WolfSchlegel in did a fresh installation of platform 2.2.x, which i later on upgraded to 2.4.x |
Ok, manually deleting the lucene folder is something we did not do.
What happens if the dependency is there AND folder is not deleted? The application starts and I would assume it continues to use the old lucene folder. |
@WolfSchlegel i have tested again and confirmed that without deleting the |
@dkayiwa that sounds good, so we have consistent behaviour. Are you ok with leaving the |
@WolfSchlegel yes, leaving the |
Nice, it looks the end is near... Did you figure out why the creation of the snapshots took so long on your machine? |
I did not figure that out. But since you and colleagues reported a different result, and given the fact that running this snapshot creation process is rarely done, i ignored it. 😊 |
Cool. Anything else I should look into? Or are we done (I scarcely dare to ask...) |
@WolfSchlegel did you say that you would rather the log level stay as INFO instead of ERROR? |
Yes, for the time being and for the new class As a follow up to this story I am planning to refactor the InitialisationFilter and UpdateFilter, when that is done we could reduce the log level. How does that sound? |
@WolfSchlegel Maybe we could just have the |
Sounds cool. 👍 |
Though i have no objection to @ibacher's proposal. 😊 |
I just noticed that we already have this: https://github.com/openmrs/openmrs-core/blob/master/webapp/src/main/resources/log4j2.xml#L37 |
Heh... I forgot about that... That probably works then. |
@WolfSchlegel do we still need one for ChangeLogDetective given this? https://github.com/openmrs/openmrs-core/blob/master/webapp/src/main/resources/log4j2.xml#L37 |
I would say yes, as Happy to change the logger to log to |
Ok you can go ahead and log to org.openmrs.api |
…pshots for initialisation of OpenMRS database and upgrade liquibase-core to 3.8.9
a62b5f7
to
9dc36ba
Compare
Pushed the change, the class Please let me know if anything else needs to be done. If not I would like to thank you for a thorough and enjoyable review season, I learned quite a few things and look forward to the next ticket. |
…nitialisation of OpenMRS database and upgrade liquibase-core to 3.6.1
Description of what I changed
Add Liquibase Maven Plugin 3.6.1, introduce Liquibase snapshots for initialisation of OpenMRS database and upgrade liquibase-core to 3.6.1
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-4830
Checklist: I completed these to help reviewers :)
My pull request only contains ONE single commit
(the number above, next to the 'Commits' tab is 1).
No? -> read here on how to squash multiple commits into one
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 andadded 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