Skip to content

Commit

Permalink
Merge branch 'master' into eslint-error
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 29, 2019
2 parents 218aa12 + c3996e2 commit d715867
Show file tree
Hide file tree
Showing 8,173 changed files with 587,692 additions and 224,655 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"upstream": "elastic/kibana",
"branches": [{ "name": "7.x", "checked": true }, "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"branches": [{ "name": "7.x", "checked": true }, "7.5", "7.4", "7.3", "7.2", "7.1", "7.0", "6.8", "6.7", "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"labels": ["backport"]
}
113 changes: 113 additions & 0 deletions .ci/Jenkinsfile_flaky
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/groovy

library 'kibana-pipeline-library'
kibanaLibrary.load()

// Looks like 'oss:ciGroup:1' or 'oss:firefoxSmoke'
def JOB_PARTS = params.CI_GROUP.split(':')
def IS_XPACK = JOB_PARTS[0] == 'xpack'
def JOB = JOB_PARTS[1]
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''

def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)

def workerFailures = []

currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
currentBuild.description = "${params.CI_GROUP}<br />Executions: ${params.NUMBER_EXECUTIONS}"

// Note: If you increase agent count, it will execute NUMBER_EXECUTIONS per agent. It will not divide them up amongst the agents
// e.g. NUMBER_EXECUTIONS = 25, agentCount = 4 results in 100 total executions
def agentCount = 1

stage("Kibana Pipeline") {
timeout(time: 180, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
def agents = [:]
for(def agentNumber = 1; agentNumber <= agentCount; agentNumber++) {
agents["agent-${agentNumber}"] = {
catchError {
kibanaPipeline.withWorkers('flaky-test-runner', {
if (!IS_XPACK) {
kibanaPipeline.buildOss()
if (CI_GROUP == '1') {
runbld "./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh"
}
} else {
kibanaPipeline.buildXpack()
}
}, getWorkerMap(agentNumber, params.NUMBER_EXECUTIONS.toInteger(), worker, workerFailures))()
}
}
}

parallel(agents)

currentBuild.description += ", Failures: ${workerFailures.size()}"

if (workerFailures.size() > 0) {
print "There were ${workerFailures.size()} test suite failures."
print "The executions that failed were:"
print workerFailures.join("\n")
print "Please check 'Test Result' and 'Pipeline Steps' pages for more info"
}
}
}
}
}

def getWorkerFromParams(isXpack, job, ciGroup) {
if (!isXpack) {
if (job == 'firefoxSmoke') {
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' })
} else if(job == 'visualRegression') {
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' })
} else {
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
}
}

if (job == 'firefoxSmoke') {
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' })
} else if(job == 'visualRegression') {
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' })
} else {
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
}
}

def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkers = 14) {
def workerMap = [:]
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkers)

for(def i = 1; i <= numberOfWorkers; i++) {
def workerExecutions = numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0)

workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
for(def j = 0; j < workerExecutions; j++) {
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
withEnv(["JOB=agent-${agentNumber}-worker-${workerNumber}-${j}"]) {
catchError {
try {
worker(workerNumber)
} catch (ex) {
workerFailures << "agent-${agentNumber} worker-${workerNumber}-${j}"
throw ex
}
}
}
}
}
}

return workerMap
}

def trunc(str, length) {
if (str.size() >= length) {
return str.take(length) + "..."
}

return str;
}
17 changes: 15 additions & 2 deletions .ci/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
JOB:
- intake
- firefoxSmoke
- kibana-intake
- x-pack-intake
- kibana-firefoxSmoke
- kibana-ciGroup1
- kibana-ciGroup2
- kibana-ciGroup3
- kibana-ciGroup4
- kibana-ciGroup5
- kibana-ciGroup6
- kibana-ciGroup7
- kibana-ciGroup8
- kibana-ciGroup9
- kibana-ciGroup10
- kibana-ciGroup11
- kibana-ciGroup12
# - kibana-visualRegression

# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-firefoxSmoke
- x-pack-ciGroup1
- x-pack-ciGroup2
- x-pack-ciGroup3
- x-pack-ciGroup4
- x-pack-ciGroup5
- x-pack-ciGroup6
- x-pack-ciGroup7
- x-pack-ciGroup8
- x-pack-ciGroup9
- x-pack-ciGroup10
# - x-pack-visualRegression

