Skip to content

Commit 280562d

Browse files
Merge branch 'master' into fix-new-job-with-must_not-saved-search
2 parents a04fdfd + 0173ef3 commit 280562d

File tree

1,723 files changed

+43323
-20736
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,723 files changed

+43323
-20736
lines changed
File renamed without changes.

.ci/Jenkinsfile_baseline_trigger

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/groovy
2+
3+
def MAXIMUM_COMMITS_TO_CHECK = 10
4+
def MAXIMUM_COMMITS_TO_BUILD = 5
5+
6+
if (!params.branches_yaml) {
7+
error "'branches_yaml' parameter must be specified"
8+
}
9+
10+
def additionalBranches = []
11+
12+
def branches = readYaml(text: params.branches_yaml) + additionalBranches
13+
14+
library 'kibana-pipeline-library'
15+
kibanaLibrary.load()
16+
17+
withGithubCredentials {
18+
branches.each { branch ->
19+
stage(branch) {
20+
def commits = getCommits(branch, MAXIMUM_COMMITS_TO_CHECK, MAXIMUM_COMMITS_TO_BUILD)
21+
22+
commits.take(MAXIMUM_COMMITS_TO_BUILD).each { commit ->
23+
catchErrors {
24+
githubCommitStatus.create(commit, 'pending', 'Baseline started.', 'kibana-ci-baseline')
25+
26+
build(
27+
propagate: false,
28+
wait: false,
29+
job: 'elastic+kibana+baseline-capture',
30+
parameters: [
31+
string(name: 'branch_specifier', value: branch),
32+
string(name: 'commit', value: commit),
33+
]
34+
)
35+
}
36+
}
37+
}
38+
}
39+
}
40+
41+
def getCommits(String branch, maximumCommitsToCheck, maximumCommitsToBuild) {
42+
print "Getting latest commits for ${branch}..."
43+
def commits = githubApi.get("repos/elastic/kibana/commits?sha=${branch}").take(maximumCommitsToCheck).collect { it.sha }
44+
def commitsToBuild = []
45+
46+
for (commit in commits) {
47+
print "Getting statuses for ${commit}"
48+
def status = githubApi.get("repos/elastic/kibana/statuses/${commit}").find { it.context == 'kibana-ci-baseline' }
49+
print "Commit '${commit}' already built? ${status ? 'Yes' : 'No'}"
50+
51+
if (!status) {
52+
commitsToBuild << commit
53+
} else {
54+
// Stop at the first commit we find that's already been triggered
55+
break
56+
}
57+
58+
if (commitsToBuild.size() >= maximumCommitsToBuild) {
59+
break
60+
}
61+
}
62+
63+
return commitsToBuild.reverse() // We want the builds to trigger oldest-to-newest
64+
}

.ci/packer_cache_for_branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ node scripts/es snapshot --download-only;
1818
node scripts/es snapshot --license=oss --download-only;
1919

2020
# download reporting browsers
21-
(cd "x-pack" && yarn gulp prepare);
21+
(cd "x-pack" && yarn gulp downloadChromium);
2222

