You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-5
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,16 @@ Contributing to OpenSearch
4
4
OpenSearch is a community project that is built and maintained by people just like **you**. We're glad you're interested in helping out. There are several different ways you can do it, but before we talk about that, let's talk about how to get started.
5
5
6
6
## Table of Contents:
7
-
-[First Things First](#first-things-first)
8
-
-[Ways to Contribute](#ways-to-contribute)
9
-
-[Developer Certificate of Origin](#developer-certificate-of-origin)
10
-
-[Review Process](#review-process)
7
+
-[Contributing to OpenSearch](#contributing-to-opensearch)
8
+
-[Table of Contents:](#table-of-contents)
9
+
-[First Things First](#first-things-first)
10
+
-[Ways to Contribute](#ways-to-contribute)
11
+
-[Bug Reports](#bug-reports)
12
+
-[Feature Requests](#feature-requests)
13
+
-[Documentation Changes](#documentation-changes)
14
+
-[Contributing Code](#contributing-code)
15
+
-[Developer Certificate of Origin](#developer-certificate-of-origin)
16
+
-[Review Process](#review-process)
11
17
12
18
13
19
## First Things First
@@ -52,7 +58,7 @@ If you've thought of a way that OpenSearch could be better, we want to hear abou
52
58
53
59
### Documentation Changes
54
60
55
-
If you would like to contribute to the documentation, please see [OpenSearch Docs repo](https://github.com/opensearch-project/documentation-website/blob/main/README.md).
61
+
If you would like to contribute to the documentation, please do so in the [documentation-website](https://github.com/opensearch-project/documentation-website) repo. To contribute javadocs, please first check [OpenSearch#221](https://github.com/opensearch-project/OpenSearch/issues/221).
-[Java Language Formatting Guidelines](#java-language-formatting-guidelines)
17
+
-[Project Layout](#project-layout)
18
+
-[`distribution`](#distribution)
19
+
-[`libs`](#libs)
20
+
-[`modules`](#modules)
21
+
-[`plugins`](#plugins)
22
+
-[`qa`](#qa)
23
+
-[`server`](#server)
24
+
-[`test`](#test)
25
+
-[Java Language Formatting Guidelines](#java-language-formatting-guidelines)
24
26
-[Editor / IDE Support](#editor--ide-support)
25
27
-[Formatting Failures](#formatting-failures)
26
-
-[Gradle Build](#gradle-build)
28
+
-[Gradle Build](#gradle-build)
27
29
-[Configurations](#configurations)
28
-
-[Misc](#misc)
30
+
-[implementation](#implementation)
31
+
-[api](#api)
32
+
-[runtimeOnly](#runtimeonly)
33
+
-[compileOnly](#compileonly)
34
+
-[testImplementation](#testimplementation)
35
+
-[Misc](#misc)
29
36
-[git-secrets](#git-secrets)
30
-
-[Submitting Changes](#submitting-changes)
37
+
-[Submitting Changes](#submitting-changes)
31
38
32
39
## Getting Started
33
40
@@ -156,10 +163,6 @@ We would like to support Eclipse, but few of us use it and has fallen into disre
156
163
157
164
This repository is split into many top level directories. The most important ones are:
158
165
159
-
### `docs`
160
-
161
-
Documentation for the project.
162
-
163
166
### `distribution`
164
167
165
168
Builds our tar and zip archives and our rpm and deb packages.
@@ -177,7 +180,7 @@ For example, reindex requires the `connect` permission so it can perform reindex
177
180
178
181
### `plugins`
179
182
180
-
Officially supported plugins to OpenSearch. We decide that a feature should be a plugin rather than shipped as a module because we feel that it is only important to a subset of users, especially if it requires extra dependencies.
183
+
OpenSearch plugins. We decide that a feature should be a plugin rather than shipped as a module because we feel that it is only important to a subset of users, especially if it requires extra dependencies.
181
184
182
185
The canonical example of this is the ICU analysis plugin. It is important for folks who want the fairly language neutral ICU analyzer but the library to implement the analyzer is 11MB so we don't ship it with OpenSearch by default.
Tests are run for versions that are not yet released but with which the current version will be compatible with. These are automatically checked out and built from source. See [VersionCollection](./buildSrc/src/main/java/org/opensearch/gradle/VersionCollection.java) and [distribution/bwc/build.gradle](./distribution/bwc/build.gradle) for more information.
376
+
Tests are run for versions that are not yet released but with which the current version will be compatible with. These are automatically checked out and built from source. See [BwcVersions](./buildSrc/src/main/java/org/opensearch/gradle/BwcVersions.java) and [distribution/bwc/build.gradle](./distribution/bwc/build.gradle) for more information.
378
377
379
378
When running `./gradlew check`, minimal bwc checks are also run against compatible versions that are not yet released.
380
379
@@ -420,7 +419,7 @@ In short, most new functionality should come with unit tests, and optionally RES
420
419
421
420
### Refactor code to make it easier to test
422
421
423
-
Unfortunately, a large part of our code base is still hard to unit test. Sometimes because some classes have lots of dependencies that make them hard to instantiate. Sometimes because API contracts make tests hard to write. Code refactors that make functionality easier to unit test are encouraged. If this sounds very abstract to you, you can have a look at [this pull request](https://github.com/elastic/elasticsearch/pull/16610) for instance, which is a good example. It refactors `IndicesRequestCache` in such a way that: - it no longer depends on objects that are hard to instantiate such as `IndexShard` or `SearchContext`, - time-based eviction is applied on top of the cache rather than internally, which makes it easier to assert on what the cache is expected to contain at a given time.
422
+
Unfortunately, a large part of our code base is still hard to unit test. Sometimes because some classes have lots of dependencies that make them hard to instantiate. Sometimes because API contracts make tests hard to write. Code refactors that make functionality easier to unit test are encouraged.
424
423
425
424
## Bad practices
426
425
@@ -438,13 +437,11 @@ Multi-threaded tests are often not reproducible due to the fact that there is no
438
437
439
438
Generating test coverage reports for OpenSearch is currently not possible through Gradle. However, it *is* possible to gain insight in code coverage using IntelliJ’s built-in coverage analysis tool that can measure coverage upon executing specific tests. Eclipse may also be able to do the same using the EclEmma plugin.
440
439
441
-
Test coverage reporting used to be possible with JaCoCo when OpenSearch was using Maven as its build system. Since the switch to Gradle though, this is no longer possible, seeing as the code currently used to build OpenSearch does not allow JaCoCo to recognize its tests. For more information on this, see the discussion in [issue #28867](https://github.com/elastic/elasticsearch/issues/28867).
442
-
443
-
Read your IDE documentation for how to attach a debugger to a JVM process.
440
+
Please read your IDE documentation for how to attach a debugger to a JVM process.
444
441
445
442
# Building with extra plugins
446
443
447
-
Additional plugins may be built alongside OpenSearch, where their dependency on OpenSearch will be substituted with the local OpenSearch build. To add your plugin, create a directory called opensearch-extra as a sibling of OpenSearch. Checkout your plugin underneath opensearch-extra and the build will automatically pick it up. You can verify the plugin is included as part of the build by checking the projects of the build.
444
+
Additional plugins may be built alongside OpenSearch, where their dependency on OpenSearch will be substituted with the local OpenSearch build. To add your plugin, create a directory called `opensearch-extra` as a sibling of OpenSearch. Checkout your plugin underneath `opensearch-extra` and the build will automatically pick it up. You can verify the plugin is included as part of the build by checking the projects of the build.
448
445
449
446
./gradlew projects
450
447
@@ -455,7 +452,3 @@ There is a known issue with macOS localhost resolve strategy that can cause some
455
452
127.0.0.1 localhost OpenSearchMBP.local
456
453
255.255.255.255 broadcasthost
457
454
::1 localhost OpenSearchMBP.local`
458
-
459
-
# Benchmarking
460
-
461
-
For changes that might affect the performance characteristics of OpenSearch you should also run macrobenchmarks. There is also a macrobenchmarking tool called [Rally](https://github.com/elastic/rally) which you can use to measure the performance impact. To get started, please see [Rally’s documentation](https://esrally.readthedocs.io/en/stable/).
0 commit comments