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

Extension for Flyway #1575 #1649

Merged
merged 1 commit into from
Apr 2, 2019
Merged

Conversation

cristhiank
Copy link
Contributor

see #1575

@gsmet
Copy link
Member

gsmet commented Mar 23, 2019

@cristhiank please squash your commits to have an atomic one. Thanks.

@cristhiank
Copy link
Contributor Author

@gsmet ok, done and pushed 👍

@fbricon
Copy link
Contributor

fbricon commented Mar 23, 2019

copyright headers should prolly use 2019 by now ;-)

@cristhiank
Copy link
Contributor Author

@fbricon Sorry for the copy-paste on that 😅

Copy link
Member

@stuartwdouglas stuartwdouglas left a comment

Choose a reason for hiding this comment

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

Looks good, except for those few minor things I mentioned

@cristhiank
Copy link
Contributor Author

Thanks @stuartwdouglas, I made the changes and pushed again.

@stuartwdouglas
Copy link
Member

You will also need to rebase this on upstream master, looks like there are conflicts.

@cristhiank
Copy link
Contributor Author

@stuartwdouglas rebased and pushed again, thanks!

@cristhiank
Copy link
Contributor Author

@stuartwdouglas looks like extension modules naming has changed ? -runtime is removed and -deployment was added to the deployment artifactId ? I already did it in the last commit but don't know if it is ok

@cristhiank
Copy link
Contributor Author

I need some help here. When I rebased to master, the integration test fails because of a maven enforcer rule.

The org.apache.commons:commons-lang3 dependency is converging to different versions.
But I'm using the project pom.xml files without touching them. What could I do here?

image

@cristhiank
Copy link
Contributor Author

Ok, I just found that it has to be excluded from the integration test pom.xml

@cristhiank cristhiank force-pushed the flyway-extension branch 2 times, most recently from 01e92be to 72d7e46 Compare March 26, 2019 15:43
@Sanne
Copy link
Member

Sanne commented Mar 26, 2019

looks like extension modules naming has changed ? -runtime is removed and -deployment was added to the deployment artifactId ? I already did it in the last commit but don't know if it is ok

right, sorry about that! That has long been the intention but it required a lot more work on all build tools - finally done - so don't worry it will never happen again :)

@cristhiank
Copy link
Contributor Author

Thanks @Sanne, I see a lot of activity in the master branch 😅
The latest pushed version is working now. Let me know if any change is required.

@gsmet
Copy link
Member

gsmet commented Mar 26, 2019

@cristhiank minor nitpicking: could you move the substitutions to a io.quarkus.flyway.runtime.graal package (i.e. just have a graal subpackage for substitutions)?

That would be more consistent with the rest of the code.

Copy link
Member

@Sanne Sanne left a comment

Choose a reason for hiding this comment

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

I think it's almost ready. I've pointed out a couple of very minor things.

What about documentation, would you like to include those in this same PR or should we do those later? I'm open to help on that as well.

@cristhiank
Copy link
Contributor Author

@Sanne sure, I will work in the docs too. And the changes you and @gsmet requested.

@Sanne
Copy link
Member

Sanne commented Mar 26, 2019

awesome 👍 thanks

@cristhiank
Copy link
Contributor Author

@Sanne I pushed the latest changes already rebased with upstream/master . Also added a basic guide/docs, let me know what you think.

@cristhiank
Copy link
Contributor Author

cristhiank commented Mar 28, 2019

I need some orientation with the deployment/runtime modules concepts. Wich one is supposed to be used by the users ? Both ? I ask this because the integration test I made fails if I change the quarkus-flyway-deployment to quarkus-flyway (runtime module)

@Sanne
Copy link
Member

Sanne commented Mar 29, 2019

hi @cristhiank , sorry for the delay. To answer your question: yes after the recent changes in our build system, end users should only depend on the "runtime" artifacts.

The "deployment" artifact is automatically fetched by the Quarkus build tools extensions, but this relies on metadata that must be included in the runtime artifact.

It looks like you're missing the new plugin which produces such metadata; replace the

<artifactId>maven-dependency-plugin</artifactId>

with e.g.

<plugin>
<groupId>io.quarkus.bootstrap</groupId>
<artifactId>bootstrap-maven-plugin</artifactId>
</plugin>

@cristhiank
Copy link
Contributor Author

Thanks @Sanne , I knew it was some hidden magic I was missing 😅 I will add it and push again.

@cristhiank
Copy link
Contributor Author

Rebased to latest upstream/master and added the missing bootstrap-maven-plugin

@Sanne
Copy link
Member

Sanne commented Apr 2, 2019

hi @cristhiank , there seems to be a problem. I see the scanner picked the script up:

2019-04-02 16:34:40,126 DEBUG [io.qua.fly.run.gra.QuarkusPathLocationScanner] (XNIO-1 task-1) Loading db/migration/V1.0.0__Quarkus.sql

but then it fails to actually load these:

Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: db/migration/V1.0.0__Quarkus.sql
	at org.flywaydb.core.internal.resource.classpath.ClassPathResource.loadAsString(ClassPathResource.java:102)
	at org.flywaydb.core.internal.sqlscript.SqlScript.<init>(SqlScript.java:85)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.addMigrations(SqlMigrationResolver.java:140)

I can have a look as well but it will have to wait a couple of days

@cristhiank
Copy link
Contributor Author

@Sanne thanks, I'm checking it right now. I had to leave earlier this morning but now I'm on it. It is something related to the "-deployment" dependency. It works when I add it.

@cristhiank
Copy link
Contributor Author

cristhiank commented Apr 2, 2019

hi @cristhiank , there seems to be a problem. I see the scanner picked the script up:

2019-04-02 16:34:40,126 DEBUG [io.qua.fly.run.gra.QuarkusPathLocationScanner] (XNIO-1 task-1) Loading db/migration/V1.0.0__Quarkus.sql

but then it fails to actually load these:

Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: db/migration/V1.0.0__Quarkus.sql
	at org.flywaydb.core.internal.resource.classpath.ClassPathResource.loadAsString(ClassPathResource.java:102)
	at org.flywaydb.core.internal.sqlscript.SqlScript.<init>(SqlScript.java:85)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.addMigrations(SqlMigrationResolver.java:140)

I can have a look as well but it will have to wait a couple of days

It was another typo in the name of the plugin that generates the extension metadata quarkus-extension.properties 🤦‍♂️

The name in master build pom is quarkus-bootstrap-maven-plugin not bootstrap-maven-plugin

<artifactId>quarkus-bootstrap-maven-plugin</artifactId>

@Sanne Sanne added the area/persistence OBSOLETE, DO NOT USE label Apr 2, 2019
@Sanne Sanne added this to the 0.13.0 milestone Apr 2, 2019
@Sanne Sanne merged commit ee8e68d into quarkusio:master Apr 2, 2019
@Sanne
Copy link
Member

Sanne commented Apr 2, 2019

awesome work @cristhiank ! It's merged, this will be available for everyone to enjoy on the next release.

@cristhiank cristhiank deleted the flyway-extension branch April 2, 2019 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants