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

Feature/liquibase configuration #340

Draft
wants to merge 65 commits into
base: master
Choose a base branch
from

Conversation

dixyushi
Copy link
Contributor

@dixyushi dixyushi commented Feb 5, 2021

I have resolved the issue(i.e. Consider liquibase #303). In that I have changed the configuration of flyway into liquibase.

@dixyushi dixyushi added the bug Something isn't working label Feb 5, 2021
@dixyushi dixyushi added this to the release:2021.04.001 milestone Feb 5, 2021
@hohwille hohwille linked an issue Feb 8, 2021 that may be closed by this pull request
2 tasks
@hohwille hohwille added common Cross cutting stuff configuration config files (application.properties, etc.) dataaccess data-access layer (persistence, etc.) enhancement New feature or request template maven-archetype to create new application. and removed bug Something isn't working labels Feb 8, 2021
@hohwille
Copy link
Member

hohwille commented Feb 12, 2021

FYI: I typically do not start reviews before PRs are up-to-date with master and CI is succeeding.
I guess you have seen already in travis logs that we have integrated deeper with flyway so you need to add some switches there:

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project app-with-batch-batch: Compilation failure: Compilation failure: 

[INFO] [ERROR] /home/travis/build/devonfw/devon4j/templates/server/target/test-classes/projects/batch/project/app-with-batch/batch/src/test/java/it/pkg/general/batch/base/test/SpringBatchIntegrationTest.java:[5,25] package org.flywaydb.core does not exist

[INFO] [ERROR] /home/travis/build/devonfw/devon4j/templates/server/target/test-classes/projects/batch/project/app-with-batch/batch/src/test/java/it/pkg/general/batch/base/test/SpringBatchIntegrationTest.java:[24,11] cannot find symbol

[INFO] [ERROR]   symbol:   class Flyway

[INFO] [ERROR]   location: class it.pkg.general.batch.base.test.SpringBatchIntegrationTest

So please fix CI and merge master with your feature-branch (there are conflicts, otherwise I would have done it for you here on github UI)...

@hohwille
Copy link
Member

@dixyushi can you fix the merge conflicts and bring this PR to a "ready for review" state?

@hohwille hohwille removed this from the release:2021.04.001 milestone Apr 20, 2021
@dixyushi dixyushi marked this pull request as draft June 3, 2021 06:49
</plugins>
</pluginManagement>
</build>
</project>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have restored the file but still it is showing in files changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current pom.xml has linux EOL style:

cat -ben pom.xml
     1	<?xml version="1.0" encoding="UTF-8"?>$
     2	<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"$
     3	  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">$
     4	  <modelVersion>4.0.0</modelVersion>$
....

Yours has windows encoding. Maybe something with your git setup or the editor you are using to edit XML files.

cat -ben pom.xml.ayushi
     1	<?xml version="1.0" encoding="UTF-8"?>^M$
     2	<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"^M$
     3	  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">^M$
     4	  <modelVersion>4.0.0</modelVersion>^M$
...

We once had such changes that added a Byte-Order-Mark to a pom.xml that was not easily visible in the diff but broke the release as maven pull-parser can not handle BOM. That is why am a little picky about such things.

<module>server</module>
</modules>
</project>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have restored the file here too but still it is showing in files changed.

@dixyushi dixyushi marked this pull request as ready for review June 4, 2021 08:15
@@ -8,7 +8,7 @@
public class TestCleanerPluginNone implements TestCleanerPlugin {

@Override
public void cleanup() {
public void cleanup() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not do this. Please use RuntimeExceptions and avoid checked exceptions wherever possible:
https://github.com/devonfw/devon4j/blob/develop/documentation/guide-exceptions.asciidoc

Also we can not afterwards change APIs in an incompatible manner:
Existing projects would get compiler errors after upgrading devon4j when you do this change.

Comment on lines 31 to 35
#if($dbMigration == 'flyway')
testCleanerPlugin = new TestCleanerPluginFlyway();
#else if($dbMigration == 'liquibase')
testCleanerPlugin = new TestCleanerPluginLiquibase();
#end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testCleanerPlugin is already annotated with @Inject.
So we do we manually have to initialize it here?
IMHO this does not make sense.

Comment on lines 38 to 41
}
catch(Exception exception) {
LOG.error("Exception occurred while performing cleanup", exception);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what happens due to this checked exception...
Please remove the checked exception and then also this try catch around the cleanup. Catching and further ignoring errors is not a good style if no reasonable compensation of the error can be done.


private Flyway flyway;

private TestCleanerPlugin testCleanerPlugin;
Copy link
Member

@hohwille hohwille Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use @Inject. You should get familiar with DI when doing Java coding in devon4j:
https://github.com/devonfw/devon4j/blob/master/documentation/guide-dependency-injection.asciidoc

@dixyushi dixyushi marked this pull request as draft June 8, 2021 14:00
@hohwille
Copy link
Member

@hohwille hohwille modified the milestones: release:2021.04.003, release:2020.12.004 Jun 25, 2021
@hohwille hohwille removed this from the release:2020.12.004 milestone Jul 20, 2021
@hohwille
Copy link
Member

This issue seems state.
How should we proceed here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Cross cutting stuff configuration config files (application.properties, etc.) dataaccess data-access layer (persistence, etc.) enhancement New feature or request template maven-archetype to create new application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider liquibase
4 participants