Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Move mappings from index template to component template #123383

Closed
wants to merge 147 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
ab21926
component template working
hop-dev Jan 19, 2022
0aa2468
move component template construction to function
hop-dev Jan 19, 2022
c04e210
remove unused mapping args
hop-dev Jan 19, 2022
e25ca80
fix template tests
hop-dev Jan 19, 2022
f1a652c
fix types
hop-dev Jan 19, 2022
a65ff6e
component template working
hop-dev Jan 19, 2022
f3eef91
move component template construction to function
hop-dev Jan 19, 2022
ad2d483
remove unused mapping args
hop-dev Jan 19, 2022
0241696
fix template tests
hop-dev Jan 19, 2022
2a76a6c
fix types
hop-dev Jan 19, 2022
bb14cdd
Merge branch 'main' into 121184-mapping-component
kibanamachine Jan 20, 2022
d2f896c
Merge branch 'main' into 121184-mapping-component
kibanamachine Jan 20, 2022
ce1909a
Merge branch '121184-mapping-component' of github.com:hop-dev/kibana …
hop-dev Jan 24, 2022
208206d
Merge remote-tracking branch 'upstream/main' into 121184-mapping-comp…
hop-dev Jan 24, 2022
429b252
[APM] Simplify browser router types (#123549)
dgieselaar Jan 24, 2022
e76cedb
tooltip added to OS column (#123377)
semd Jan 24, 2022
650919c
[APM] Include error documents in fallback query for services (#123554)
dgieselaar Jan 24, 2022
6ee1e37
Timelion rescaling vertical bounds incorrectly on window resize (#123…
DianaDerevyankina Jan 24, 2022
a6a2082
Add comment to mergeWith function
hop-dev Jan 24, 2022
79ff195
[Fleet] Disable custom source_uri option on upgrade APIs by default (…
joshdover Jan 24, 2022
dcae24a
[chore][Home] Rename IndexPattern to DataView (#123593)
afharo Jan 24, 2022
1ecb42b
[ML] Transforms: Fix editing retention policy without default value. …
walterra Jan 24, 2022
775be29
Adds /x-pack/plugins/security_solution/server/lists_integration/endpo…
dasansol92 Jan 24, 2022
2284470
[Form lib] Fix validation type execution when none is specified (#123…
sebelga Jan 24, 2022
4ec7f08
make base id check more stable (#123367)
flash1293 Jan 24, 2022
9504241
skip flaky suite (#116038)
mistic Jan 24, 2022
23739f5
Support for superuser not having write access (#123337)
Jan 24, 2022
058ae1f
[App Search] Fix engines label showing 'All' when no access to engine…
efegurkan Jan 24, 2022
d6af6b9
Show meta engines even when there is no indexed engine (#123640)
efegurkan Jan 24, 2022
2f52d00
[task manager] fix flaky tests after moving to buildkite (#122900)
pmuellr Jan 24, 2022
da3c217
[Cases] Status Metrics UI Changes (#122608)
jonathan-buttner Jan 24, 2022
178d7e5
[Security Solution][Endpoint] Fix `ExceptionLIstItemGenerator` so tha…
paul-tavares Jan 24, 2022
869c88a
[ML] Add error messages to Index data visualizer and improve distribu…
qn895 Jan 24, 2022
e528e41
[Security Solution] Adjust policy test to make it more reliable (#123…
kevinlog Jan 24, 2022
39e6b74
[Lists] Support for Server extension points for `get` (one), `find`, …
paul-tavares Jan 24, 2022
f2e2add
Use unencrypted P12 keystore for ES (#123650)
jportner Jan 24, 2022
d55fd9b
[Metrics UI] Optimizations for Inventory Threshold Alerts (#122460)
simianhacker Jan 24, 2022
4610f44
[DOCS] Adds doc on field statistics in Discover (#121582)
gchaps Jan 24, 2022
f209677
change test to match current message when decryption fails (#122224)
Jan 25, 2022
cef886f
[Security Solution] Open alerts with an associated template in the te…
kqualters-elastic Jan 25, 2022
0305c6e
[ML] Remove export wildcard syntax for ML plugin. (#123177)
walterra Jan 25, 2022
0c6edb4
[code coverage] create pipeline on Buildkite (#120364)
dmlemeshko Jan 25, 2022
7f5e6c3
[APM] Explicit return types for routes (#123266)
dgieselaar Jan 25, 2022
8a8a12a
[Reporting] Fix copy issue in report notifications (#123607)
jloleysens Jan 25, 2022
531f545
fix parseAppUrl logic to handle app ids including other app ids (#123…
pgayvallet Jan 25, 2022
0491214
Handle access tokens that expire after authentication stage. (#122155)
azasypkin Jan 25, 2022
0061af2
[ML] Add empty states for the Jobs list pages (#123462)
darnautov Jan 25, 2022
2e3d596
remove toast alert when cant find edges (#123614)
tomsonpl Jan 25, 2022
c64c766
Log deprecations originating from Kibana on debug level (#123660)
rudolf Jan 25, 2022
e4f97cd
[TSVB] Report override data views to the dashboard (#123530)
flash1293 Jan 25, 2022
2325e45
[i18n] [main] Integrate 8.0.0 Translations (#123708)
Bamieh Jan 25, 2022
f5e66d6
[Index Management] Indices list only load specific index properties f…
yuliacech Jan 25, 2022
791b31d
[Maps] Delete button should be toggleable in Edit Features (#122017)
maksimkovalev Jan 25, 2022
aaf1621
[Maps] change "show as" from EuiSelect to EuiButtonGroup (#121960)
maksimkovalev Jan 25, 2022
10c96e5
[Maps] Should be able to zoom-in on selected range of timeslider (#12…
maksimkovalev Jan 25, 2022
bf2626f
[Fleet] Allow empty strings for required text fields in package polic…
hop-dev Jan 25, 2022
95f2967
[Lens] Improve color stop UI (#119165)
VladLasitsa Jan 25, 2022
24f0425
[Stack monitoring] remove support for monitoring.cluster_alerts.allow…
klacabane Jan 25, 2022
3aa72f8
[Security Solution][Detections] In-memory rules table implementation …
xcrzx Jan 25, 2022
3797b78
[File data visualizer] Removing file upload retries (#123696)
jgowdyelastic Jan 25, 2022
403fdcb
[Uptime] Update functional test directory to use a pinned version of …
dominiqueclarke Jan 25, 2022
2ebc8d2
[Maps][ML] Integration follow up: adds partition field info to map po…
alvarezmelissa87 Jan 25, 2022
08f87f0
[ResponseOps][Cases] Get reporters and tags by aggregation (#123362)
cnasikas Jan 25, 2022
2eccc81
Allows search by description on event filters (#123615)
dasansol92 Jan 25, 2022
f021f75
Validate server UUID retrieved from data/uuid using the same match fr…
matschaffer Jan 25, 2022
5819cfb
Add audit logging to space deletion (#123378)
thomheymann Jan 25, 2022
291fa71
update typo in watcher docs (#123690)
stuartnelson3 Jan 25, 2022
ed2c3b6
Update dependency core-js to ^3.20.3 (main) (#123544)
renovate[bot] Jan 25, 2022
831a40f
[DOCS} Adds 8.0.0-rc2 release notes (#123395)
KOTungseth Jan 25, 2022
cd06e5f
Revert "Add audit logging to space deletion (#123378)"
Jan 25, 2022
c2bd8d1
updating persistable state types (#123340)
ppisljar Jan 25, 2022
607feec
Added type fixes for case cache in case it's null/undefined (#123643)
FrankHassanabad Jan 25, 2022
57d507c
[Security Solution] add ability for network map to be toggable, preve…
jamster10 Jan 25, 2022
c3866c4
[Cases] Enhancement: Add createAppMockRenderer method for easier unit…
academo Jan 25, 2022
09aac9e
[RAC][Uptime] Status check reason messages (#123189)
mgiota Jan 25, 2022
1438e97
Adds builder, preps for vercel (#122871)
goodroot Jan 25, 2022
101acd1
[Reporting] Update immediate CSV export type to support streaming (#1…
dokmic Jan 25, 2022
e9350af
[ML] Transforms: Add call out warning & delete option if a task exist…
qn895 Jan 25, 2022
469e461
[RAC][Rule Registry] Adds test for required and optional alert fields…
claudiopro Jan 25, 2022
1e57604
Azure, GCS, and AWS snapshot repos no longer require plugins (#123387)
jrodewig Jan 25, 2022
7f7dbbb
[SecuritySolution][Timeline] Clean removed runtime fields (#122976)
semd Jan 25, 2022
dfd8bfb
[Security Solution][Endpoint] Search responses without a specific nam…
ashokaditya Jan 25, 2022
54500ff
[ci] Build and publish webpack bundle reports (#123659)
jbudz Jan 25, 2022
70d68d8
[Security Solution][Endpoint] Register NOOP callbacks for all Lists e…
paul-tavares Jan 25, 2022
797f07b
[Fleet] Fix race condition edit package policy (#123762)
nchaulet Jan 26, 2022
49d0f2e
Remove support for console.ssl setting. (#123754)
cjcenizal Jan 26, 2022
5dbe273
Remove default value for deprecation level (#123411)
pgayvallet Jan 26, 2022
9024098
[Security Solution][Endpoint] Don't hide form when loading policies, …
dasansol92 Jan 26, 2022
16642e0
[SecuritySolution][Hosts] All hosts table OS column tooltip message (…
semd Jan 26, 2022
03c8d08
XY Fix percentile with decimals (#123709)
flash1293 Jan 26, 2022
c504475
[RAC][8.1]Add duration format function with tests (#123794)
fkanout Jan 26, 2022
6e4c311
Add correlation section to audit logging docs (#123757)
jportner Jan 26, 2022
e45c352
[APM] Re-enable useLatestPackageVersion option for integration edit c…
ogupte Jan 26, 2022
629c602
[Infra UI] Avoid eager async imports in metric alert registrations (#…
weltenwort Jan 26, 2022
cd9e4cc
Add alpha param to render the new overview page (#123465)
estermv Jan 26, 2022
740ce6c
Update dependency chromedriver to ^97.0.2 (#123788)
renovate[bot] Jan 26, 2022
83fee75
[Alerting] Telemetry for long-running/cancelled rules (#123291)
ymao1 Jan 26, 2022
de0605c
cleanup (#123502)
MadameSheema Jan 26, 2022
6f3a148
updates devdocs builder pull all JSON
goodroot Jan 26, 2022
a80acbb
Resolves errors preventing ES snapshot promotion (#123649)
Jan 26, 2022
ba6f77c
[Security Solutions] Fixes the telemetry to use the new rule types (#…
FrankHassanabad Jan 26, 2022
2517865
[DOCS] Updates Canvas with new toolbar (#123418)
KOTungseth Jan 26, 2022
eef0285
Skip PR builds in Buildkite for 7.11, 7.12
brianseeders Jan 26, 2022
97a234b
skip flaky suite (#115489)
Jan 26, 2022
c70178d
removes builder
goodroot Jan 26, 2022
4d3a792
[ResponseOps] Migrate EUI CodeEditor in the triggers actions ui to us…
JiaweiWu Jan 26, 2022
f197095
[Uptime] Add UI Monitor Management and Synthetics Service e2e tests (…
dominiqueclarke Jan 26, 2022
22ee346
[Lists] Add server extension point for import into Exception Lists (#…
paul-tavares Jan 26, 2022
46eda47
[Security Solution] [Platform] add kibana theme provider and 'theme' …
dhurley14 Jan 26, 2022
1855702
[Security Solution][Endpoint] Update list api summary endpoint to use…
ashokaditya Jan 26, 2022
3e320ca
Note the author in some packages so "owner" attribute is filled in fo…
stacey-gammon Jan 26, 2022
f77355b
[DOCS] Update repository setting links (#123415)
jrodewig Jan 26, 2022
3e7611b
[Cases] Add eslintrule to enforce display names and ignore existing p…
academo Jan 27, 2022
11537ea
Change error to warning toast (#123777)
jamster10 Jan 27, 2022
0d951bc
[Alerting] Smarter retry interval for ES Connectivity errors (#123642)
ymao1 Jan 27, 2022
36722fa
[Detection Engine] Adds 8.0 rules (#123786)
brokensound77 Jan 27, 2022
61ef26d
[TSVB] Hides ticks on the y axis for layers with the same format and …
alexwizp Jan 27, 2022
b5a47fd
make sure session is updated and passed to the embeddable (#123538)
flash1293 Jan 27, 2022
b8b7edf
[ML] Transforms: Support for terms agg in pivot configurations. (#123…
walterra Jan 27, 2022
9575ebb
121273 [RAC][APM] review readability alert reason msg (#123018)
fkanout Jan 27, 2022
71e9c60
Upgrade elastic charts v43.1.1 (#121593)
nickofthyme Jan 27, 2022
95e6dd6
[ML] Add codeowner for docs screenshots (#123901)
pheyos Jan 27, 2022
e0bbd3c
[Lens] Filtered field list using field caps API (#122915)
flash1293 Jan 27, 2022
b1e3bdf
[Discover] Fix document explorer cell popover rendering (#123194)
kertal Jan 27, 2022
f2447cf
[Security Solution] [Detections] Fixes EQL error message when there i…
MadameSheema Jan 27, 2022
7e1b780
[TSVB] Fix shard failures are not reported (#123474)
alexwizp Jan 27, 2022
c5fa8e2
[Upgrade Assistant] Fix deprecated index settings resolution (#123599…
alisonelizabeth Jan 27, 2022
481fb8f
[Upgrade Assistant] Avoid creating the new index if it already exists…
alisonelizabeth Jan 27, 2022
94e64e4
[Upgrade Assistant] Minimize reindex attributes used to create creden…
alisonelizabeth Jan 27, 2022
cc082bc
Adds error message when there are duplicated entries. Also adds unit …
dasansol92 Jan 27, 2022
4f1d97a
[ML] Functional tests - reduce job run time in date nanos and categor…
pheyos Jan 27, 2022
baa6510
[Discover] Redirect if no data views (#123366)
Jan 27, 2022
d965ba7
[Security Solution][Endpoint] Event filters ux adjustments for 8.1 (#…
dasansol92 Jan 27, 2022
eeeef83
[Enterprise Search] Fix bug where no content when user has no Enterpr…
scottybollinger Jan 27, 2022
2d982c0
Update api docs (#123839)
stacey-gammon Jan 27, 2022
2ba9dac
Re-enable skipped long running rule tests (#123234)
mikecote Jan 27, 2022
badfaab
Remove getDuration and use formatDurationFromTimeUnitChar (#123920)
fkanout Jan 27, 2022
be5bc27
Change default threat match query (#123590)
nkhristinin Jan 27, 2022
3d8697d
[Fleet] Use admin user for jest integration tests (#123871)
nchaulet Jan 27, 2022
b403fe0
component template working
hop-dev Jan 19, 2022
7171697
move component template construction to function
hop-dev Jan 19, 2022
47f3f09
remove unused mapping args
hop-dev Jan 19, 2022
2512cca
fix template tests
hop-dev Jan 19, 2022
6fd6825
fix types
hop-dev Jan 19, 2022
ba81e6c
component template working
hop-dev Jan 19, 2022
642ae29
Add comment to mergeWith function
hop-dev Jan 24, 2022
d8d44ef
Merge branch '121184-mapping-component' of github.com:hop-dev/kibana …
hop-dev Jan 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,10 @@ steps:
queue: c2-4
key: storybooks
timeout_in_minutes: 60

- command: .buildkite/scripts/steps/webpack_bundle_analyzer/build_and_upload.sh
label: 'Build Webpack Bundle Analyzer reports'
agents:
queue: n2-2
key: webpack_bundle_analyzer
timeout_in_minutes: 60
2 changes: 1 addition & 1 deletion .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"skip_ci_labels": ["skip-ci", "jenkins-ci"],
"skip_target_branches": ["6.8"]
"skip_target_branches": ["6.8", "7.11", "7.12"]
}
]
}
9 changes: 0 additions & 9 deletions .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,3 @@ fi

export BUILD_TS_REFS_DISABLE=true
export DISABLE_BOOTSTRAP_VALIDATION=true

export TEST_KIBANA_HOST=localhost
export TEST_KIBANA_PORT=6101
export TEST_KIBANA_URL="http://elastic:changeme@localhost:6101"
export TEST_ES_URL="http://elastic:changeme@localhost:6102"
export TEST_ES_TRANSPORT_PORT=6301-6309
export TEST_CORS_SERVER_PORT=6106
export ALERTING_PROXY_PORT=6105
export TEST_PROXY_SERVER_PORT=6107
3 changes: 2 additions & 1 deletion .buildkite/scripts/lifecycle/post_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ IS_TEST_EXECUTION_STEP="$(buildkite-agent meta-data get "${BUILDKITE_JOB_ID}_is_
if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
echo "--- Upload Artifacts"
buildkite-agent artifact upload 'target/junit/**/*'
buildkite-agent artifact upload 'target/kibana-*'
buildkite-agent artifact upload 'target/kibana-coverage/jest/**/*'
buildkite-agent artifact upload 'target/kibana-coverage/functional/**/*'
buildkite-agent artifact upload 'target/kibana-*'
buildkite-agent artifact upload 'target/kibana-security-solution/**/*.png'
buildkite-agent artifact upload 'target/test-metrics/*'
buildkite-agent artifact upload 'target/test-suites-ci-plan.json'
Expand Down
9 changes: 9 additions & 0 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ export SYNTHETICS_SERVICE_PASSWORD
SYNTHETICS_SERVICE_MANIFEST="$(retry 5 5 vault read -field=manifest secret/kibana-issues/dev/kibana-ci-synthetics-credentials)"
export SYNTHETICS_SERVICE_MANIFEST

SYNTHETICS_REMOTE_KIBANA_USERNAME="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"
export SYNTHETICS_REMOTE_KIBANA_USERNAME

SYNTHETICS_REMOTE_KIBANA_PASSWORD="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"
export SYNTHETICS_REMOTE_KIBANA_PASSWORD

SYNTHETICS_REMOTE_KIBANA_URL="$(retry 5 5 vault read -field=url secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"
export SYNTHETICS_REMOTE_KIBANA_URL

# Setup Failed Test Reporter Elasticsearch credentials
{
TEST_FAILURES_ES_CLOUD_ID=$(retry 5 5 vault read -field=cloud_id secret/kibana-issues/dev/failed_tests_reporter_es)
Expand Down
55 changes: 55 additions & 0 deletions .buildkite/scripts/steps/code_coverage/ingest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

export CODE_COVERAGE=1
echo "--- Reading Kibana stats cluster creds from vault"
export USER_FROM_VAULT="$(retry 5 5 vault read -field=username secret/kibana-issues/prod/coverage/elasticsearch)"
export PASS_FROM_VAULT="$(retry 5 5 vault read -field=password secret/kibana-issues/prod/coverage/elasticsearch)"
export HOST_FROM_VAULT="$(retry 5 5 vault read -field=host secret/kibana-issues/prod/coverage/elasticsearch)"
export TIME_STAMP=$(date +"%Y-%m-%dT%H:%M:00Z")

echo "--- Download previous git sha"
.buildkite/scripts/steps/code_coverage/reporting/downloadPrevSha.sh
previousSha=$(cat downloaded_previous.txt)

echo "--- Upload new git sha"
.buildkite/scripts/steps/code_coverage/reporting/uploadPrevSha.sh

.buildkite/scripts/bootstrap.sh

echo "--- Download coverage arctifacts"
buildkite-agent artifact download target/kibana-coverage/jest/* .
buildkite-agent artifact download target/kibana-coverage/functional/* .

echo "--- process HTML Links"
.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh

echo "--- collect VCS Info"
.buildkite/scripts/steps/code_coverage/reporting/collectVcsInfo.sh

# replace path in json files and generate final reports
echo "--- Replace path in json files"
export COVERAGE_TEMP_DIR=$KIBANA_DIR/target/kibana-coverage
sed -i "s|/opt/local-ssd/buildkite/builds/kb-[[:alnum:]\-]\{20,27\}/elastic/kibana-code-coverage-main/kibana|${KIBANA_DIR}|g" $COVERAGE_TEMP_DIR/**/*.json

echo "--- Jest: merging coverage files and generating the final combined report"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js

echo "--- Functional: merging json files and generating the final combined report"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js

# archive reports to upload as build artifacts
echo "--- Archive and upload combined reports"
tar -czf target/kibana-coverage/jest/kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined
tar -czf target/kibana-coverage/functional/kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined
buildkite-agent artifact upload 'target/kibana-coverage/jest/kibana-jest-coverage.tar.gz'
buildkite-agent artifact upload 'target/kibana-coverage/functional/kibana-functional-coverage.tar.gz'

echo "--- Upload coverage static site"
.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh

echo "--- Ingest results to Kibana stats cluster"
.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh 'elastic+kibana+code-coverage' ${BUILDKITE_BUILD_ID} ${BUILDKITE_BUILD_URL} ${previousSha} 'src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt'
20 changes: 20 additions & 0 deletions .buildkite/scripts/steps/code_coverage/jest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

is_test_execution_step

.buildkite/scripts/bootstrap.sh

echo '--- Jest code coverage'

.buildkite/scripts/steps/code_coverage/jest_parallel.sh

tar -czf kibana-jest-thread-coverage.tar.gz target/kibana-coverage/jest

echo "--- Merging code coverage for a thread"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js --reporter json
rm -rf target/kibana-coverage/jest/*
mv target/kibana-coverage/jest-combined/coverage-final.json "target/kibana-coverage/jest/jest-merged-coverage-$(date +%s%3N).json"
13 changes: 13 additions & 0 deletions .buildkite/scripts/steps/code_coverage/jest_integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

is_test_execution_step

.buildkite/scripts/bootstrap.sh

echo '--- Jest Integration code coverage'
node --max-old-space-size=14336 scripts/jest_integration --ci --coverage --coverageReporters json || true
mv target/kibana-coverage/jest/coverage-final.json "target/kibana-coverage/jest/jest-integration-coverage.json"
32 changes: 32 additions & 0 deletions .buildkite/scripts/steps/code_coverage/jest_parallel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -uo pipefail

JOB=$BUILDKITE_PARALLEL_JOB
JOB_COUNT=$BUILDKITE_PARALLEL_JOB_COUNT

# a jest failure will result in the script returning an exit code of 10

i=0
exitCode=0

while read -r config; do
if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then
echo "--- $ node scripts/jest --config $config --coverage --coverageReporters json --coverageDirectory target/kibana-coverage/jest"
node --max-old-space-size=14336 ./node_modules/.bin/jest --runInBand --config="$config" --coverage --coverageReporters json --coverageDirectory target/kibana-coverage/jest || true
echo "Rename coverage-final.json to avoid overwrite"
mv target/kibana-coverage/jest/coverage-final.json "./target/kibana-coverage/jest/coverage-$(date +%s%3N).json"
lastCode=$?

if [ $lastCode -ne 0 ]; then
exitCode=10
echo "Jest exited with code $lastCode"
echo "^^^ +++"
fi
fi

((i=i+1))
# uses heredoc to avoid the while loop being in a sub-shell thus unable to overwrite exitCode
done <<< "$(find src x-pack packages -name jest.config.js -not -path "*/__fixtures__/*" | sort)"

exit $exitCode
34 changes: 34 additions & 0 deletions .buildkite/scripts/steps/code_coverage/oss_cigroup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@


#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/build_kibana_plugins.sh

is_test_execution_step

export CI_GROUP=${CI_GROUP:-$((BUILDKITE_PARALLEL_JOB+1))}
export JOB=kibana-oss-ciGroup${CI_GROUP}

export NODE_OPTIONS=--max_old_space_size=8192
export CODE_COVERAGE=1

echo "--- OSS CI Group $CI_GROUP"
echo " -> Running Functional tests with code coverage"

node scripts/functional_tests \
--include-tag "ciGroup$CI_GROUP" \
--exclude-tag "skipCoverage" || true

if [[ -d "$KIBANA_DIR/target/kibana-coverage/functional" ]]; then
echo "--- Merging code coverage for CI Group $CI_GROUP"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js --reporter json
rm -rf target/kibana-coverage/functional/*
mv target/kibana-coverage/functional-combined/coverage-final.json "target/kibana-coverage/functional/oss-${CI_GROUP}-coverage.json"
else
echo "--- Code coverage not found"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -euo pipefail

echo "### Prok'd Index File: ..."
cat src/dev/code_coverage/www/index.html

predicate() {
x=$1
if [ -n "$x" ]; then
return
else
echo "### 1 or more variables that Code Coverage needs, are undefined"
exit 1
fi
}
CMD="git log --pretty=format"
XS=("${GIT_BRANCH}" \
"$(${CMD}":%h" -1)" \
"$(${CMD}":%an" -1)" \
"$(${CMD}":%s" -1)")
touch VCS_INFO.txt
for X in "${!XS[@]}"; do
{
predicate "${XS[X]}"
echo "${XS[X]}" >> VCS_INFO.txt
}
done
echo "### VCS_INFO:"
cat VCS_INFO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

gsutil -m cp -r gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/previous.txt . || echo "### Previous Pointer NOT FOUND?"

if [ -e ./previous.txt ]; then
mv previous.txt downloaded_previous.txt
echo "### downloaded_previous.txt"
cat downloaded_previous.txt
fi
48 changes: 48 additions & 0 deletions .buildkite/scripts/steps/code_coverage/reporting/ingestData.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

set -euo pipefail

echo "### Ingesting Code Coverage"
echo ""

COVERAGE_JOB_NAME=$1
export COVERAGE_JOB_NAME
echo "### debug COVERAGE_JOB_NAME: ${COVERAGE_JOB_NAME}"

BUILD_ID=$2
export BUILD_ID

CI_RUN_URL=$3
export CI_RUN_URL
echo "### debug CI_RUN_URL: ${CI_RUN_URL}"

FETCHED_PREVIOUS=$4
export FETCHED_PREVIOUS
echo "### debug FETCHED_PREVIOUS: ${FETCHED_PREVIOUS}"

ES_HOST="https://${USER_FROM_VAULT}:${PASS_FROM_VAULT}@${HOST_FROM_VAULT}"
export ES_HOST

STATIC_SITE_URL_BASE='https://kibana-coverage.elastic.dev'
export STATIC_SITE_URL_BASE

TEAM_ASSIGN_PATH=$5
echo "### debug TEAM_ASSIGN_PATH: ${TEAM_ASSIGN_PATH}"

BUFFER_SIZE=500
export BUFFER_SIZE
echo "### debug BUFFER_SIZE: ${BUFFER_SIZE}"

# Build team assignments file
CI_STATS_DISABLED=true node scripts/generate_team_assignments.js --verbose --src '.github/CODEOWNERS' --dest $TEAM_ASSIGN_PATH

for x in functional jest; do
echo "### Ingesting coverage for ${x}"
COVERAGE_SUMMARY_FILE=target/kibana-coverage/${x}-combined/coverage-summary.json
# running in background to speed up ingestion
CI_STATS_DISABLED=true node scripts/ingest_coverage.js --path ${COVERAGE_SUMMARY_FILE} --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH &
done
wait

echo "### Ingesting Code Coverage - Complete"
echo ""
29 changes: 29 additions & 0 deletions .buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -euo pipefail

cat << EOF > src/dev/code_coverage/www/index_partial_2.html
<a class="nav-link" href="https://kibana-coverage.elastic.dev/${TIME_STAMP}/jest-combined/index.html">Latest Jest</a>
<a class="nav-link" href="https://kibana-coverage.elastic.dev/${TIME_STAMP}/functional-combined/index.html">Latest FTR</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<!-- <h1 class="cover-heading"> - Master Branch</h1>-->
<p class="lead">Use Kibana Stats to mine coverage data</p>
<p class="lead">
<a href="https://kibana-stats.elastic.dev/app/kibana#/dashboard/58b8db70-62f9-11ea-8312-7f2d69b79843?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-7d%2Cto%3Anow))" class="btn btn-lg btn-primary">Dashboard</a>
</p>
</main>
<footer class="mastfoot mt-auto">
<div class="inner">
<p>Please slack us at <a href="https://app.slack.com/client/T0CUZ52US/C0TR0FAET">#kibana-qa</a> if youve questions</p>
</div>
</footer>
</div>
</body>
</html>
EOF

cat src/dev/code_coverage/www/index_partial.html > src/dev/code_coverage/www/index.html
cat src/dev/code_coverage/www/index_partial_2.html >> src/dev/code_coverage/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -euo pipefail

collectPrevious() {
PREVIOUS=$(git log --pretty=format:%h -1)
echo "### PREVIOUS: ${PREVIOUS}"
echo $PREVIOUS > previous.txt
}
collectPrevious

gsutil cp previous.txt gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -euo pipefail

uploadPrefix="gs://elastic-bekitzur-kibana-coverage-live/"
uploadPrefixWithTimeStamp="${uploadPrefix}${TIME_STAMP}/"

cat src/dev/code_coverage/www/index.html

for x in 'src/dev/code_coverage/www/index.html' 'src/dev/code_coverage/www/404.html'; do
gsutil -m cp -r -a public-read -z js,css,html ${x} ${uploadPrefix}
done

gsutil -m cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}

for x in 'target/kibana-coverage/functional-combined' 'target/kibana-coverage/jest-combined'; do
gsutil -m cp -r -a public-read -z js,css,html ${x} ${uploadPrefixWithTimeStamp}
done
Loading