Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into ebt/create-elas…
Browse files Browse the repository at this point in the history
…tic-analytics-package
  • Loading branch information
afharo committed Apr 5, 2022
2 parents e87b474 + 735b4c9 commit 2da3b7c
Show file tree
Hide file tree
Showing 1,836 changed files with 40,062 additions and 21,498 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"repoName": "kibana",
"targetBranchChoices": [
"main",
"8.2",
"8.1",
"8.0",
"7.17",
Expand Down Expand Up @@ -38,7 +39,7 @@
"backport"
],
"branchLabelMapping": {
"^v8.2.0$": "main",
"^v8.3.0$": "main",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
},
"autoMerge": true,
Expand Down
26 changes: 26 additions & 0 deletions .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,29 @@ steps:
agents:
queue: c2-16
timeout_in_minutes: 60

- wait

- command: TEST_PACKAGE=deb .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for deb
agents:
queue: n2-4-virt
timeout_in_minutes: 20

- command: TEST_PACKAGE=rpm .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for rpm
agents:
queue: n2-4-virt
timeout_in_minutes: 20

- command: TEST_PACKAGE=docker .buildkite/scripts/steps/package_testing/test.sh
label: Package testing for docker
agents:
queue: n2-4-virt
timeout_in_minutes: 20

- command: .buildkite/scripts/steps/artifacts/docker_context.sh
label: 'Docker Build Context'
agents:
queue: n2-2
timeout_in_minutes: 20
16 changes: 8 additions & 8 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ steps:
- command: .buildkite/scripts/steps/functional/oss_accessibility.sh
label: 'OSS Accessibility Tests'
agents:
queue: ci-group-4d
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -67,7 +67,7 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_accessibility.sh
label: 'Default Accessibility Tests'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -78,7 +78,7 @@ steps:
- command: .buildkite/scripts/steps/functional/oss_firefox.sh
label: 'OSS Firefox Tests'
agents:
queue: ci-group-4d
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -89,7 +89,7 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_firefox.sh
label: 'Default Firefox Tests'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -100,7 +100,7 @@ steps:
- command: .buildkite/scripts/steps/functional/oss_misc.sh
label: 'OSS Misc Functional Tests'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -111,7 +111,7 @@ steps:
- command: .buildkite/scripts/steps/functional/xpack_saved_object_field_metrics.sh
label: 'Saved Object Field Metrics'
agents:
queue: n2-4
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
Expand All @@ -138,7 +138,7 @@ steps:
- command: .buildkite/scripts/steps/test/api_integration.sh
label: 'API Integration Tests'
agents:
queue: n2-2
queue: n2-2-spot
timeout_in_minutes: 120
key: api-integration

Expand Down Expand Up @@ -173,7 +173,7 @@ steps:
- command: .buildkite/scripts/steps/build_api_docs.sh
label: 'Build API Docs'
agents:
queue: n2-4
queue: n2-4-spot
key: build_api_docs
timeout_in_minutes: 60

