Skip to content

Commit 0bd68d4

Browse files
timeout
2 parents b4f87ba + 990381f commit 0bd68d4

5,438 files changed

Lines changed: 192978 additions & 93184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/bwcVersions

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ BWC_VERSION:
1919
- "7.6.2"
2020
- "7.7.0"
2121
- "7.7.1"
22-
- "7.7.2"
2322
- "7.8.0"
23+
- "7.8.1"
2424
- "7.9.0"
25+
- "7.9.1"
26+
- "7.10.0"
2527
- "8.0.0"

.ci/dockerOnLinuxExclusions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ol-7.7
1010
sles-12.3 # older version used in Vagrant image
1111
sles-12.5
1212
sles-15.1
13+
sles-15.2
1314

1415
# These OSes are deprecated and filtered starting with 8.0.0, but need to be excluded
1516
# for PR checks

.ci/os.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
param($GradleTasks='destructiveDistroTest')
2+
13
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
24
{
35
# Relaunch as an elevated process:
@@ -25,7 +27,6 @@ Remove-Item -Recurse -Force \tmp -ErrorAction Ignore
2527
New-Item -ItemType directory -Path \tmp
2628

2729
$ErrorActionPreference="Continue"
28-
# TODO: remove the task exclusions once dependencies are set correctly and these don't run for Windows or buldiung the deb on windows is fixed
29-
& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --no-daemon --scan --console=plain destructiveDistroTest
30+
& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --no-daemon --scan --console=plain $GradleTasks
3031

3132
exit $LastExitCode

.ci/os.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ cp -v .ci/init.gradle $HOME/.gradle/init.d
3131

3232
unset JAVA_HOME
3333

34-
if ! [ -e "/usr/bin/bats" ] ; then
35-
git clone https://github.com/sstephenson/bats /tmp/bats
36-
sudo /tmp/bats/install.sh /usr
37-
fi
38-
39-
4034
if [ -f "/etc/os-release" ] ; then
4135
cat /etc/os-release
4236
. /etc/os-release
@@ -54,16 +48,8 @@ else
5448
fi
5549

5650
sudo bash -c 'cat > /etc/sudoers.d/elasticsearch_vars' << SUDOERS_VARS
57-
Defaults env_keep += "ZIP"
58-
Defaults env_keep += "TAR"
59-
Defaults env_keep += "RPM"
60-
Defaults env_keep += "DEB"
61-
Defaults env_keep += "PACKAGING_ARCHIVES"
62-
Defaults env_keep += "PACKAGING_TESTS"
63-
Defaults env_keep += "BATS_UTILS"
64-
Defaults env_keep += "BATS_TESTS"
65-
Defaults env_keep += "SYSTEM_JAVA_HOME"
6651
Defaults env_keep += "JAVA_HOME"
52+
Defaults env_keep += "SYSTEM_JAVA_HOME"
6753
SUDOERS_VARS
6854
sudo chmod 0440 /etc/sudoers.d/elasticsearch_vars
6955

.ci/teamcity.init.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
gradle.settingsEvaluated { settings ->
21+
String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
22+
boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
23+
24+
if (buildCacheUrl) {
25+
settings.buildCache {
26+
local {
27+
// Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty
28+
enabled = false
29+
}
30+
remote(HttpBuildCache) {
31+
url = buildCacheUrl
32+
push = buildCachePush
33+
// credentials {
34+
// username = buildCacheCredentials.get("username")
35+
// password = buildCacheCredentials.get("password")
36+
// }
37+
}
38+
}
39+
}
40+
41+
// Update build configuration parameter with latest published build scan
42+
settings.pluginManager.withPlugin('com.gradle.enterprise') {
43+
settings.gradleEnterprise.buildScan.buildScanPublished { scan ->
44+
println "##teamcity[setParameter name='gradle.build.scan' value='${scan.buildScanUri}']"
45+
}
46+
}
47+
}

.idea/runConfigurations/Debug_Elasticsearch.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,17 @@ Open an issue on our [issues list](https://github.com/elastic/elasticsearch/issu
3434
Contributing code and documentation changes
3535
-------------------------------------------
3636

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.
4548

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

@@ -52,6 +55,18 @@ You will need to fork the main Elasticsearch code or documentation repository an
5255

5356
Further instructions for specific projects are given below.
5457

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+
5570
### Submitting your changes
5671

5772
Once your changes and tests are ready to submit for review:
@@ -131,6 +146,7 @@ and then run `curl` in another window like this:
131146

132147
### Importing the project into IntelliJ IDEA
133148

149+
The minimum IntelliJ IDEA version required to import the Elasticsearch project is 2020.1
134150
Elasticsearch builds using Java 14. When importing into IntelliJ you will need
135151
to define an appropriate SDK. The convention is that **this SDK should be named
136152
"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:
147163

148164
### Importing the project into Eclipse
149165

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
151167
will either need to use an appropriate JDK to run Eclipse itself (e.g. by
152168
specifying the VM in [eclipse.ini](https://wiki.eclipse.org/Eclipse.ini) or by
153169
defining the JDK Gradle uses by setting **Prefercences** > **Gradle** >
@@ -175,7 +191,7 @@ dependencies. Fix them:
175191
Next you'll want to import our auto-formatter:
176192

177193
- Select **Window > Preferences**
178-
- Select **Java > Code Style > Formater**
194+
- Select **Java > Code Style > Formatter**
179195
- Click **Import**
180196
- Import the file at **buildSrc/formatterConfig.xml**
181197
- Make sure it is the **Active profile**
@@ -571,21 +587,85 @@ allows you to use these configurations arbitrarily. Here are some of the most
571587
common configurations in our build and how we use them:
572588

573589
<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
578598
we do not accidentally compile against dependencies of our dependencies also
579599
known as "transitive" dependencies".</dd>
580600
<dt>`compileOnly`</dt><dd>Code that is on the classpath at compile time but that
581601
should not be shipped with the project because it is "provided" by the runtime
582602
somehow. Elasticsearch plugins use this configuration to include dependencies
583603
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
585605
that are part of this project but not production code. The canonical example
586606
of this is `junit`.</dd>
587607
</dl>
588608

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+
589669
Contributing as part of a class
590670
-------------------------------
591671
In general Elasticsearch is happy to accept contributions that were created as

0 commit comments

Comments
 (0)