-
Notifications
You must be signed in to change notification settings - Fork 32
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
Migrations-1015 - Add buildscript for replayer #118
Conversation
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #118 +/- ##
=========================================
+ Coverage 0 91.51% +91.51%
=========================================
Files 0 25 +25
Lines 0 1155 +1155
Branches 0 122 +122
=========================================
+ Hits 0 1057 +1057
- Misses 0 83 +83
- Partials 0 15 +15 see 25 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Can you look up what the conventions are for other opensearch gradle projects. What are some of the target names, are there any other specific tools that are commonly used (like checkstyle)? You can create more tasks to add them, but it's good to maintain consistency for future developers. |
opensearch-project/opensearch-java repo actually has checkstyle as a github action, while the opensearch-project/opensearch stopped using checkstyle and started using spotless |
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
…ommit fixes that Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
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.
I'm not familiar w/ a lot of the specific details that need to go into the build.gradle file, but I've left some comments. I'd like to make sure that this works well with IDE integration and the command line. Please add some notes to the PR with your findings.
TrafficReplayer/build.gradle
Outdated
implementation group: 'com.beust', name: 'jcommander', version: '1.82' | ||
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.20.0' | ||
annotationProcessor 'org.projectlombok:lombok:1.18.10' |
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.
Thank you for noticing & adding these!
TrafficReplayer/build.gradle
Outdated
sourceSets { | ||
main { | ||
java { | ||
srcDirs = ['src/org/opensearch/migrations/replay','src/org/opensearch/migrations/replay/netty'] |
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.
I would expect the source set to just be 'src' since org... are all part of the same source hierarchy. This might create an issue when importing this into an IDE. If you just make this 'src', does the project still build? Does it load well into IntelliJ (I don't know how vscode works, but if you know, that's a good datapoint to try too)?
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.
Thanks for letting me know and pointing this out. It does still build and load well into IntelliJ, I'll update this and "tst" too!
TrafficReplayer/build.gradle
Outdated
java { | ||
compileClasspath += main.output + test.output | ||
runtimeClasspath += main.output + test.output | ||
resources.srcDir file('tst/org/opensearch/migrations/replay') |
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.
Same as above - should this just be 'tst'?
TrafficReplayer/build.gradle
Outdated
compileClasspath += main.output + test.output | ||
runtimeClasspath += main.output + test.output |
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 know what compileClasspath/runtimeClasspath are set to beforehand (asking because of the '+=")?
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.
compileClasspath defaults to the compile configuration and runtimeClasspath defaults to the sourceSet's output + runtime configuration
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
TrafficReplayer/build.gradle
Outdated
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.20.0' | ||
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0' | ||
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' | ||
annotationProcessor 'org.projectlombok:lombok:1.18.10' |
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.
I noticed this in my testing. Looks like we should bump this to 1.18.22: https://stackoverflow.com/questions/66801256/java-lang-illegalaccesserror-class-lombok-javac-apt-lombokprocessor-cannot-acce
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.
I'll bump that along with a few more things that the mend security check pointed out. https://github.com/opensearch-project/opensearch-migrations/pull/118/checks?check_run_id=12176201328
…curity check Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
Couple things then I'm fine to approve: I don't want to mess with the gradle configuration too much while this is still a sub directory of this repo as its hard to tell what is an actual problem or what is Intelij having trouble reconciling. But we should definitely make sure this works well when we move it out and is properly picked up by Intelij. I was able to build successfully after fixing a spot bugs issue in line 282 of TrafficReplayer.java. Not sure if you've looked into this but if @gregschohn does not have concern would add it in |
Signed-off-by: Omar Khasawneh <okhasawn@amazon.com>
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.
LGTM
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.
You can also delete the IntelliJ project file (TrafficReplayer.iml)
I'm sure that I will soon regret not looking at the checkstyle.xml file carefully :)
@gregschohn I'll remove that file in one of the other PR's that I have open. |
Description
This adds a gradle build script file to make it possible to repeatedly build the Traffic Replayer, compiling all java files, run unit tests, checkstyle and spotbugs on the code, all with one command.
You can either run
gradle build
within the traffic replayer directory, or to do this with a gradle wrapper, then you must rungradle wrapper
then run./gradlew build
Issues Resolved
Migrations-1015
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.