Skip to content

Commit 9e0c028

Browse files
committed
Merge branch 'master' into task-manager/schema-config
* master: (55 commits) [ui/public/utils] Copy rarely used items to where they are consumed (elastic#53819) set AppArch team as an owner of the search endpoints (elastic#54131) Don't expose Elasticsearch client as Observable (elastic#53824) [SIEM] Cleanup unnecessary use of enzyme-to-json (elastic#53980) fix ui exports doc (elastic#54138) change markdown element title (elastic#54194) [Logs UI] Refactor log position to hooks (elastic#53540) [SIEM] Implement NP Plugin Setup (elastic#54030) [DOCS] Updates ML links (elastic#53613) sort renovate packages in config Spaces - fix flakey api tests (elastic#54154) Remove dependency that was causing effect to re-execute infinitely. (elastic#54160) [dev/run] expose unexpected flags as more than just names (elastic#54080) [DOCS] Moves index pattern doc to Discover (elastic#53347) [SIEM] Cleanup React imports (elastic#53981) Update eslint related packages (elastic#54107) [Uptime] Added date range filter into expanded list query (elastic#52609) [SIEM] Add react/display-name eslint rule (elastic#53107) [SIEM] Enable eslint prefer-template rule (elastic#53983) Elasticsearch snapshots automation (elastic#53706) ...
2 parents e4263e5 + 71ff2de commit 9e0c028

File tree

1,139 files changed

+16469
-12569
lines changed

Some content is hidden

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

1,139 files changed

+16469
-12569
lines changed
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#!/bin/groovy
2+
3+
// This job effectively has two SCM configurations:
4+
// one for kibana, used to check out this Jenkinsfile (which means it's the job's main SCM configuration), as well as kick-off the downstream verification job
5+
// one for elasticsearch, used to check out the elasticsearch source before building it
6+
7+
// There are two parameters that drive which branch is checked out for each of these, but they will typically be the same
8+
// 'branch_specifier' is for kibana / the job itself
9+
// ES_BRANCH is for elasticsearch
10+
11+
library 'kibana-pipeline-library'
12+
kibanaLibrary.load()
13+
14+
def ES_BRANCH = params.ES_BRANCH
15+
16+
if (!ES_BRANCH) {
17+
error "Parameter 'ES_BRANCH' must be specified."
18+
}
19+
20+
currentBuild.displayName += " - ${ES_BRANCH}"
21+
currentBuild.description = "ES: ${ES_BRANCH}<br />Kibana: ${params.branch_specifier}"
22+
23+
def PROMOTE_WITHOUT_VERIFY = !!params.PROMOTE_WITHOUT_VERIFICATION
24+
25+
timeout(time: 120, unit: 'MINUTES') {
26+
timestamps {
27+
ansiColor('xterm') {
28+
node('linux && immutable') {
29+
catchError {
30+
def VERSION
31+
def SNAPSHOT_ID
32+
def DESTINATION
33+
34+
def scmVars = checkoutEs(ES_BRANCH)
35+
def GIT_COMMIT = scmVars.GIT_COMMIT
36+
def GIT_COMMIT_SHORT = sh(script: "git rev-parse --short ${GIT_COMMIT}", returnStdout: true).trim()
37+
38+
buildArchives('to-archive')
39+
40+
dir('to-archive') {
41+
def now = new Date()
42+
def date = now.format("yyyyMMdd-HHmmss")
43+
44+
def filesRaw = sh(script: "ls -1", returnStdout: true).trim()
45+
def files = filesRaw
46+
.split("\n")
47+
.collect { filename ->
48+
// Filename examples
49+
// elasticsearch-oss-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
50+
// elasticsearch-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
51+
def parts = filename.replace("elasticsearch-oss", "oss").split("-")
52+
53+
VERSION = VERSION ?: parts[1]
54+
SNAPSHOT_ID = SNAPSHOT_ID ?: "${date}_${GIT_COMMIT_SHORT}"
55+
DESTINATION = DESTINATION ?: "${VERSION}/archives/${SNAPSHOT_ID}"
56+
57+
return [
58+
filename: filename,
59+
checksum: filename + '.sha512',
60+
url: "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${DESTINATION}/${filename}".toString(),
61+
version: parts[1],
62+
platform: parts[3],
63+
architecture: parts[4].split('\\.')[0],
64+
license: parts[0] == 'oss' ? 'oss' : 'default',
65+
]
66+
}
67+
68+
sh 'find * -exec bash -c "shasum -a 512 {} > {}.sha512" \\;'
69+
70+
def manifest = [
71+
bucket: "kibana-ci-es-snapshots-daily/${DESTINATION}".toString(),
72+
branch: ES_BRANCH,
73+
sha: GIT_COMMIT,
74+
sha_short: GIT_COMMIT_SHORT,
75+
version: VERSION,
76+
generated: now.format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC")),
77+
archives: files,
78+
]
79+
def manifestJson = toJSON(manifest).toString()
80+
writeFile file: 'manifest.json', text: manifestJson
81+
82+
upload(DESTINATION, '*.*')
83+
84+
sh "cp manifest.json manifest-latest.json"
85+
upload(VERSION, 'manifest-latest.json')
86+
}
87+
88+
if (PROMOTE_WITHOUT_VERIFY) {
89+
esSnapshots.promote(VERSION, SNAPSHOT_ID)
90+
91+
emailext(
92+
to: 'build-kibana@elastic.co',
93+
subject: "ES snapshot promoted without verification: ${params.ES_BRANCH}",
94+
body: '${SCRIPT,template="groovy-html.template"}',
95+
mimeType: 'text/html',
96+
)
97+
} else {
98+
build(
99+
propagate: false,
100+
wait: false,
101+
job: 'elasticsearch+snapshots+verify',
102+
parameters: [
103+
string(name: 'branch_specifier', value: branch_specifier),
104+
string(name: 'SNAPSHOT_VERSION', value: VERSION),
105+
string(name: 'SNAPSHOT_ID', value: SNAPSHOT_ID),
106+
]
107+
)
108+
}
109+
}
110+
111+
kibanaPipeline.sendMail()
112+
}
113+
}
114+
}
115+
}
116+
117+
def checkoutEs(branch) {
118+
retryWithDelay(8, 15) {
119+
return checkout([
120+
$class: 'GitSCM',
121+
branches: [[name: branch]],
122+
doGenerateSubmoduleConfigurations: false,
123+
extensions: [],
124+
submoduleCfg: [],
125+
userRemoteConfigs: [[
126+
credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
127+
url: 'git@github.com:elastic/elasticsearch',
128+
]],
129+
])
130+
}
131+
}
132+
133+
def upload(destination, pattern) {
134+
return googleStorageUpload(
135+
credentialsId: 'kibana-ci-gcs-plugin',
136+
bucket: "gs://kibana-ci-es-snapshots-daily/${destination}",
137+
pattern: pattern,
138+
sharedPublicly: false,
139+
showInline: false,
140+
)
141+
}
142+
143+
def buildArchives(destination) {
144+
def props = readProperties file: '.ci/java-versions.properties'
145+
withEnv([
146+
// Select the correct JDK for this branch
147+
"PATH=/var/lib/jenkins/.java/${props.ES_BUILD_JAVA}/bin:${env.PATH}",
148+
149+
// These Jenkins env vars trigger some automation in the elasticsearch repo that we don't want
150+
"BUILD_NUMBER=",
151+
"JENKINS_URL=",
152+
"BUILD_URL=",
153+
"JOB_NAME=",
154+
"NODE_NAME=",
155+
]) {
156+
sh """
157+
./gradlew -p distribution/archives assemble --parallel
158+
mkdir -p ${destination}
159+
find distribution/archives -type f \\( -name 'elasticsearch-*-*-*-*.tar.gz' -o -name 'elasticsearch-*-*-*-*.zip' \\) -not -path *no-jdk* -exec cp {} ${destination} \\;
160+
"""
161+
}
162+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/groovy
2+
3+
if (!params.branches_yaml) {
4+
error "'branches_yaml' parameter must be specified"
5+
}
6+
7+
def branches = readYaml text: params.branches_yaml
8+
9+
branches.each { branch ->
10+
build(
11+
propagate: false,
12+
wait: false,
13+
job: 'elasticsearch+snapshots+build',
14+
parameters: [
15+
string(name: 'branch_specifier', value: branch),
16+
string(name: 'ES_BRANCH', value: branch),
17+
]
18+
)
19+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
def SNAPSHOT_VERSION = params.SNAPSHOT_VERSION
7+
def SNAPSHOT_ID = params.SNAPSHOT_ID
8+
9+
if (!SNAPSHOT_VERSION) {
10+
error "Parameter SNAPSHOT_VERSION must be specified"
11+
}
12+
13+
if (!SNAPSHOT_ID) {
14+
error "Parameter SNAPSHOT_ID must be specified"
15+
}
16+
17+
currentBuild.displayName += " - ${SNAPSHOT_VERSION}"
18+
currentBuild.description = "ES: ${SNAPSHOT_VERSION}<br />Kibana: ${params.branch_specifier}"
19+
20+
def SNAPSHOT_MANIFEST = "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${SNAPSHOT_VERSION}/archives/${SNAPSHOT_ID}/manifest.json"
21+
22+
timeout(time: 120, unit: 'MINUTES') {
23+
timestamps {
24+
ansiColor('xterm') {
25+
catchError {
26+
withEnv(["ES_SNAPSHOT_MANIFEST=${SNAPSHOT_MANIFEST}"]) {
27+
parallel([
28+
// TODO we just need to run integration tests from intake?
29+
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
30+
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
31+
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
32+
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
33+
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
34+
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
35+
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
36+
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
37+
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
38+
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
39+
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
40+
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
41+
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
42+
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
43+
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
44+
]),
45+
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
46+
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
47+
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
48+
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
49+
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
50+
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
51+
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
52+
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
53+
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
54+
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
55+
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
56+
]),
57+
])
58+
}
59+
60+
promoteSnapshot(SNAPSHOT_VERSION, SNAPSHOT_ID)
61+
}
62+
63+
kibanaPipeline.sendMail()
64+
}
65+
}
66+
}
67+
68+
def promoteSnapshot(snapshotVersion, snapshotId) {
69+
node('linux && immutable') {
70+
esSnapshots.promote(snapshotVersion, snapshotId)
71+
}
72+
}

