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: .ci/os.ps1
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
param($GradleTasks='destructiveDistroTest')
2
+
1
3
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+95-15Lines changed: 95 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,17 @@ Open an issue on our [issues list](https://github.com/elastic/elasticsearch/issu
34
34
Contributing code and documentation changes
35
35
-------------------------------------------
36
36
37
-
If you have a bugfix or new feature that you would like to contribute to Elasticsearch, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
38
-
39
-
We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
40
-
41
-
Note that it is unlikely the project will merge refactors for the sake of refactoring. These
42
-
types of pull requests have a high cost to maintainers in reviewing and testing with little
43
-
to no tangible benefit. This especially includes changes generated by tools. For example,
44
-
converting all generic interface instances to use the diamond operator.
37
+
If you would like to contribute a new feature or a bug fix to Elasticsearch,
38
+
please discuss your idea first on the Github issue. If there is no Github issue
39
+
for your idea, please open one. It may be that somebody is already working on
40
+
it, or that there are particular complexities that you should know about before
41
+
starting the implementation. There are often a number of ways to fix a problem
42
+
and it is important to find the right approach before spending time on a PR
43
+
that cannot be merged.
44
+
45
+
We add the `help wanted` label to existing Github issues for which community
46
+
contributions are particularly welcome, and we use the `good first issue` label
47
+
to mark issues that we think will be suitable for new contributors.
45
48
46
49
The process for contributing to any of the [Elastic repositories](https://github.com/elastic/) is similar. Details for individual projects can be found below.
47
50
@@ -52,6 +55,18 @@ You will need to fork the main Elasticsearch code or documentation repository an
52
55
53
56
Further instructions for specific projects are given below.
54
57
58
+
### Tips for code changes
59
+
Following these tips prior to raising a pull request will speed up the review
60
+
cycle.
61
+
62
+
* Add appropriate unit tests (details on writing tests can be found in the
63
+
[TESTING](TESTING.asciidoc) file)
64
+
* Add integration tests, if applicable
65
+
* Make sure the code you add follows the [formatting guidelines](#java-language-formatting-guidelines)
66
+
* Lines that are not part of your change should not be edited (e.g. don't format
67
+
unchanged lines, don't reorder existing imports)
68
+
* Add the appropriate [license headers](#license-headers) to any new files
69
+
55
70
### Submitting your changes
56
71
57
72
Once your changes and tests are ready to submit for review:
@@ -131,6 +146,7 @@ and then run `curl` in another window like this:
131
146
132
147
### Importing the project into IntelliJ IDEA
133
148
149
+
The minimum IntelliJ IDEA version required to import the Elasticsearch project is 2020.1
134
150
Elasticsearch builds using Java 14. When importing into IntelliJ you will need
135
151
to define an appropriate SDK. The convention is that **this SDK should be named
136
152
"14"** so that the project import will detect it automatically. For more details
@@ -147,7 +163,7 @@ You can import the Elasticsearch project into IntelliJ IDEA via:
147
163
148
164
### Importing the project into Eclipse
149
165
150
-
Elasticsearch builds using Gradle and Java 13. When importing into Eclipse you
166
+
Elasticsearch builds using Gradle and Java 14. When importing into Eclipse you
151
167
will either need to use an appropriate JDK to run Eclipse itself (e.g. by
152
168
specifying the VM in [eclipse.ini](https://wiki.eclipse.org/Eclipse.ini) or by
153
169
defining the JDK Gradle uses by setting **Prefercences** > **Gradle** >
@@ -175,7 +191,7 @@ dependencies. Fix them:
175
191
Next you'll want to import our auto-formatter:
176
192
177
193
- Select **Window > Preferences**
178
-
- Select **Java > Code Style > Formater**
194
+
- Select **Java > Code Style > Formatter**
179
195
- Click **Import**
180
196
- Import the file at **buildSrc/formatterConfig.xml**
181
197
- Make sure it is the **Active profile**
@@ -571,21 +587,85 @@ allows you to use these configurations arbitrarily. Here are some of the most
571
587
common configurations in our build and how we use them:
572
588
573
589
<dl>
574
-
<dt>`compile`</dt><dd>Code that is on the classpath at both compile and
575
-
runtime.</dd>
576
-
<dt>`runtime`</dt><dd>Code that is not on the classpath at compile time but is
577
-
on the classpath at runtime. We mostly use this configuration to make sure that
590
+
<dt>`implementation`</dt><dd>Dependencies that are used by the project
591
+
at compile and runtime but are not exposed as a compile dependency to other dependent projects.
592
+
Dependencies added to the `implementation` configuration are considered an implementation detail
593
+
that can be changed at a later date without affecting any dependent projects.</dd>
594
+
<dt>`api`</dt><dd>Dependencies that are used as compile and runtime depdendencies of a project
595
+
and are considered part of the external api of the project.
596
+
<dt>`runtimeOnly`</dt><dd>Dependencies that not on the classpath at compile time but
597
+
are on the classpath at runtime. We mostly use this configuration to make sure that
578
598
we do not accidentally compile against dependencies of our dependencies also
579
599
known as "transitive" dependencies".</dd>
580
600
<dt>`compileOnly`</dt><dd>Code that is on the classpath at compile time but that
581
601
should not be shipped with the project because it is "provided" by the runtime
582
602
somehow. Elasticsearch plugins use this configuration to include dependencies
583
603
that are bundled with Elasticsearch's server.</dd>
584
-
<dt>`testCompile`</dt><dd>Code that is on the classpath for compiling tests
604
+
<dt>`testImplementation`</dt><dd>Code that is on the classpath for compiling tests
585
605
that are part of this project but not production code. The canonical example
586
606
of this is `junit`.</dd>
587
607
</dl>
588
608
609
+
610
+
Reviewing and accepting your contribution
611
+
-----------------------------------------
612
+
613
+
We review every contribution carefully to ensure that the change is of high
614
+
quality and fits well with the rest of the Elasticsearch codebase. If accepted,
615
+
we will merge your change and usually take care of backporting it to
616
+
appropriate branches ourselves.
617
+
618
+
We really appreciate everyone who is interested in contributing to
619
+
Elasticsearch and regret that we sometimes have to reject contributions even
620
+
when they might appear to make genuine improvements to the system. Reviewing
621
+
contributions can be a very time-consuming task, yet the team is small and our
622
+
time is very limited. In some cases the time we would need to spend on reviews
623
+
would outweigh the benefits of a change by preventing us from working on other
624
+
more beneficial changes instead.
625
+
626
+
Please discuss your change in a Github issue before spending much time on its
627
+
implementation. We sometimes have to reject contributions that duplicate other
628
+
efforts, take the wrong approach to solving a problem, or solve a problem which
629
+
does not need solving. An up-front discussion often saves a good deal of wasted
630
+
time in these cases.
631
+
632
+
We normally immediately reject isolated PRs that only perform simple
633
+
refactorings or otherwise "tidy up" certain aspects of the code. We think the
634
+
benefits of this kind of change are very small, and in our experience it is not
635
+
worth investing the substantial effort needed to review them. This especially
636
+
includes changes suggested by tools.
637
+
638
+
We sometimes reject contributions due to the low quality of the submission
639
+
since low-quality submissions tend to take unreasonable effort to review
640
+
properly. Quality is rather subjective so it is hard to describe exactly how to
641
+
avoid this, but there are some basic steps you can take to reduce the chances
642
+
of rejection. Follow the guidelines listed above when preparing your changes.
643
+
You should add tests that correspond with your changes, and your PR should pass
644
+
affected test suites too. It makes it much easier to review if your code is
645
+
formatted correctly and does not include unnecessary extra changes.
646
+
647
+
We sometimes reject contributions if we find ourselves performing many review
648
+
iterations without making enough progress. Some iteration is expected,
649
+
particularly on technically complicated changes, and there's no fixed limit on
650
+
the acceptable number of review cycles since it depends so much on the nature
651
+
of the change. You can help to reduce the number of iterations by reviewing
652
+
your contribution yourself or in your own team before asking us for a review.
653
+
You may be surprised how many comments you can anticipate and address by taking
654
+
a short break and then carefully looking over your changes again.
655
+
656
+
We expect you to follow up on review comments somewhat promptly, but recognise
657
+
that everyone has many priorities for their time and may not be able to respond
658
+
for several days. We will understand if you find yourself without the time to
659
+
complete your contribution, but please let us know that you have stopped
660
+
working on it. We will try to send you a reminder if we haven't heard from you
661
+
in a while, but may end up closing your PR if you do not respond for too long.
662
+
663
+
If your contribution is rejected we will close the pull request with a comment
664
+
explaining why. This decision isn't always final: if you feel we have
665
+
misunderstood your intended change or otherwise think that we should reconsider
666
+
then please continue the conversation with a comment on the pull request and
667
+
we'll do our best to address any further points you raise.
668
+
589
669
Contributing as part of a class
590
670
-------------------------------
591
671
In general Elasticsearch is happy to accept contributions that were created as
0 commit comments