Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into file-upload-route…
Browse files Browse the repository at this point in the history
…-validation

# Conflicts:
#	x-pack/legacy/plugins/file_upload/server/plugin.js
#	x-pack/legacy/plugins/file_upload/server/routes/file_upload.js
  • Loading branch information
Aaron Caldwell committed Dec 23, 2019
2 parents 2b1de15 + 21d6202 commit 24b7c90
Show file tree
Hide file tree
Showing 9,708 changed files with 263,386 additions and 189,964 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
125 changes: 125 additions & 0 deletions .ci/end2end.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#!/usr/bin/env groovy

library identifier: 'apm@current',
retriever: modernSCM(
[$class: 'GitSCMSource',
credentialsId: 'f94e9298-83ae-417e-ba91-85c279771570',
id: '37cf2c00-2cc7-482e-8c62-7bbffef475e2',
remote: 'git@github.com:elastic/apm-pipeline-library.git'])

pipeline {
agent { label 'linux && immutable' }
environment {
BASE_DIR = 'src/github.com/elastic/kibana'
HOME = "${env.WORKSPACE}"
APM_ITS = 'apm-integration-testing'
CYPRESS_DIR = 'x-pack/legacy/plugins/apm/cypress'
PIPELINE_LOG_LEVEL = 'DEBUG'
}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
triggers {
issueCommentTrigger('(?i).*jenkins\\W+run\\W+(?:the\\W+)?e2e(?:\\W+please)?.*')
}
parameters {
booleanParam(name: 'FORCE', defaultValue: false, description: 'Whether to force the run.')
}
stages {
stage('Checkout') {
options { skipDefaultCheckout() }
steps {
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false,
shallow: false, reference: "/var/lib/jenkins/.git-references/kibana.git")
script {
dir("${BASE_DIR}"){
def regexps =[ "^x-pack/legacy/plugins/apm/.*" ]
env.APM_UPDATED = isGitRegionMatch(patterns: regexps)
}
}
dir("${APM_ITS}"){
git changelog: false,
credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
poll: false,
url: "git@github.com:elastic/${APM_ITS}.git"
}
}
}
stage('Start services') {
options { skipDefaultCheckout() }
when {
anyOf {
expression { return params.FORCE }
expression { return env.APM_UPDATED != "false" }
}
}
steps {
dir("${APM_ITS}"){
sh './scripts/compose.py start master --no-kibana --no-xpack-secure'
}
}
}
stage('Prepare Kibana') {
options { skipDefaultCheckout() }
when {
anyOf {
expression { return params.FORCE }
expression { return env.APM_UPDATED != "false" }
}
}
environment {
JENKINS_NODE_COOKIE = 'dontKillMe'
}
steps {
dir("${BASE_DIR}"){
sh script: "${CYPRESS_DIR}/ci/prepare-kibana.sh"
}
}
}
stage('Smoke Tests'){
options { skipDefaultCheckout() }
when {
anyOf {
expression { return params.FORCE }
expression { return env.APM_UPDATED != "false" }
}
}
steps{
dir("${BASE_DIR}"){
sh '''
jobs -l
docker build --tag cypress ${CYPRESS_DIR}/ci
docker run --rm -t --user "$(id -u):$(id -g)" \
-v `pwd`:/app --network="host" \
--name cypress cypress'''
}
}
post {
always {
dir("${BASE_DIR}"){
archiveArtifacts(allowEmptyArchive: false, artifacts: "${CYPRESS_DIR}/screenshots/**,${CYPRESS_DIR}/videos/**,${CYPRESS_DIR}/*e2e-tests.xml")
junit(allowEmptyResults: true, testResults: "${CYPRESS_DIR}/*e2e-tests.xml")
}
dir("${APM_ITS}"){
sh 'docker-compose logs > apm-its.log || true'
sh 'docker-compose down -v || true'
archiveArtifacts(allowEmptyArchive: false, artifacts: 'apm-its.log')
}
}
}
}
}
post {
always {
dir("${BASE_DIR}"){
archiveArtifacts(allowEmptyArchive: true, artifacts: "${CYPRESS_DIR}/ingest-data.log,kibana.log")
}
}
}
}
1 change: 1 addition & 0 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
x-pack/legacy/plugins/*/node_modules \
x-pack/legacy/plugins/reporting/.chromium \
test/plugin_functional/plugins/*/node_modules \
examples/*/node_modules \
.es \
.chromedriver \
.geckodriver;
Expand Down
123 changes: 44 additions & 79 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ module.exports = {
'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: {
Expand Down Expand Up @@ -170,13 +164,6 @@ module.exports = {
'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: {
Expand Down Expand Up @@ -209,53 +196,6 @@ module.exports = {
'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
*/
{
files: [
'.eslintrc.js',
'packages/kbn-utility-types/**/*',
'packages/kbn-eslint-plugin-eslint/**/*',
'packages/kbn-config-schema/**/*',
'packages/kbn-pm/**/*',
'packages/kbn-es/**/*',
'packages/elastic-datemath/**/*',
'packages/kbn-i18n/**/*',
'packages/kbn-dev-utils/**/*',
'packages/kbn-plugin-helpers/**/*',
'packages/kbn-plugin-generator/**/*',
'packages/kbn-test-subj-selector/**/*',
'packages/kbn-test/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
'src/legacy/server/saved_objects/**/*',
'x-pack/legacy/plugins/apm/**/*',
'x-pack/legacy/plugins/canvas/**/*',
'**/*.{ts,tsx}',
'src/legacy/core_plugins/metrics/**/*.js',
],
plugins: ['prettier'],
rules: Object.assign(
{
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
require('eslint-config-prettier').rules,
require('eslint-config-prettier/react').rules
),
},

/**
* Files that require Apache 2.0 headers, settings
Expand Down Expand Up @@ -317,7 +257,8 @@ module.exports = {
'src/legacy/**/*',
'x-pack/**/*',
'!x-pack/**/*.test.*',
'src/plugins/**/(public|server)/**/*',
'!x-pack/test/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'src/core/(public|server)/**/*',
],
from: [
Expand All @@ -337,16 +278,35 @@ module.exports = {
'!src/core/server/types',
'!src/core/server/*.test.mocks.ts',

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

'src/plugins/**/server/**/*',
'!src/plugins/**/server/index.{js,ts,tsx}',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
},
{
target: ['src/core/**/*'],
target: [
'(src|x-pack)/plugins/**/*',
'!(src|x-pack)/plugins/*/server/**/*',

'src/legacy/core_plugins/**/*',
'!src/legacy/core_plugins/*/server/**/*',
'!src/legacy/core_plugins/*/index.{js,ts,tsx}',

'x-pack/legacy/plugins/**/*',
'!x-pack/legacy/plugins/*/server/**/*',
'!x-pack/legacy/plugins/*/index.{js,ts,tsx}',
],
from: [
'src/core/server',
'src/core/server/**/*',
'(src|x-pack)/plugins/*/server/**/*',
],
errorMessage:
'Server modules cannot be imported into client modules or shared modules.',
},
{
target: ['src/**/*'],
from: ['x-pack/**/*'],
errorMessage: 'OSS cannot import x-pack files.',
},
Expand All @@ -360,6 +320,11 @@ module.exports = {
],
errorMessage: 'The core cannot depend on any plugins.',
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['ui/**/*', 'uiExports/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
{
from: ['src/legacy/ui/**/*', 'ui/**/*'],
target: [
Expand Down Expand Up @@ -720,8 +685,6 @@ module.exports = {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
// This will be turned on after bug fixes are mostly completed
// 'arrow-body-style': ['warn', 'as-needed'],
complexity: 'warn',
// This will be turned on after bug fixes are mostly completed
// 'consistent-return': 'warn',
Expand Down Expand Up @@ -751,7 +714,6 @@ module.exports = {
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
Expand Down Expand Up @@ -792,8 +754,6 @@ module.exports = {
'prefer-spread': 'error',
// This style will be turned on after most bugs are fixed
// 'prefer-template': 'warn',
// This style will be turned on after most bugs are fixed
// quotes: ['warn', 'single', { avoidEscape: true }],
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/forbid-dom-props': 'error',
Expand Down Expand Up @@ -829,13 +789,10 @@ module.exports = {
'react/jsx-sort-default-props': 'error',
// might be introduced after the other warns are fixed
// 'react/jsx-sort-props': 'error',
'react/jsx-tag-spacing': 'error',
// might be introduced after the other warns are fixed
'react-hooks/exhaustive-deps': 'off',
'require-atomic-updates': 'error',
'rest-spread-spacing': ['error', 'never'],
'symbol-description': 'error',
'template-curly-spacing': 'error',
'vars-on-top': 'error',
},
},
Expand Down Expand Up @@ -870,8 +827,6 @@ module.exports = {
{
files: ['x-pack/legacy/plugins/monitoring/**/*.js'],
rules: {
'block-spacing': ['error', 'always'],
curly: ['error', 'all'],
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'no-else-return': 'error',
},
Expand All @@ -888,7 +843,6 @@ module.exports = {
files: ['x-pack/legacy/plugins/canvas/**/*.js'],
rules: {
radix: 'error',
curly: ['error', 'all'],

// module importing
'import/order': [
Expand All @@ -906,7 +860,6 @@ module.exports = {
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-wrap-multilines': 'error',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/forbid-elements': [
'error',
Expand Down Expand Up @@ -983,5 +936,17 @@ module.exports = {
'import/no-default-export': 'error',
},
},

/**
* Prettier disables all conflicting rules, listing as last override so it takes precedence
*/
{
files: ['**/*'],
rules: {
...require('eslint-config-prettier').rules,
...require('eslint-config-prettier/react').rules,
...require('eslint-config-prettier/@typescript-eslint').rules,
},
},
],
};
Loading

0 comments on commit 24b7c90

Please sign in to comment.