-
Notifications
You must be signed in to change notification settings - Fork 67
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
Updates to gradle build file #48
Conversation
Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
build.gradle
Outdated
@@ -69,6 +70,15 @@ spotbugsTest { | |||
ext { | |||
opensearchVersion = '1.0.0' | |||
isSnapshot = "true" == System.getProperty("build.snapshot", "true") | |||
|
|||
// Name of the default git branch. This is used for checking out the RCA repository | |||
gitDefaultBranch = 'main' |
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.
Is there an explanation somewhere why this is needed?
This should probably be parameterized, e.g. -Dperformance-analyzer-rca.branch=main
and I would rename cloneRcaProject
to -Dperformance-analyzer-rca.build=false
or something like that to be consistent.
As a developer I probably also want to be able to -Dperformance-analyzer-rca.path=...
instead, but see my meta question of trying to understand why this dependency is managed differently from other types of dependencies.
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.
+1
If RCA is always built as part of the assembled plugin zip for performance-analyzer, we will need the ability to define the branch that is needed for a particular release. This works fine with main but will be needed to correctly reproduce builds from tags/branches from both repos.
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.
Alternative - It sounds like the RCA zip should be included as a maven publication that is fetched and used to build the final bundle in this repo rather than cloning & rebuilding or looking on a local path.
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 have modified the parameter names and added an additional parameter performance-analyzer-rca.branch
that helps to specify the RCA branch for checkout (defaults to main).
Answering to why this is different from other types of dependencies. Currently, for creating the PA artifact, we rely on some files and folders from the RCA package, we use gradle for building and bring in these RCA bits into PA artifact.
opendistro-for-elasticsearch/performance-analyzer#131
RCA package is more of a component built and shipped along with PA plugin than a dependency.
I am confused why the whole "build performance analyzer RCA" is done inside a gradle build. Plugins have dependencies such as, say common-utils. They require that the latter be built and published into maven (local). You can do it in a CI workflow right now, and in some not so distant future pull those dependencies from Maven. Why is this any different that requires one to check out the source as part of the build and build it? |
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 is causing the assembled zip to be missing RCA - #49
Codecov Report
@@ Coverage Diff @@
## main #48 +/- ##
=========================================
Coverage 72.18% 72.18%
Complexity 356 356
=========================================
Files 44 44
Lines 2509 2509
Branches 160 160
=========================================
Hits 1811 1811
Misses 592 592
Partials 106 106 Continue to review full report at Codecov.
|
Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
2b3bd95
to
4bd15eb
Compare
|
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 works.
We probably do agree that building another project inline is not the way to go in the long term? The RCA project needs to build and publish itself in a way that can be picked up by PA, just like all the dependencies. @sruti1312, since you understand the history for this, could you please open an issue for fixing this with maybe some ideas about how we should be solving it for the long term, and link it here?
Created an issue to track to remove building RCA package during PA build and consuming it like a dependency. |
* Updates to gradle build file Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Add ability to specify RCA branch Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
* Create writer file if metrics are available (#31) Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Add tests to check for writer file only if metrics are present (#35) Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Merge pull request #36 from opensearch-project/khushbr-writer-purge-fix Fixing Event Log file cleanup issue * Moving deleteAllFiles() to inside scheduleExecutor() * Fixing the Link Checker errors, updating the official documentation * nit: Fixing spotlessJava indentation issue * Merge pull request #37 from khushbr/feature/purge-fix Handling purging of lingering files before scheduleExecutor start. * Fix failing file handler test (#38) Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Remove dependency on main branch when running spotless. (#47) Signed-off-by: Marc Handalian <handalm@amazon.com> * Updates to gradle build file (#48) * Updates to gradle build file Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Add ability to specify RCA branch Signed-off-by: Sruti Parthiban <partsrut@amazon.com> * Fix build when opensearch_version flag is provided. (#52) Signed-off-by: Marc Handalian <handalm@amazon.com> * Update the version to 1.0.1 Signed-off-by: Sruti Parthiban <partsrut@amazon.com> Co-authored-by: Khushboo Rajput <59671881+khushbr@users.noreply.github.com> Co-authored-by: Khushboo Rajput <khushbr@amazon.com> Co-authored-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Sruti Parthiban partsrut@amazon.com
Is your feature request related to a problem? Please provide an existing Issue # , or describe.
#45
Describe the solution you are proposing
Introduced two different env variables that will be used for building RCA package (which runs as a part of PA build).
cloneRcaProject
-> this is used to clone themain
branch of the RCA package. If set true, it clones RCA package into../performance-analyzer-rca
location . By default it is set to false in that case it checks the same location for this package, if it exists the test continues. If not, the test fails.rcaProjectDir
-> this is used to specify the location where the rca package is checked out. It defaults to../performance-analyzer-rca
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
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.