-
Notifications
You must be signed in to change notification settings - Fork 979
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
Compatibility with jOOQ 3.15 and later #4727
Conversation
36916c3
to
1b4143d
Compare
b3d9da5
to
32c8869
Compare
Implementing jOOQ's `DSLContext` interface was causing revlock and subsequently frequent breaking. Now that jOOQ OSS supported versions no longer work with Java 8, we cannot compile against them to update our implementation `MetricsDSLContext`. This switches to extending `DefaultDSLContext` instead which eliminates a lot of boilerplate implementation and should be more compatible. A sample has been added that runs the tests against the latest version of jOOQ to ensure MetricsDSLContext works with it while compiling against the newest OSS version of jOOQ that supports Java 8.
It looks like since jOOQ 3.17, open source versions only support Java 17+. I've updated the sample to only run with 17+. |
* @author Jon Schneider | ||
* @author Johnny Lim | ||
*/ | ||
class MetricsDSLContextTest { |
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.
This class is copied from micrometer-core with only import/JavaDoc changes.
@@ -136,4972 +116,678 @@ public DSLContext tags(Iterable<Tag> tags) { | |||
} | |||
|
|||
@Override | |||
public Schema map(Schema schema) { | |||
return context.map(schema); | |||
public <R extends Record> SelectWhereStep<R> selectFrom(Table<R> table) { |
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.
Any specific reason this is not
public <R extends Record> SelectWhereStep<R> selectFrom(Table<R> table) { | |
public <R extends Record> SelectWhereStep<R> selectFrom(TableLike<R> table) { |
?
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.
Because we compile against jooq 3.14 and TableLike
does not exist in that version.
Implementing jOOQ's
DSLContext
interface was causing revlock and subsequently frequent breaking. Now that jOOQ OSS supported versions no longer work with Java 8, we cannot compile against them to update our implementationMetricsDSLContext
. This switches to extendingDefaultDSLContext
instead which eliminates a lot of boilerplate implementation and should be more compatible. A sample has been added that runs the tests against the latest version of jOOQ to ensure MetricsDSLContext works with it while compiling against the newest OSS version of jOOQ that supports Java 8.Resolves gh-3828
Obviates gh-4508 for now
This does break binary compatibility, as reported by japi. I think that's going to be unavoidable given the circumstances and it is limited to the jOOQ integration. Users will need to recompile their code that uses
MetricsDSLContext
. I am not aware of any libraries that configure the jOOQ integration, so it should mostly be used in application code, making the recompile requirement less of an issue. Typical practice is to recompile application code when changing dependency versions.