2323
# cache the chromedriver archive
2424
chromedriverDistVersion="$(node -e "console.log(require('chromedriver').version)")"

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ target
2626
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
2727
/src/plugins/vis_type_timelion/public/_generated_/**
2828
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
29+
/src/plugins/timelion/public/webpackShims/jquery.flot.*
2930
/x-pack/legacy/plugins/**/__tests__/fixtures/**
3031
/x-pack/plugins/apm/e2e/**/snapshots.js
3132
/x-pack/plugins/apm/e2e/tmp/*

.eslintrc.js

Lines changed: 228 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ const ELASTIC_LICENSE_HEADER = `
4949
*/
5050
`;
5151

52+
const SAFER_LODASH_SET_HEADER = `
53+
/*
54+
* Elasticsearch B.V licenses this file to you under the MIT License.
55+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
56+
*/
57+
`;
58+
59+
const SAFER_LODASH_SET_LODASH_HEADER = `
60+
/*
61+
* This file is forked from the lodash project (https://lodash.com/),
62+
* and may include modifications made by Elasticsearch B.V.
63+
* Elasticsearch B.V. licenses this file to you under the MIT License.
64+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
65+
*/
66+
`;
67+
68+
const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = `
69+
/*
70+
* This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped),
71+
* and may include modifications made by Elasticsearch B.V.
72+
* Elasticsearch B.V. licenses this file to you under the MIT License.
73+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
74+
*/
75+
`;
76+
5277
const allMochaRulesOff = {};
5378
Object.keys(require('eslint-plugin-mocha').rules).forEach((k) => {
5479
allMochaRulesOff['mocha/' + k] = 'off';
@@ -143,7 +168,12 @@ module.exports = {
143168
'@kbn/eslint/disallow-license-headers': [
144169
'error',
145170
{
146-
licenses: [ELASTIC_LICENSE_HEADER],
171+
licenses: [
172+
ELASTIC_LICENSE_HEADER,
173+
SAFER_LODASH_SET_HEADER,
174+
SAFER_LODASH_SET_LODASH_HEADER,
175+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
176+
],
147177
},
148178
],
149179
},
@@ -174,7 +204,82 @@ module.exports = {
174204
'@kbn/eslint/disallow-license-headers': [
175205
'error',
176206
{
177-
licenses: [APACHE_2_0_LICENSE_HEADER],
207+
licenses: [
208+
APACHE_2_0_LICENSE_HEADER,
209+
SAFER_LODASH_SET_HEADER,
210+
SAFER_LODASH_SET_LODASH_HEADER,
211+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
212+
],
213+
},
214+
],
215+
},
216+
},
217+
218+
/**
219+
* safer-lodash-set package requires special license headers
220+
*/
221+
{
222+
files: ['packages/elastic-safer-lodash-set/**/*.{js,mjs,ts,tsx}'],
223+
rules: {
224+
'@kbn/eslint/require-license-header': [
225+
'error',
226+
{
227+
license: SAFER_LODASH_SET_LODASH_HEADER,
228+
},
229+
],
230+
'@kbn/eslint/disallow-license-headers': [
231+
'error',
232+
{
233+
licenses: [
234+
ELASTIC_LICENSE_HEADER,
235+
APACHE_2_0_LICENSE_HEADER,
236+
SAFER_LODASH_SET_HEADER,
237+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
238+
],
239+
},
240+
],
241+
},
242+
},
243+
{
244+
files: ['packages/elastic-safer-lodash-set/test/*.{js,mjs,ts,tsx}'],
245+
rules: {
246+
'@kbn/eslint/require-license-header': [
247+
'error',
248+
{
249+
license: SAFER_LODASH_SET_HEADER,
250+
},
251+
],
252+
'@kbn/eslint/disallow-license-headers': [
253+
'error',
254+
{
255+
licenses: [
256+
ELASTIC_LICENSE_HEADER,
257+
APACHE_2_0_LICENSE_HEADER,
258+
SAFER_LODASH_SET_LODASH_HEADER,
259+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
260+
],
261+
},
262+
],
263+
},
264+
},
265+
{
266+
files: ['packages/elastic-safer-lodash-set/**/*.d.ts'],
267+
rules: {
268+
'@kbn/eslint/require-license-header': [
269+
'error',
270+
{
271+
license: SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
272+
},
273+
],
274+
'@kbn/eslint/disallow-license-headers': [
275+
'error',
276+
{
277+
licenses: [
278+
ELASTIC_LICENSE_HEADER,
279+
APACHE_2_0_LICENSE_HEADER,
280+
SAFER_LODASH_SET_HEADER,
281+
SAFER_LODASH_SET_LODASH_HEADER,
282+
],
178283
},
179284
],
180285
},
@@ -541,9 +646,129 @@ module.exports = {
541646
* Harden specific rules
542647
*/
543648
{
544-
files: ['test/harden/*.js'],
649+
files: ['test/harden/*.js', 'packages/elastic-safer-lodash-set/test/*.js'],
545650
rules: allMochaRulesOff,
546651
},
652+
{
653+
files: ['**/*.{js,mjs,ts,tsx}'],
654+
rules: {
655+
'no-restricted-imports': [
656+
2,
657+
{
658+
paths: [
659+
{
660+
name: 'lodash',
661+
importNames: ['set', 'setWith'],
662+
message: 'Please use @elastic/safer-lodash-set instead',
663+
},
664+
{
665+
name: 'lodash.set',
666+
message: 'Please use @elastic/safer-lodash-set instead',
667+
},
668+
{
669+
name: 'lodash.setwith',
670+
message: 'Please use @elastic/safer-lodash-set instead',
671+
},
672+
{
673+
name: 'lodash/set',
674+
message: 'Please use @elastic/safer-lodash-set instead',
675+
},
676+
{
677+
name: 'lodash/setWith',
678+
message: 'Please use @elastic/safer-lodash-set instead',
679+
},
680+
{
681+
name: 'lodash/fp',
682+
importNames: ['set', 'setWith', 'assoc', 'assocPath'],
683+
message: 'Please use @elastic/safer-lodash-set instead',
684+
},
685+
{
686+
name: 'lodash/fp/set',
687+
message: 'Please use @elastic/safer-lodash-set instead',
688+
},
689+
{
690+
name: 'lodash/fp/setWith',
691+
message: 'Please use @elastic/safer-lodash-set instead',
692+
},
693+
{
694+
name: 'lodash/fp/assoc',
695+
message: 'Please use @elastic/safer-lodash-set instead',
696+
},
697+
{
698+
name: 'lodash/fp/assocPath',
699+
message: 'Please use @elastic/safer-lodash-set instead',
700+
},
701+
],
702+
},
703+
],
704+
'no-restricted-modules': [
705+
2,
706+
{
707+
paths: [
708+
{
709+
name: 'lodash.set',
710+
message: 'Please use @elastic/safer-lodash-set instead',
711+
},
712+
{
713+
name: 'lodash.setwith',
714+
message: 'Please use @elastic/safer-lodash-set instead',
715+
},
716+
{
717+
name: 'lodash/set',
718+
message: 'Please use @elastic/safer-lodash-set instead',
719+
},
720+
{
721+
name: 'lodash/setWith',
722+
message: 'Please use @elastic/safer-lodash-set instead',
723+
},
724+
],
725+
},
726+
],
727+
'no-restricted-properties': [
728+
2,
729+
{
730+
object: 'lodash',
731+
property: 'set',
732+
message: 'Please use @elastic/safer-lodash-set instead',
733+
},
734+
{
735+
object: '_',
736+
property: 'set',
737+
message: 'Please use @elastic/safer-lodash-set instead',
738+
},
739+
{
740+
object: 'lodash',
741+
property: 'setWith',
742+
message: 'Please use @elastic/safer-lodash-set instead',
743+
},
744+
{
745+
object: '_',
746+
property: 'setWith',
747+
message: 'Please use @elastic/safer-lodash-set instead',
748+
},
749+
{
750+
object: 'lodash',
751+
property: 'assoc',
752+
message: 'Please use @elastic/safer-lodash-set instead',
753+
},
754+
{
755+
object: '_',
756+
property: 'assoc',
757+
message: 'Please use @elastic/safer-lodash-set instead',
758+
},
759+
{
760+
object: 'lodash',
761+
property: 'assocPath',
762+
message: 'Please use @elastic/safer-lodash-set instead',
763+
},
764+
{
765+
object: '_',
766+
property: 'assocPath',
767+
message: 'Please use @elastic/safer-lodash-set instead',
768+
},
769+
],
770+
},
771+
},
547772

548773
/**
549774
* APM overrides

.i18nrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"src/plugins/telemetry_management_section"
4545
],
4646
"tileMap": "src/plugins/tile_map",
47-
"timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
47+
"timelion": ["src/plugins/timelion", "src/plugins/vis_type_timelion"],
4848
"uiActions": "src/plugins/ui_actions",
4949
"visDefaultEditor": "src/plugins/vis_default_editor",
5050
"visTypeMarkdown": "src/plugins/vis_type_markdown",

.sass-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
files:
22
include:
33
- 'src/legacy/core_plugins/metrics/**/*.s+(a|c)ss'
4-
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
4+
- 'src/plugins/timelion/**/*.s+(a|c)ss'
55
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
66
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
77
- 'x-pack/plugins/canvas/**/*.s+(a|c)ss'

Jenkinsfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
4242
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
4343
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
4444
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
45-
// 'xpack-pageLoadMetrics': kibanaPipeline.functionalTestProcess('xpack-pageLoadMetrics', './test/scripts/jenkins_xpack_page_load_metrics.sh'),
4645
'xpack-securitySolutionCypress': { processNumber ->
4746
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
4847
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)

docs/api/dashboard/export-dashboard.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ experimental[] Export dashboards and corresponding saved objects.
3535

3636
[source,sh]
3737
--------------------------------------------------
38-
$ curl -X GET "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c" <1>
38+
$ curl -X GET api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c <1>
3939
--------------------------------------------------
4040
// KIBANA
4141

docs/api/dashboard/import-dashboard.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Use the complete response body from the <<dashboard-api-export, Export dashboard
4242

4343
[source,sh]
4444
--------------------------------------------------
45-
$ curl -X POST "localhost:5601/api/kibana/dashboards/import?exclude=index-pattern"
45+
$ curl -X POST api/kibana/dashboards/import?exclude=index-pattern
4646
{
4747
"objects": [
4848
{

0 commit comments

Comments
 (0)