Commit Graph

82 Commits

Author SHA1 Message Date
Rene Groeschke 7df3771a2c
Simplify applying build tools conventions (#73877)
Share common conventions for build tools in one plugin.
e.g. we always apply the license headers check for build tools too
2021-06-23 11:44:49 +02:00
Rene Groeschke c59ea7971b
Introduce ElasticsearchJavaBasePlugin to simplify YamlRestTestPlugin (#74411)
just configuring common conventions on java based projects without
adding opinionated sourcesets. Reduces the configuration overhead for
yaml rest test only projects.

In the end we create less tasks and configure less for test only projects.
2021-06-23 11:36:58 +02:00
Lee Hinman b566abc8f4
Convert node shutdown system property feature flag to setting (#74267)
This converts the system property feature flag 'es.shutdown_feature_flag_enabled' to a regular
non-dynamic node setting. This setting can only be set to 'true' on a snapshot build of
Elasticsearch (not a release build).

Relates to #70338
2021-06-22 12:08:33 -06:00
Rene Groeschke 59fb90487b
Simplify test only project precommit checks (#74172)
we do not need thirdparty check for test only projects
2021-06-22 16:34:07 +02:00
Rene Groeschke e08d117f46
Remove BuildParams.isInternal (#74329)
After breaking up build logic between internal and external we can remove BuildParams.isInternal().
We also resolve bwc versions lazy and not eagerly. This makes configuration of non bwc builds easier and
also makes integration tests easier to setup.
2021-06-22 09:24:59 +02:00
Rory Hunter 7ab0735054
Add .editorconfig options for gradle and groovy files (#74286)
Add more IntelliJ config to `.editorconfig` for formatting `.gradle`
and `.groovy` files. This formatting isn't enforced, but is broadly
in line with our Spotless config. This work is helpful is useful
because the Eclipse Groovy formatter that Spotless can use doesn't
give us good results.
2021-06-21 20:50:05 +01:00
Rene Groeschke c2e86258d8
Update wrapper to 7.1 (#73941)
- Fix new introduced deprecated usages
- Update to newer ospackage snapshot to include provided PR for fixing deprecated usage

This gradle release comes with improvements on incremental compilation which we should benefit from
2021-06-17 10:59:22 +02:00
Rory Hunter a5d2251064
Order imports when reformatting (#74059)
Change the formatter config to sort / order imports, and reformat the
codebase. We already had a config file for Eclipse users, so Spotless now
uses that.

The "Eclipse Code Formatter" plugin ought to be able to use this file as
well for import ordering, but in my experiments the results were poor.
Instead, use IntelliJ's `.editorconfig` support to configure import
ordering.

I've also added a config file for the formatter plugin.

Other changes:
   * I've quietly enabled the `toggleOnOff` option for Spotless. It was
     already possible to disable formatting for sections using the markers
     for docs snippets, so enabling this option just accepts this reality
     and makes it possible via `formatter:off` and `formatter:on` without
     the restrictions around line length. It should still only be used as
     a very last resort and with good reason.
   * I've removed mention of the `paddedCell` option from the contributing
     guide, since I haven't had to use that option for a very long time. I
     moved the docs to the spotless config.
2021-06-16 09:22:22 +01:00
Mark Vieira 1f1c8b0019
Move custom checkstyle rule implementations to build-conventions project (#74017) 2021-06-10 16:06:44 -07:00
Tanguy Leroux 559c4e6ef4
Apply spotless formatting to more sub-projects (#73989) 2021-06-10 11:24:44 +02:00
Rory Hunter 1afe4b9143
Apply Spotless to snapshot/repo packages in server (#71560)
Adds a Spotless opt-in for certain packages in `:server`, and opts-in
the packages related to snapshots & repositories.

Co-authored-by: David Turner <david.turner@elastic.co>
2021-06-10 08:58:39 +01:00
Ryan Ernst ab1a2e4a84
Add precommit task for detecting split packages (#73784)
Modularization of the JDK has been ongoing for several years. Recently
in Java 16 the JDK began enforcing module boundaries by default. While
Elasticsearch does not yet use the module system directly, there are
some side effects even for those projects not modularized (eg #73517).
Before we can even begin to think about how to modularize, we must
Prepare The Way by enforcing packages only exist in a single jar file,
since the module system does not allow packages to coexist in multiple
modules.

This commit adds a precommit check to the build which detects split
packages. The expectation is that we will add the existing split
packages to the ignore list so that any new classes will not exacerbate
the problem, and the work to cleanup these split packages can be
parallelized.

relates #73525
2021-06-08 15:04:23 -07:00
Mark Vieira 3ee8f7dfc4
Bump minimumCompilerVersion to Java 16 (#73913) 2021-06-08 11:35:17 -07:00
Ryan Ernst 68817d7ca2
Rename o.e.common in libs/core to o.e.core (#73909)
When libs/core was created, several classes were moved from server's
o.e.common package, but they were not moved to a new package. Split
packages need to go away long term, so that Elasticsearch can even think
about modularization. This commit moves all the classes under o.e.common
in core to o.e.core.

relates #73784
2021-06-08 09:53:28 -07:00
Rene Groeschke a420da886a
Revert "Fix java compatibility for build-tools-internal (#73897)"
This reverts commit e65577284b.
2021-06-08 17:27:19 +02:00
Rene Groeschke 9bb8f788a7
Ignore InternalTestRerunPluginFuncTest for now 2021-06-08 16:54:01 +02:00
Rene Groeschke e65577284b
Fix java compatibility for build-tools-internal (#73897)
This was accidentally set to 15.

should be 11 not 15 taken from the minimumRuntimeVersion file and not from minimumCompilerVersion
this also fixes the checkstyle ides setup
2021-06-08 16:00:36 +02:00
Rene Groeschke 6ff0b1b56a
Fix eclipse for build tools (#73699)
apply common eclipse config to all projects across the elasticsearch workspace 
including build tools projects
2021-06-08 15:26:21 +02:00
Rene Groeschke c80004aa9b
Remove debugging output 2021-06-08 08:11:25 +02:00
Rene Groeschke da86c9d30b
Ensure minimum compiler version is picked when running bwc builds (#73868)
Fixes the picking of minimum compiler versions for bwc builds after we renamed
buildSrc to build-tools-internal.
2021-06-08 08:06:58 +02:00
Ryan Ernst f98b374cf6
Revert "Upgrade Azure SDK and Jackson (#72833) (#72995)" (#73837)
The recent upgrade of the Azure SDK has caused a few test failures that
have been difficult to debug and do not yet have a fix. In particular, a
change to the netty reactor resolving
(https://github.com/reactor/reactor-netty/issues/1655). We need to wait
for a fix for that issue, so this reverts commit
6c4c4a0ecb.

relates #73493
2021-06-07 10:20:46 -07:00
Mark Vieira 0e5c3fc515 Temporarily mute build-tools integration test 2021-06-07 08:55:44 -07:00
Ryan Ernst bb12fd526b
Apply spotless to java projects (#73808)
In preparation for formatting the enitre Elasticsearch codebase,
spotless was added for all projects using the BuildPlugin, with an
explicit list of existing projects ignored. This ensured new projects
would use spotless from the start. However, after that change, the
ElasticsearchJavaPlugin was added, which subsumed much of the
functionality of the BuildPlugin. Unfortunately this means that many new
java projects (mostly for tests) were added without auto formatting.

This commit adds spotless to all Elasticsearch java projects, adding
those projects that were missed to the ignore list. These can be
migrated separately or as part of the big migration when 8.x is cut.
2021-06-07 08:22:40 -07:00
Ryan Ernst 64054de1ac
Rename bootstrap package in core jar (#73788)
The org.elasticsearch.bootstrap package exists in server with classes
for starting up Elasticsearch. The elasticsearch-core jar has a handful
of classes that were split out from there, namely java version parsing
and jarhell. This commit moves those classes to a new
org.elasticsearch.jdk package so as to not split the server owned
bootstrap package.

relates #73784
2021-06-07 08:14:44 -07:00
Rene Groeschke c2135844f0
Fix minimum compiler version reading for bwc tasks on 7.x 2021-06-07 17:08:54 +02:00
Ryan Ernst 30d88d3865
Use compiler version for gradle code (#73777)
The minimum compiler version is that which we require a developer to use
when building Elasticsearch. This version is updated as newer versions
of Java are released. In contrast, the minimum runtime version is that
which Elasticsearch itself needs. In 7.x this is Java 8, and in master
this is Java 11. Historically the version we require for gradle code has
had to be the minimum runtime version since all the gradle code was
distributed for plugin developers.

Now that the external build tools is separated from our internal tools,
the internal tools are no longer bound by that runtime requirement.
Instead, they can use the latest Java, so that we can use new features
within our internal tools. This commit switches the source compatibiltiy
version for the internal build tools to use the minimum compiler version.
2021-06-04 14:33:46 -07:00
Rene Groeschke c089d91679
Remove buildSrc directory (#73646)
* Remove buildSrc directory

version properties moved to build-tools-internal and plugin descriptor
moved to build-tools. The docs build has been updated accordingly

* More cleanup
2021-06-03 12:27:23 +02:00
Mark Vieira 7bbd3113fa
Use production-similar GC settings for internal cluster tests (#73701) 2021-06-02 16:12:29 -07:00
Ryan Ernst 8cba213dfc
Explicitly set illegal-access to deny for tests (#72588)
Since Java 16, the default value for illegal-access is deny. This means
the latest release of Elasticsearch, and all current integration tests,
run with deny (since we don't explicitly set it in jvm options). Yet
tests run with illegal-access=warn, for legacy reasons. #71908
proposed to remove the setting from test jvms, but concerns were raised
there about whether this would cause some test failures.

This commit explicitly sets tests to deny. This has the added benefit
that any failures will be caught even when running tests with older
jvms.
2021-06-02 16:09:27 -07:00
Rene Groeschke d06801c503
Fix version.properties after merge 2021-06-01 11:44:06 +02:00
Rene Groeschke 6549c55060
Update version properties after merge 2021-06-01 11:32:36 +02:00
Rene Groeschke b2a183baf0
Move public build api into included build (#72861)
This moves the public build api and plugins into a separete included build called 'build-tools' 
and we removed the duplication of included buildSrc twice (2nd import as build-tools).

The elasticsearch internal build logic is kept in build-tools-internal as included build which allows us better handling of this project that its just being an buildSrc project (e.g. we can reference tasks directly from the root build etc.)

Convention logic applied to both projects will live in a new build-conventions project.
2021-06-01 11:19:30 +02:00