* add jacoco plugin
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* config aggregated jacoco report
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Skip generating report if no test in subproject
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Add jacoco plugin into root project
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* test aggregate code coverage report
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Can generate aggregated unit test coverage report
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Can generate aggregated test report with source file linked
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Some cleanup, but jacocoReport is not dependson Test
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* cleanup
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* get unit test code coverage report
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* change 'enabled == true' to 'enabled'
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* add a comment for selectedsubprojects
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* add tasks to generate code coverage report for unit test and integration test
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* fix typo in variable
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Correct the task to get codecoverage for unit test and integtest
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Make code coverage report task run after test
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* apply gradle configuration aciidance api
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* apply jacoco plugin in BuildPlugin in all case
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Put file path list of integration test exec data in a variable
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Apply gradle configuration aviodance api to register task instead of create task
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* merge 2 jacocoreport configurations
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Add some comments in gradle script
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Attach code coverage report task to gralde check task
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* add a space
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* get code coverage report after check task on demand and get report in html format on demand
Signed-off-by: Tianli Feng <ftianli@amazon.com>
* Lower build requirement from Java 14+ to Java 11+
Avoid use of -Werror -Xlint:all, which may change significantly across
java releases (new warnings could be added). Instead, just list the
warnings individually.
Workaround JDK 11 compiler bug (JDK-8209058) that only impacts test fixture
code in the build itself.
Signed-off-by: Robert Muir <rmuir@apache.org>
* Disable warning around -source 7 -release 7 for java version checker
The java version checker triggers some default warnings because it
targets java7:
```
> Task :distribution:tools:java-version-checker:compileJava FAILED
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
error: warnings found and -Werror specified
```
Suppress this warning explicitly for this module.
Signed-off-by: Robert Muir <rmuir@apache.org>
* more java14 -> java11 cleanup
Signed-off-by: Robert Muir <rmuir@apache.org>
Co-authored-by: Robert Muir <rmuir@apache.org>
* Adds a gradle plugin to validate missing javadocs
Use `./gradlew missingJavadoc` to validate missing javadocs.
Currently this task fails because several modules are missing
appropriate javadocs. Once added, this should pass.
Also, precommit PomValidation check currently fails with missing Javadoc
plugin, that needs to be fixed -
https://github.com/opensearch-project/OpenSearch/issues/449
Thus keeping this in a separate feature branch.
Signed-off-by: Himanshu Setia <setiah@amazon.com>
* Fix Javadoc errors in module `client/rest` (#685)
* Fix Javadoc errors in client/rest module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
* Add package info file in client/rest module
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
* Fix typos
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
* Add exception documentation to Javadoc
Signed-off-by: Gregor Zurowski <gregor@zurowski.org>
* Fixes precommit task configuration failures due to newly added missin… (#707)
* Fixes precommit task configuration failures due to newly added missingJavadoc task
Signed-off-by: Himanshu Setia <setiah@amazon.com>
* Fixes javadoc task errors due to PR#685
Signed-off-by: Himanshu Setia <setiah@amazon.com>
* Updated CONTRIBUTING.md for info on javadocs
Signed-off-by: Himanshu Setia <setiah@amazon.com>
* Correcting licenses and naming
Signed-off-by: Himanshu Setia <setiah@amazon.com>
* Correcting version info
Signed-off-by: Himanshu Setia <setiah@amazon.com>
Co-authored-by: Gregor Zurowski <gregor@zurowski.org>
This commit removes the 'oss' string which was a remnant of the predecessor distribution flavors. As OpenSearch has no flavors for distributions, we are removing this tag from all the distribution names.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit adds the SPDX Apache-2.0 license header along with an additional
copyright header for all modifications.
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This commit fixes the currently broken gradle build resulted from the renaming work. It reverts a few dependencies and comments out the `opensearch_distibutions` task which is currently failing for some builds. We will address these separately in the future once we have a working build.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
As part of this PR, we are disabling the BWC checks. Once we have finalized the versions for the fork, we can re-enable it with right configurations.
Relates #105
Signed-off-by: Rabi Panda <pandarab@amazon.com>
Signed-off-by: Peter Nied <petern@amazon.com>
* Update CI workflow to work on new infra
- Backward compatability tests are disabled during CI by default #113
- Added property to allow for disabling bwc tests
- Added agent label to use specific hardware https://www.jenkins.io/doc/book/pipeline/syntax/#agent
Signed-off-by: Peter Nied <petern@amazon.com>
* Fix external javadoc reference to server project
This fixes https://github.com/elastic/infra/issues/20103
The problem here is that we rename all artifacts in the :server project to
elasticsearch. The ideal fix would be to rename the gradle project there
to elasticsearch. I'm open to that but it seems quite invasive. Would love to hear
other opinions on that.
The applied alternative minimal invasive fix provided with this PR just takes
potential renamed projects / artifacts (Currently I only see `:server`) into account
when declaring external links.
* Simplify javadoc link base name
* Replace compile configuration usage with api (#58451)
- Use java-library instead of plugin to allow api configuration usage
- Remove explicit references to runtime configurations in dependency declarations
- Make test runtime classpath input for testing convention
- required as java library will by default not have build jar file
- jar file is now explicit input of the task and gradle will ensure its properly build
* Fix compile usages in 7.x branch
- extract fail on deprecated usage into its own plugin
- apply on all projects
- ensures we don't miss any project (missed xpack/plugin/eql/qa/security before)
* Move classes from build scripts to buildSrc
- move Run task
- move duplicate SanEvaluator
* Remove :run workaround
* Some little cleanup on build scripts on the way
This commit moves the configuration of all test jvms for fips to a
script plugin. Fips testing is something very specific to the
Elasticsearch build and does not need to be passed on to plugin authors.
This commit moves the common maven repository configuration to the ES
java plugin. All java projects need this common set of repos. Note that
the Elastic download and maven repos are removed, as they are not
necessary anymore since distribution download was split into the
DistributionDownloadPlugin.
Currently forbidden apis accounts for 800+ tasks in the build. These
tasks are aggressively created by the plugin. In forbidden apis 3.0, we
will get task avoidance
(https://github.com/policeman-tools/forbidden-apis/pull/162), but we
need to ourselves use the same task avoidance mechanisms to not trigger
these task creations. This commit does that for our foribdden apis
usages, in preparation for upgrading to 3.0 when it is released.
The secure_settings_password was never taken into consideration in
the ReloadSecureSettings API. This commit fixes that and adds
necessary REST layer testing. Doing so, it also:
- Allows TestClusters to have a password protected keystore
so that it can be set for tests.
- Adds a parameter to the run task so that elastisearch can
be run with a password protected keystore from source.
This commit includes a number of changes to reduce overall build
configuration time. These optimizations include:
- Removing the usage of the 'nebula.info-scm' plugin. This plugin
leverages jgit to load read various pieces of VCS information. This
is mostly overkill and we have our own minimal implementation for
determining the current commit id.
- Removing unnecessary build dependencies such as perforce and jgit
now that we don't need them. This reduces our classpath considerably.
- Expanding the usage lazy task creation, particularly in our
distribution projects. The archives and packages projects create
lots of tasks with very complex configuration. Avoiding the creation
of these tasks at configuration time gives us a nice boost.
Guava was removed from Elasticsearch many years ago, but remnants of it
remain due to transitive dependencies. When a dependency pulls guava
into the compile classpath, devs can inadvertently begin using methods
from guava without realizing it. This commit moves guava to a runtime
dependency in the modules that it is needed.
Note that one special case is the html sanitizer in watcher. The third
party dep uses guava in the PolicyFactory class signature. However, only
calling a method on the PolicyFactory actually causes the class to be
loaded, a reference alone does not trigger compilation to look at the
class implementation. There we utilize a MethodHandle for invoking the
relevant method at runtime, where guava will continue to exist.
from `*_flag_registered` to `#_feature_enabled`.
This previous name indicated that a flag was registered,
whilst the feature flag actually controls whether a
feature is enabled.
Backport of #54276.
Move and rename formatter config file, so that it is easier for
Eclipse users to import.
Also switch to an opt-out list for formatting. Instead of explcitly
listing projects that should be formatted, instead list projects
that should not be formatted. This means that any new projects will
automatically be formatted and checked.