Expand Down
5 changes: 5 additions & 0 deletions .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ check_for_changed_files() {

git commit -m "$NEW_COMMIT_MESSAGE"
git push

# After the git push, the new commit will trigger a new build within a few seconds and this build should get cancelled
# So, let's just sleep to give the build time to cancel itself without an error
# If it doesn't get cancelled for some reason, then exit with an error, because we don't want this build to be green (we just don't want it to generate an error either)
sleep 300
exit 1
else
echo -e "\n${RED}ERROR: '$1' caused changes to the following files:${C_RESET}\n"
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/annotate_test_failures.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { TestFailures } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/build_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { BuildkiteClient } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/ci_stats_complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { CiStats } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/ci_stats_ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { CiStats } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/ci_stats_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { CiStats } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/lifecycle/print_agent_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

// eslint-disable-next-line import/no-unresolved
const { BuildkiteClient } = require('kibana-buildkite-library');

(async () => {
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

const execSync = require('child_process').execSync;
const fs = require('fs');
// eslint-disable-next-line import/no-unresolved
const { areChangesSkippable, doAnyChangesMatch } = require('kibana-buildkite-library');

const SKIPPABLE_PATHS = [
Expand Down
28 changes: 28 additions & 0 deletions .buildkite/scripts/steps/artifacts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,31 @@ node scripts/build "$RELEASE_ARG" --all-platforms --debug --docker-cross-compile

echo "--- Build dependencies report"
node scripts/licenses_csv_report "--csv=target/dependencies-$VERSION.csv"

# Release verification
if [[ "${RELEASE_BUILD:-}" == "true" ]]; then
echo "--- Build and push Kibana Cloud Distribution"
# This doesn't meet the requirements for a release image, implementation TBD
# Beats artifacts will need to match a specific commit sha that matches other stack iamges
# For now this is a placeholder step that will allow us to run automated Cloud tests
# against a best guess approximation of a release image
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT

node scripts/build \
"$RELEASE_ARG" \
--skip-initialize \
--skip-generic-folders \
--skip-platform-folders \
--skip-archives \
--docker-images \
--docker-tag-qualifier="$GIT_COMMIT" \
--docker-push \
--skip-docker-ubi \
--skip-docker-ubuntu \
--skip-docker-contexts
fi

cd target
buildkite-agent artifact upload "*"
cd -
28 changes: 28 additions & 0 deletions .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -euo pipefail

.buildkite/scripts/bootstrap.sh

if [[ "${RELEASE_BUILD:-}" == "true" ]]; then
VERSION="$(jq -r '.version' package.json)"
RELEASE_ARG="--release"
else
VERSION="$(jq -r '.version' package.json)-SNAPSHOT"
RELEASE_ARG=""
fi

echo "--- Create contexts"
mkdir -p target
node scripts/build "$RELEASE_ARG" --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact

echo "--- Setup default context"
DOCKER_BUILD_FOLDER=$(mktemp -d)

tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER"
cd $DOCKER_BUILD_FOLDER

buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"

echo "--- Build context"
docker build .
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/synthetics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ echo "--- Uptime @elastic/synthetics Tests"
cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement*"
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*"
20 changes: 19 additions & 1 deletion .buildkite/scripts/steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@ source .buildkite/scripts/common/util.sh
echo '--- Lint: stylelint'
checks-reporter-with-killswitch "Lint: stylelint" \
node scripts/stylelint
echo "stylelint ✅"

# disable "Exit immediately" mode so that we can run eslint, capture it's exit code, and respond appropriately
# after possibly commiting fixed files to the repo
set +e;

echo '--- Lint: eslint'
checks-reporter-with-killswitch "Lint: eslint" \
node scripts/eslint --no-cache
node scripts/eslint --no-cache --fix

eslint_exit=$?

# re-enable "Exit immediately" mode
set -e;

check_for_changed_files 'node scripts/eslint --no-cache --fix' true

if [[ "${eslint_exit}" != "0" ]]; then
exit 1
fi

echo "eslint ✅"
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exitCode=0
while read -r config; do
if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then
echo "--- $ node scripts/jest --config $config"
node --max-old-space-size=14336 ./node_modules/.bin/jest --config="$config" --runInBand --coverage=false --passWithNoTests
node --max-old-space-size=14336 ./scripts/jest --config="$config" --runInBand --coverage=false --passWithNoTests
lastCode=$?

if [ $lastCode -ne 0 ]; then
Expand Down
40 changes: 1 addition & 39 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,7 @@ module.exports = {
* Licence headers
*/
{
files: [
'**/*.{js,mjs,ts,tsx}',
'!plugins/**/*',
'!packages/elastic-datemath/**/*',
'!packages/elastic-eslint-config-kibana/**/*',
],
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand Down Expand Up @@ -584,30 +579,6 @@ module.exports = {
},
},

/**
* Files that are allowed to import webpack-specific stuff
*/
{
files: [
'**/public/**/*.js',
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
],
settings: {
// instructs import/no-extraneous-dependencies to treat certain modules
// as core modules, even if they aren't listed in package.json
'import/core-modules': ['plugins'],

'import/resolver': {
'@kbn/eslint-import-resolver-kibana': {
forceNode: false,
rootPackageName: 'kibana',
kibanaPath: '.',
pluginMap: {},
},
},
},
},

/**
* Single package.json rules, it tells eslint to ignore the child package.json files
* and look for dependencies declarations in the single and root level package.json
Expand Down Expand Up @@ -695,7 +666,6 @@ module.exports = {
{
files: [
'.eslintrc.js',
'packages/kbn-eslint-import-resolver-kibana/**/*.js',
'packages/kbn-eslint-plugin-eslint/**/*',
'x-pack/gulpfile.js',
'x-pack/scripts/*.js',
Expand Down Expand Up @@ -1572,14 +1542,6 @@ module.exports = {
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
globals: { canvas: true, $: true },
rules: {
'import/no-unresolved': [
'error',
{
ignore: ['!!raw-loader.+.svg$'],
},
],
},
},
{
files: ['x-pack/plugins/canvas/public/**/*.js'],
Expand Down
5 changes: 4 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
/src/plugins/bfetch/ @elastic/kibana-app-services
/src/plugins/data_view_management/ @elastic/kibana-app-services
/src/plugins/inspector/ @elastic/kibana-app-services
/src/plugins/unified_search/ @elastic/kibana-app-services
/x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services
Expand Down Expand Up @@ -221,6 +222,7 @@
/packages/*babel*/ @elastic/kibana-operations
/packages/kbn-dev-utils*/ @elastic/kibana-operations
/packages/kbn-es/ @elastic/kibana-operations
/packages/kbn-eslint-plugin-imports/ @elastic/kibana-operations
/packages/kbn-optimizer/ @elastic/kibana-operations
/packages/kbn-pm/ @elastic/kibana-operations
/packages/kbn-test/ @elastic/kibana-operations
Expand Down Expand Up @@ -483,5 +485,6 @@ x-pack/plugins/session_view @elastic/awp-platform

## Shared UX
/src/plugins/shared_ux/ @elastic/shared-ux
/packages/shared-ux-*/ @elastic/shared-ux
/src/plugins/kibana_react/ @elastic/shared-ux
/src/plugins/kibana_react/public/code_editor @elastic/kibana-presentation
/src/plugins/kibana_react/public/code_editor @elastic/shared-ux @elastic/kibana-presentation
3 changes: 2 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"visTypeVega": "src/plugins/vis_types/vega",
"visTypeVislib": "src/plugins/vis_types/vislib",
"visTypeXy": "src/plugins/vis_types/xy",
"visualizations": "src/plugins/visualizations"
"visualizations": "src/plugins/visualizations",
"unifiedSearch": "src/plugins/unified_search"
},
"translations": []
}
Loading

0 comments on commit 2da3b7c

Please sign in to comment.