-
Notifications
You must be signed in to change notification settings - Fork 1
support Java exporter in CI #102
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
base: main
Are you sure you want to change the base?
Conversation
a58c655 to
0ca38c3
Compare
0ca38c3 to
3500e28
Compare
3500e28 to
5b4678f
Compare
Co-authored-by: Laura Trotta <[email protected]>
| <dependency> | ||
| <groupId>co.elastic.clients</groupId> | ||
| <artifactId>elasticsearch-java</artifactId> | ||
| <version>9.2.0</version> |
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.
| <version>9.2.0</version> | |
| <version>9.2.2</version> |
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.
@l-trotta Here what I do for all the other languages is use a cloned copy of the source code. Because the CI runs on the main version of the spec, so it is more correct to run it on the unreleased clients that will eventually be 9.3 then on the released 9.2.
In the run-java.sh script I'm cloning the java client, but I haven't looked into how to include it here as a locally installed dependency. I hope it is possible?
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.
got it, ignore the change then. to get it locally the dependency must have been previously published to the local .m2 repo running mvn install in the project folder, then I think maven will try and get it by default if it's available, no modifications needed to the pom.
| <plugins> | ||
| <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> | ||
| <plugin> | ||
| <artifactId>maven-clean-plugin</artifactId> | ||
| <version>3.4.0</version> | ||
| </plugin> | ||
| <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> | ||
| <plugin> | ||
| <artifactId>maven-resources-plugin</artifactId> | ||
| <version>3.3.1</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>3.13.0</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <version>3.3.0</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-jar-plugin</artifactId> | ||
| <version>3.4.2</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-install-plugin</artifactId> | ||
| <version>3.1.2</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-deploy-plugin</artifactId> | ||
| <version>3.1.2</version> | ||
| </plugin> | ||
| <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> | ||
| <plugin> | ||
| <artifactId>maven-site-plugin</artifactId> | ||
| <version>3.12.1</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-project-info-reports-plugin</artifactId> | ||
| <version>3.6.1</version> | ||
| </plugin> | ||
| <plugin> |
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.
are all of these used somewhere?
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, this is a template pom.xml file that I generated a while ago, I believe using maven. We can prune all the stuff that isn't needed.
Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: Laura Trotta <[email protected]>
This should more or less support the use of Java in CI and local usage, including the request converter CLI.
I have added a
JavaExporterclass based on the usage.js example. To ensure that this class only appears as a valid exporter in CI, I have added an optional method that exporters can implement calledavailable(). If this is present, the method is called and if it returnsfalsethen the exporter is not loaded. The implementation that I'm using only reports Java as available when theJAVA_ES_REQUEST_CONVERTER_JARenvironment variable is set. This variable is passed to the Java caller.Some things will need to be adjusted once the Java converter is ready, but overall I think all the wrapper pieces around the jar file are in place in this PR.
@l-trotta There is a lot of changes in this PR. A lot of it is more related to making Java appear the same as the other languages in spite of its implementation differences. The Java specific logic is in the
src/exporters/java.tsfile (a TypeScript wrapper around your jar file that is based on the usage.js example you created) and ontest/integration/run-java.sh(the bash script that compiles and executes an exported complete script against the test server). We can walk over the changes together if that will make it easier to review.