Skip to content

Commit 985bb7d

Browse files
committed
Add a quick tour of the project to CONTRIBUTING (#30187)
Adds a description of the most important subdirectories to `CONTRIBUTING.md` to help folks that are less familiar with the project get their bearings. It reflects that state of the project right now so it will inevitably go out of date. But I'll try and keep it up to date.
1 parent 58308a0 commit 985bb7d

File tree

1 file changed

+90
-1
lines changed

1 file changed

+90
-1
lines changed

CONTRIBUTING.md

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We enjoy working with contributors to get their code accepted. There are many ap
4141
Note that it is unlikely the project will merge refactors for the sake of refactoring. These
4242
types of pull requests have a high cost to maintainers in reviewing and testing with little
4343
to no tangible benefit. This especially includes changes generated by tools. For example,
44-
converting all generic interface instances to use the diamond operator.
44+
converting all generic interface instances to use the diamond operator.
4545

4646
The process for contributing to any of the [Elastic repositories](https://github.com/elastic/) is similar. Details for individual projects can be found below.
4747

@@ -175,6 +175,95 @@ Before submitting your changes, run the test suite to make sure that nothing is
175175
./gradlew check
176176
```
177177

178+
### Project layout
179+
180+
This repository is split into many top level directories. The most important
181+
ones are:
182+
183+
#### `docs`
184+
Documentation for the project.
185+
186+
#### `distribution`
187+
Builds our tar and zip archives and our rpm and deb packages.
188+
189+
#### `libs`
190+
Libraries used to build other parts of the project. These are meant to be
191+
internal rather than general purpose. We have no plans to
192+
[semver](https://semver.org/) their APIs or accept feature requests for them.
193+
We publish them to maven central because they are dependencies of our plugin
194+
test framework, high level rest client, and jdbc driver but they really aren't
195+
general purpose enough to *belong* in maven central. We're still working out
196+
what to do here.
197+
198+
#### `modules`
199+
Features that are shipped with Elasticsearch by default but are not built in to
200+
the server. We typically separate features from the server because they require
201+
permissions that we don't believe *all* of Elasticsearch should have or because
202+
they depend on libraries that we don't believe *all* of Elasticsearch should
203+
depend on.
204+
205+
For example, reindex requires the `connect` permission so it can perform
206+
reindex-from-remote but we don't believe that the *all* of Elasticsearch should
207+
have the "connect". For another example, Painless is implemented using antlr4
208+
and asm and we don't believe that *all* of Elasticsearch should have access to
209+
them.
210+
211+
#### `plugins`
212+
Officially supported plugins to Elasticsearch. We decide that a feature should
213+
be a plugin rather than shipped as a module because we feel that it is only
214+
important to a subset of users, especially if it requires extra dependencies.
215+
216+
The canonical example of this is the ICU analysis plugin. It is important for
217+
folks who want the fairly language neutral ICU analyzer but the library to
218+
implement the analyzer is 11MB so we don't ship it with Elasticsearch by
219+
default.
220+
221+
Another example is the `discovery-gce` plugin. It is *vital* to folks running
222+
in [GCP](https://cloud.google.com/) but useless otherwise and it depends on a
223+
dozen extra jars.
224+
225+
#### `qa`
226+
Honestly this is kind of in flux and we're not 100% sure where we'll end up.
227+
Right now the directory contains
228+
* Tests that require multiple modules or plugins to work
229+
* Tests that form a cluster made up of multiple versions of Elasticsearch like
230+
full cluster restart, rolling restarts, and mixed version tests
231+
* Tests that test the Elasticsearch clients in "interesting" places like the
232+
`wildfly` project.
233+
* Tests that test Elasticsearch in funny configurations like with ingest
234+
disabled
235+
* Tests that need to do strange things like install plugins that thrown
236+
uncaught `Throwable`s or add a shutdown hook
237+
But we're not convinced that all of these things *belong* in the qa directory.
238+
We're fairly sure that tests that require multiple modules or plugins to work
239+
should just pick a "home" plugin. We're fairly sure that the multi-version
240+
tests *do* belong in qa. Beyond that, we're not sure. If you want to add a new
241+
qa project, open a PR and be ready to discuss options.
242+
243+
#### `server`
244+
The server component of Elasticsearch that contains all of the modules and
245+
plugins. Right now things like the high level rest client depend on the server
246+
but we'd like to fix that in the future.
247+
248+
#### `test`
249+
Our test framework and test fixtures. We use the test framework for testing the
250+
server, the plugins, and modules, and pretty much everything else. We publish
251+
the test framework so folks who develop Elasticsearch plugins can use it to
252+
test the plugins. The test fixtures are external processes that we start before
253+
running specific tests that rely on them.
254+
255+
For example, we have an hdfs test that uses mini-hdfs to test our
256+
repository-hdfs plugin.
257+
258+
#### `x-pack`
259+
Commercially licensed code that integrates with the rest of Elasticsearch. The
260+
`docs` subdirectory functions just like the top level `docs` subdirectory and
261+
the `qa` subdirectory functions just like the top level `qa` subdirectory. The
262+
`plugin` subdirectory contains the x-pack module which runs inside the
263+
Elasticsearch process. The `transport-client` subdirectory contains extensions
264+
to Elasticsearch's standard transport client to work properly with x-pack.
265+
266+
178267
Contributing as part of a class
179268
-------------------------------
180269
In general Elasticsearch is happy to accept contributions that were created as

0 commit comments

Comments
 (0)