# `~` is yaml for `null`
Expand Down
10 changes: 8 additions & 2 deletions .ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source src/dev/ci_setup/setup.sh
source src/dev/ci_setup/checkout_sibling_es.sh

case "$JOB" in
intake)
kibana-intake)
./test/scripts/jenkins_unit.sh
;;
kibana-ciGroup*)
Expand All @@ -21,16 +21,22 @@ kibana-ciGroup*)
kibana-visualRegression*)
./test/scripts/jenkins_visual_regression.sh
;;
firefoxSmoke*)
kibana-firefoxSmoke*)
./test/scripts/jenkins_firefox_smoke.sh
;;
x-pack-intake)
./test/scripts/jenkins_xpack.sh
;;
x-pack-ciGroup*)
export CI_GROUP="${JOB##x-pack-ciGroup}"
./test/scripts/jenkins_xpack_ci_group.sh
;;
x-pack-visualRegression*)
./test/scripts/jenkins_xpack_visual_regression.sh
;;
x-pack-firefoxSmoke*)
./test/scripts/jenkins_xpack_firefox_smoke.sh
;;
*)
echo "JOB '$JOB' is not implemented."
exit 1
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ bower_components
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/packages/kbn-interpreter/src/common/lib/grammar.js
/x-pack/legacy/plugins/canvas/canvas_plugin
/x-pack/legacy/plugins/canvas/shareable_runtime/build
/x-pack/legacy/plugins/canvas/storybook
/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/legacy/plugins/infra/common/graphql/types.ts
/x-pack/legacy/plugins/infra/public/graphql/types.ts
/x-pack/legacy/plugins/infra/server/graphql/types.ts
/x-pack/legacy/plugins/apm/cypress/**/snapshots.js
/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken
**/graphql/types.ts
**/*.js.snap
!/.eslintrc.js
31 changes: 28 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

const { readdirSync } = require('fs');
const { resolve } = require('path');

Expand Down Expand Up @@ -149,6 +168,10 @@ module.exports = {
'src/core/server/**/*',
'!src/core/server/index.ts',
'!src/core/server/mocks.ts',
'!src/core/server/types.ts',
// for absolute imports until fixed in
// https://github.com/elastic/kibana/issues/36096
'!src/core/server/types',
'!src/core/server/*.test.mocks.ts',