.eslintrc.js

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ module.exports = {
177177
'react-hooks/exhaustive-deps': 'off',
178178
},
179179
},
180-
{
181-
files: ['x-pack/legacy/plugins/monitoring/**/*.{js,ts,tsx}'],
182-
rules: {
183-
'jsx-a11y/click-events-have-key-events': 'off',
184-
},
185-
},
186180
{
187181
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
188182
rules: {
@@ -729,30 +723,27 @@ module.exports = {
729723
'no-unreachable': 'error',
730724
'no-unsafe-finally': 'error',
731725
'no-useless-call': 'error',
732-
// This will be turned on after bug fixes are mostly complete
733-
// 'no-useless-catch': 'warn',
726+
'no-useless-catch': 'error',
734727
'no-useless-concat': 'error',
735728
'no-useless-computed-key': 'error',
736729
// This will be turned on after bug fixes are mostly complete
737730
// 'no-useless-escape': 'warn',
738731
'no-useless-rename': 'error',
739-
// This will be turned on after bug fixes are mostly complete
740-
// 'no-useless-return': 'warn',
732+
'no-useless-return': 'error',
741733
// This will be turned on after bug fixers are mostly complete
742734
// 'no-void': 'warn',
743735
'one-var-declaration-per-line': 'error',
744736
'prefer-object-spread': 'error',
745737
'prefer-promise-reject-errors': 'error',
746738
'prefer-rest-params': 'error',
747739
'prefer-spread': 'error',
748-
// This style will be turned on after most bugs are fixed
749-
// 'prefer-template': 'warn',
740+
'prefer-template': 'error',
750741
'react/boolean-prop-naming': 'error',
751742
'react/button-has-type': 'error',
743+
'react/display-name': 'error',
752744
'react/forbid-dom-props': 'error',
753745
'react/no-access-state-in-setstate': 'error',
754-
// This style will be turned on after most bugs are fixed
755-
// 'react/no-children-prop': 'warn',
746+
'react/no-children-prop': 'error',
756747
'react/no-danger-with-children': 'error',
757748
'react/no-deprecated': 'error',
758749
'react/no-did-mount-set-state': 'error',
@@ -814,21 +805,6 @@ module.exports = {
814805
},
815806
},
816807

817-
/**
818-
* Monitoring overrides
819-
*/
820-
{
821-
files: ['x-pack/legacy/plugins/monitoring/**/*.js'],
822-
rules: {
823-
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
824-
'no-else-return': 'error',
825-
},
826-
},
827-
{
828-
files: ['x-pack/legacy/plugins/monitoring/public/**/*.js'],
829-
env: { browser: true },
830-
},
831-
832808
/**
833809
* Canvas overrides
834810
*/

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/src/plugins/visualizations/ @elastic/kibana-app-arch
3131
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
3232
/src/legacy/core_plugins/data/ @elastic/kibana-app-arch
33+
/src/legacy/core_plugins/elasticsearch/lib/create_proxy.js @elastic/kibana-app-arch
3334
/src/legacy/core_plugins/embeddable_api/ @elastic/kibana-app-arch
3435
/src/legacy/core_plugins/interpreter/ @elastic/kibana-app-arch
3536
/src/legacy/core_plugins/kibana_react/ @elastic/kibana-app-arch

docs/developer/plugin/development-uiexports.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ An aggregate list of available UiExport types:
99
| hacks | Any module that should be included in every application
1010
| visTypes | Modules that register providers with the `ui/registry/vis_types` registry.
1111
| inspectorViews | Modules that register custom inspector views via the `viewRegistry` in `ui/inspector`.
12-
| chromeNavControls | Modules that register providers with the `ui/registry/chrome_nav_controls` registry.
13-
| navbarExtensions | Modules that register providers with the `ui/registry/navbar_extensions` registry.
14-
| docViews | Modules that register providers with the `ui/registry/doc_views` registry.
12+
| chromeNavControls | Modules that register providers with the `ui/registry/chrome_header_nav_controls` registry.
13+
| navbarExtensions | Modules that register providers with the setup contract of the `navigation` plugin.
14+
| docViews | Modules that register providers with the setup contract method `addDocView` of the `discover` plugin.
1515
| app | Adds an application to the system. This uiExport type is defined as an object of metadata rather than just a module id.
1616
|=======================================================================

docs/development/core/public/kibana-plugin-public.savedobjectsclient.find.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Search for objects
99
<b>Signature:</b>
1010

1111
```typescript
12-
find: <T extends SavedObjectAttributes>(options: Pick<SavedObjectFindOptionsServer, "search" | "filter" | "type" | "page" | "fields" | "searchFields" | "defaultSearchOperator" | "hasReference" | "sortField" | "perPage">) => Promise<SavedObjectsFindResponsePublic<T>>;
12+
find: <T extends SavedObjectAttributes>(options: Pick<SavedObjectFindOptionsServer, "search" | "filter" | "type" | "page" | "perPage" | "sortField" | "fields" | "searchFields" | "hasReference" | "defaultSearchOperator">) => Promise<SavedObjectsFindResponsePublic<T>>;
1313
```

docs/development/core/public/kibana-plugin-public.savedobjectsclient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The constructor for this class is marked as internal. Third-party code should no
2424
| [bulkGet](./kibana-plugin-public.savedobjectsclient.bulkget.md) | | <code>(objects?: {</code><br/><code> id: string;</code><br/><code> type: string;</code><br/><code> }[]) =&gt; Promise&lt;SavedObjectsBatchResponse&lt;SavedObjectAttributes&gt;&gt;</code> | Returns an array of objects by id |
2525
| [create](./kibana-plugin-public.savedobjectsclient.create.md) | | <code>&lt;T extends SavedObjectAttributes&gt;(type: string, attributes: T, options?: SavedObjectsCreateOptions) =&gt; Promise&lt;SimpleSavedObject&lt;T&gt;&gt;</code> | Persists an object |
2626
| [delete](./kibana-plugin-public.savedobjectsclient.delete.md) | | <code>(type: string, id: string) =&gt; Promise&lt;{}&gt;</code> | Deletes an object |
27-
| [find](./kibana-plugin-public.savedobjectsclient.find.md) | | <code>&lt;T extends SavedObjectAttributes&gt;(options: Pick&lt;SavedObjectFindOptionsServer, &quot;search&quot; &#124; &quot;filter&quot; &#124; &quot;type&quot; &#124; &quot;page&quot; &#124; &quot;fields&quot; &#124; &quot;searchFields&quot; &#124; &quot;defaultSearchOperator&quot; &#124; &quot;hasReference&quot; &#124; &quot;sortField&quot; &#124; &quot;perPage&quot;&gt;) =&gt; Promise&lt;SavedObjectsFindResponsePublic&lt;T&gt;&gt;</code> | Search for objects |
27+
| [find](./kibana-plugin-public.savedobjectsclient.find.md) | | <code>&lt;T extends SavedObjectAttributes&gt;(options: Pick&lt;SavedObjectFindOptionsServer, &quot;search&quot; &#124; &quot;filter&quot; &#124; &quot;type&quot; &#124; &quot;page&quot; &#124; &quot;perPage&quot; &#124; &quot;sortField&quot; &#124; &quot;fields&quot; &#124; &quot;searchFields&quot; &#124; &quot;hasReference&quot; &#124; &quot;defaultSearchOperator&quot;&gt;) =&gt; Promise&lt;SavedObjectsFindResponsePublic&lt;T&gt;&gt;</code> | Search for objects |
2828
| [get](./kibana-plugin-public.savedobjectsclient.get.md) | | <code>&lt;T extends SavedObjectAttributes&gt;(type: string, id: string) =&gt; Promise&lt;SimpleSavedObject&lt;T&gt;&gt;</code> | Fetches a single object |
2929

3030
## Methods

docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Creates an instance of [IScopedClusterClient](./kibana-plugin-server.iscopedclus
99
<b>Signature:</b>
1010

1111
```typescript
12-
asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): IScopedClusterClient;
12+
asScoped(request?: ScopeableRequest): IScopedClusterClient;
1313
```
1414

1515
## Parameters
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| request | <code>KibanaRequest &#124; LegacyRequest &#124; FakeRequest</code> | Request the <code>IScopedClusterClient</code> instance will be scoped to. Supports request optionality, Legacy.Request &amp; FakeRequest for BWC with LegacyPlatform |
19+
| request | <code>ScopeableRequest</code> | Request the <code>IScopedClusterClient</code> instance will be scoped to. Supports request optionality, Legacy.Request &amp; FakeRequest for BWC with LegacyPlatform |
2020

2121
<b>Returns:</b>
2222

docs/development/core/server/kibana-plugin-server.clusterclient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ClusterClient class
66

7-
Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`<!-- -->).
7+
Represents an Elasticsearch cluster API client created by the platform. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via `asScoped(...)`<!-- -->).
88

99
See [ClusterClient](./kibana-plugin-server.clusterclient.md)<!-- -->.
1010

0 commit comments

Comments
 (0)