Skip to content

Commit

Permalink
Merge branch 'master' into alerting/actions-usage-count
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Nov 1, 2019
2 parents 38047c2 + bfdf617 commit bdd1bf9
Show file tree
Hide file tree
Showing 1,917 changed files with 32,313 additions and 68,988 deletions.
38 changes: 28 additions & 10 deletions .ci/Jenkinsfile_flaky
Expand Up @@ -8,26 +8,28 @@ 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 EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
def AGENT_COUNT = getAgentCount(EXECUTIONS)

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
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"

stage("Kibana Pipeline") {
timeout(time: 180, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
def agents = [:]
for(def agentNumber = 1; agentNumber <= agentCount; agentNumber++) {
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
def agentNumberInside = agentNumber
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
agents["agent-${agentNumber}"] = {
catchError {
print "Agent ${agentNumberInside} - ${agentExecutions} executions"

kibanaPipeline.withWorkers('flaky-test-runner', {
if (!IS_XPACK) {
kibanaPipeline.buildOss()
Expand All @@ -37,7 +39,7 @@ stage("Kibana Pipeline") {
} else {
kibanaPipeline.buildXpack()
}
}, getWorkerMap(agentNumber, params.NUMBER_EXECUTIONS.toInteger(), worker, workerFailures))()
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
}
}
}
Expand Down Expand Up @@ -77,17 +79,20 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
}
}

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

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}"]) {
withEnv([
"JOB=agent-${agentNumber}-worker-${workerNumber}-${j}",
"REMOVE_KIBANA_INSTALL_DIR=1",
]) {
catchError {
try {
worker(workerNumber)
Expand All @@ -104,10 +109,23 @@ def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWor
return workerMap
}

def getAgentCount(executions) {
// Increase agent count every 24 worker processess, up to 3 agents maximum
return Math.min(3, 1 + floor(executions/24))
}

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

return str;
}

// All of the real rounding/truncating methods are sandboxed
def floor(num) {
return num
.toString()
.split('\\.')[0]
.toInteger()
}
4 changes: 2 additions & 2 deletions .ci/jobs.yml
Expand Up @@ -14,7 +14,7 @@ JOB:
- kibana-ciGroup10
- kibana-ciGroup11
- kibana-ciGroup12
# - kibana-visualRegression
- kibana-visualRegression

# make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh
- x-pack-firefoxSmoke
Expand All @@ -28,7 +28,7 @@ JOB:
- x-pack-ciGroup8
- x-pack-ciGroup9
- x-pack-ciGroup10
# - x-pack-visualRegression
- x-pack-visualRegression

# `~` is yaml for `null`
exclude: ~
191 changes: 189 additions & 2 deletions .eslintrc.js
Expand Up @@ -55,6 +55,193 @@ module.exports = {
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],

overrides: [
/**
* Temporarily disable some react rules for specific plugins, remove in separate PRs
*/
{
files: ['packages/kbn-ui-framework/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/no-onchange': 'off',
},
},
{
files: ['src/core/public/application/**/*.{js,ts,tsx}'],
rules: {
'react/no-danger': 'off',
},
},
{
files: ['src/legacy/core_plugins/console/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/data/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/expressions/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/kbn_vislib_vis_types/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/kibana/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/tile_map/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_markdown/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_metric/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_table/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/core_plugins/vis_type_vega/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/legacy/ui/public/vis/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/es_ui_shared/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/eui_utils/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_utils/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/canvas/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/cross_cluster_replication/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/graph/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/infra/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/lens/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/ml/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/monitoring/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/uptime/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/watcher/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},

/**
* Prettier
*/
Expand Down Expand Up @@ -175,10 +362,10 @@ module.exports = {
'!src/core/server/*.test.mocks.ts',

'src/plugins/**/public/**/*',
'!src/plugins/**/public/index*',
'!src/plugins/**/public/index.{js,ts,tsx}',

'src/plugins/**/server/**/*',
'!src/plugins/**/server/index*',
'!src/plugins/**/server/index.{js,ts,tsx}',
],
allowSameFolder: true,
},
Expand Down
15 changes: 10 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -8,9 +8,14 @@

# App Architecture
/src/plugins/data/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/embeddable/ @elastic/kibana-app-arch
/src/plugins/expressions/ @elastic/kibana-app-arch
/src/plugins/kibana_react/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/navigation/ @elastic/kibana-app-arch
/src/plugins/ui_actions/ @elastic/kibana-app-arch
/src/plugins/visualizations/ @elastic/kibana-app-arch
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
Expand All @@ -37,7 +42,9 @@
/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
# 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/ml-ui @elastic/es-ui

# Operations
/renovate.json5 @elastic/kibana-operations
Expand All @@ -56,6 +63,7 @@
/src/legacy/server/saved_objects/ @elastic/kibana-platform
/config/kibana.yml @elastic/kibana-platform
/x-pack/plugins/features/ @elastic/kibana-platform
/x-pack/plugins/licensing/ @elastic/kibana-platform

# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
Expand Down Expand Up @@ -88,9 +96,6 @@
/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

0 comments on commit bdd1bf9

Please sign in to comment.