'src/plugins/**/public/**/*',
Expand Down Expand Up @@ -510,6 +533,10 @@ module.exports = {
// typescript and javascript for front and back end
files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'],
plugins: ['eslint-plugin-node', 'react'],
env: {
mocha: true,
jest: true,
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
Expand Down Expand Up @@ -564,8 +591,7 @@ module.exports = {
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
// This will be turned on after bug fixes are mostly complete
// 'no-undef': 'warn',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
Expand Down Expand Up @@ -615,7 +641,6 @@ module.exports = {
// will introduced after the other warns are fixed
// 'react/sort-comp': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-boolean-value': ['error', 'warn'],
// will introduced after the other warns are fixed
// 'react/jsx-no-bind': 'error',
'react/jsx-no-comment-textnodes': 'error',
Expand Down
21 changes: 18 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

# App
/x-pack/legacy/plugins/lens/ @elastic/kibana-app
/x-pack/legacy/plugins/graph/ @elastic/kibana-app

# App Architecture
/src/plugins/data/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/kibana_react/ @elastic/kibana-app-arch
/src/plugins/navigation/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
/x-pack/test/functional/apps/apm/ @elastic/apm-ui
/src/legacy/core_plugins/apm_oss/ @elastic/apm-ui

# Beats
/x-pack/legacy/plugins/beats_management/ @elastic/beats
Expand All @@ -24,25 +28,32 @@
/x-pack/test/functional/apps/code/ @teams/code
/x-pack/test/api_integration/apis/code/ @teams/code

# Infrastructure and Logs UI
/x-pack/legacy/plugins/infra/ @elastic/infra-logs-ui
# Logs & Metrics UI
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
/x-pack/legacy/plugins/integrations_manager/ @elastic/epm

# Machine Learning
/x-pack/legacy/plugins/ml/ @elastic/ml-ui
/x-pack/test/functional/apps/machine_learning/ @elastic/ml-ui
/x-pack/test/functional/services/machine_learning/ @elastic/ml-ui
/x-pack/test/functional/services/ml.ts @elastic/ml-ui
/x-pack/legacy/plugins/transform/ @elastic/ml-ui

# Operations
/renovate.json5 @elastic/kibana-operations
/src/dev/ @elastic/kibana-operations
/src/setup_node_env/ @elastic/kibana-operations
/src/optimize/ @elastic/kibana-operations
/packages/*eslint*/ @elastic/kibana-operations
/packages/*babel*/ @elastic/kibana-operations
/packages/kbn-dev-utils*/ @elastic/kibana-operations
/packages/kbn-es/ @elastic/kibana-operations
/packages/kbn-pm/ @elastic/kibana-operations
/packages/kbn-test/ @elastic/kibana-operations

# Platform
/src/core/ @elastic/kibana-platform
/src/legacy/server/saved_objects/ @elastic/kibana-platform
/src/legacy/ui/public/saved_objects @elastic/kibana-platform
/config/kibana.yml @elastic/kibana-platform
/x-pack/plugins/features/ @elastic/kibana-platform

Expand All @@ -52,6 +63,7 @@
/x-pack/legacy/plugins/encrypted_saved_objects/ @elastic/kibana-security
/src/legacy/server/csp/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security

# Kibana Stack Services
/packages/kbn-analytics/ @elastic/kibana-stack-services
Expand All @@ -76,6 +88,9 @@
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
/x-pack/legacy/plugins/searchprofiler/ @elastic/es-ui
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
# ML team owns the transform plugin, ES team added here for visibility
# because the plugin lives in Kibana's Elasticsearch management section.
/x-pack/legacy/plugins/transform/ @elastic/es-ui
/x-pack/legacy/plugins/watcher/ @elastic/es-ui

# Kibana TSVB external contractors
Expand Down
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- src/plugins/data/**/*
- src/plugins/embeddable/**/*
- src/plugins/kibana_react/**/*
- src/plugins/navigation/**/*
- src/plugins/kibana_utils/**/*
- src/legacy/core_plugins/dashboard_embeddable_container/**/*
- src/legacy/core_plugins/data/**/*
Expand Down
6 changes: 4 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"paths": {
"common.ui": "src/legacy/ui",
"data": "src/legacy/core_plugins/data",
"data": ["src/legacy/core_plugins/data", "src/plugins/data"],
"expressions": "src/legacy/core_plugins/expressions",
"kibana_react": "src/legacy/core_plugins/kibana_react",
"navigation": "src/legacy/core_plugins/navigation",
"server": "src/legacy/server",
"console": "src/legacy/core_plugins/console",
"core": "src/core",
Expand All @@ -13,7 +14,7 @@
"dashboardEmbeddableContainer": "src/legacy/core_plugins/dashboard_embeddable_container",
"kbn": "src/legacy/core_plugins/kibana",
"kbnDocViews": "src/legacy/core_plugins/kbn_doc_views",
"embeddableApi": "src/legacy/core_plugins/embeddable_api",
"embeddableApi": "src/plugins/embeddable",
"kbnVislibVisTypes": "src/legacy/core_plugins/kbn_vislib_vis_types",
"visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
"visTypeMetric": "src/legacy/core_plugins/vis_type_metric",
Expand All @@ -28,6 +29,7 @@
"kbnESQuery": "packages/kbn-es-query",
"inspector": "src/plugins/inspector",
"kibana-react": "src/plugins/kibana_react",
"telemetry": "src/legacy/core_plugins/telemetry",
"esUi": "src/plugins/es_ui_shared",
"uiActions": "src/plugins/ui_actions"
},
Expand Down
3 changes: 3 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ files:
- 'x-pack/legacy/plugins/rollup/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
ignore:
- 'x-pack/legacy/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/lens/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss'
rules:
quotes:
- 2
Expand Down
Loading

0 comments on commit d715867

Please sign in to comment.