Skip to content

Commit

Permalink
Merge branch 'main' into ingest-geoip-processor-anonymous-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Apr 10, 2024
2 parents ec27601 + fe11a03 commit 736807e
Show file tree
Hide file tree
Showing 302 changed files with 6,362 additions and 3,576 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["7.17.20", "8.13.3", "8.14.0"]
BWC_VERSION: ["7.17.21", "8.13.3", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
6 changes: 3 additions & 3 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ steps:
env:
BWC_VERSION: 7.16.3

- label: "{{matrix.image}} / 7.17.20 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v7.17.20
- label: "{{matrix.image}} / 7.17.21 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v7.17.21
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -319,7 +319,7 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.20
BWC_VERSION: 7.17.21

- label: "{{matrix.image}} / 8.0.1 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.0.1
Expand Down
10 changes: 5 additions & 5 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,16 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.16.3
- label: 7.17.20 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v7.17.20#bwcTest
- label: 7.17.21 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v7.17.21#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.20
BWC_VERSION: 7.17.21
- label: 8.0.1 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.0.1#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -396,7 +396,7 @@ steps:
setup:
ES_RUNTIME_JAVA:
- openjdk17
BWC_VERSION: ["7.17.20", "8.13.3", "8.14.0"]
BWC_VERSION: ["7.17.21", "8.13.3", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down Expand Up @@ -438,7 +438,7 @@ steps:
- graalvm-ce17
- openjdk17
- openjdk21
BWC_VERSION: ["7.17.20", "8.13.3", "8.14.0"]
BWC_VERSION: ["7.17.21", "8.13.3", "8.14.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
2 changes: 1 addition & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BWC_VERSION:
- "7.14.2"
- "7.15.2"
- "7.16.3"
- "7.17.20"
- "7.17.21"
- "8.0.1"
- "8.1.3"
- "8.2.3"
Expand Down
2 changes: 1 addition & 1 deletion .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BWC_VERSION:
- "7.17.20"
- "7.17.21"
- "8.13.3"
- "8.14.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.gradle.internal.doc

import org.elasticsearch.gradle.fixtures.AbstractGradleInternalPluginFuncTest
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitPlugin
import org.gradle.testkit.runner.TaskOutcome

class DocsTestPluginFuncTest extends AbstractGradleInternalPluginFuncTest {
Class<? extends PrecommitPlugin> pluginClassUnderTest = DocsTestPlugin.class

def setup() {
File docDir = new File(projectDir, 'doc');
docDir.mkdirs()
addSampleDoc(docDir)
buildApiRestrictionsDisabled = true
configurationCacheCompatible = false;
buildFile << """
tasks.named('listSnippets') {
docs = fileTree('doc')
}
tasks.named('listConsoleCandidates') {
docs = fileTree('doc')
}
"""
}

def "can list snippets"() {
when:
def result = gradleRunner("listSnippets").build()
then:
result.task(":listSnippets").outcome == TaskOutcome.SUCCESS
assertOutputContains(result.output, """
> Task :listSnippets
mapper-annotated-text.asciidoc[37:39](Painless)
mapper-annotated-text.asciidoc[42:44](js)
mapper-annotated-text.asciidoc[51:69](console)// TEST[setup:seats]
""")
}

def "can console candidates"() {
when:
def result = gradleRunner("listConsoleCandidates").build()
then:
result.task(":listConsoleCandidates").outcome == TaskOutcome.SUCCESS
assertOutputContains(result.output, """
> Task :listConsoleCandidates
mapper-annotated-text.asciidoc[42:44](js)
""")
}

void addSampleDoc(File docFolder) {
new File(docFolder, "mapper-annotated-text.asciidoc").text = """
[[painless-filter-context]]
=== Filter context
Use a Painless script as a {ref}/query-dsl-script-query.html[filter] in a
query to include and exclude documents.
*Variables*
`params` (`Map`, read-only)::
User-defined parameters passed in as part of the query.
`doc` (`Map`, read-only)::
Contains the fields of the current document where each field is a
`List` of values.
*Return*
`boolean`::
Return `true` if the current document should be returned as a result of
the query, and `false` otherwise.
*API*
The standard <<painless-api-reference-shared, Painless API>> is available.
*Example*
To run this example, first follow the steps in
<<painless-context-examples, context examples>>.
This script finds all unsold documents that cost less than \$25.
[source,Painless]
----
doc['sold'].value == false && doc['cost'].value < 25
----
[source,js]
----
curl 'hello world'
----
Defining `cost` as a script parameter enables the cost to be configured
in the script query request. For example, the following request finds
all available theatre seats for evening performances that are under \$25.
[source,console]
----
GET seats/_search
{
"query": {
"bool": {
"filter": {
"script": {
"script": {
"source": "doc['sold'].value == false && doc['cost'].value < params.cost",
"params": {
"cost": 25
}
}
}
}
}
}
}
----
// TEST[setup:seats]
"""
}
}

This file was deleted.

Loading

0 comments on commit 736807e

Please sign in to comment.