Skip to content

Commit

Permalink
Merge branch 'main' into a11y_watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmivkulkarni authored Jun 23, 2022
2 parents 1750d89 + 48db1ec commit 6803377
Show file tree
Hide file tree
Showing 947 changed files with 28,522 additions and 13,264 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ enabled:
- test/functional/apps/discover/config.ts
- test/functional/apps/getting_started/config.ts
- test/functional/apps/home/config.ts
- test/functional/apps/kibana_overview/config.ts
- test/functional/apps/management/config.ts
- test/functional/apps/saved_objects_management/config.ts
- test/functional/apps/status_page/config.ts
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/code_coverage/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
queue: kibana-default
env:
FTR_CONFIGS_DEPS: ''
# LIMIT_CONFIG_TYPE: 'unit,functional,integration'
# LIMIT_CONFIG_TYPE: 'unit,functional,integration'
LIMIT_CONFIG_TYPE: 'unit,integration'
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest.sh'
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest_integration.sh'
Expand All @@ -26,6 +26,6 @@ steps:
depends_on:
- jest
- jest-integration
# - ftr-configs
# - ftr-configs
timeout_in_minutes: 30
key: ingest
6 changes: 6 additions & 0 deletions .buildkite/pipelines/performance/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ steps:
# queue: n2-2
# depends_on: tests

- label: ':chart_with_upwards_trend: Report performance metrics to ci-stats'
command: .buildkite/scripts/steps/functional/report_performance_metrics.sh
agents:
queue: n2-2
depends_on: tests

- wait: ~
continue_on_failure: true

Expand Down
50 changes: 40 additions & 10 deletions .buildkite/scripts/steps/code_coverage/ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ export HOST_FROM_VAULT
TIME_STAMP=$(date +"%Y-%m-%dT%H:%M:00Z")
export TIME_STAMP

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

echo "--- Upload new git sha"
.buildkite/scripts/steps/code_coverage/reporting/uploadPrevSha.sh
revolveBuildHashes() {
echo "--- Download previous git sha"
.buildkite/scripts/steps/code_coverage/reporting/downloadPrevSha.sh
PREVIOUS_SHA=$(cat downloaded_previous.txt)

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

collectRan() {
buildkite-agent artifact download target/ran_files/* .
Expand Down Expand Up @@ -59,9 +61,9 @@ archiveReports() {
local xs=("$@")
for x in "${xs[@]}"; do
echo "### Collect and Upload for: ${x}"
# fileHeads "target/file-heads-archive-reports-for-${x}.txt" "target/kibana-coverage/${x}"
# dirListing "target/dir-listing-${x}-combined-during-archiveReports.txt" target/kibana-coverage/${x}-combined
# dirListing "target/dir-listing-${x}-during-archiveReports.txt" target/kibana-coverage/${x}
# fileHeads "target/file-heads-archive-reports-for-${x}.txt" "target/kibana-coverage/${x}"
# dirListing "target/dir-listing-${x}-combined-during-archiveReports.txt" target/kibana-coverage/${x}-combined
# dirListing "target/dir-listing-${x}-during-archiveReports.txt" target/kibana-coverage/${x}
collectAndUpload "target/kibana-coverage/${x}/kibana-${x}-coverage.tar.gz" "target/kibana-coverage/${x}-combined"
done
}
Expand All @@ -86,25 +88,53 @@ mergeAll() {
done
}

annotateForStaticSite() {
local xs=("$@")
local markdownLinks=()

OLDIFS="${IFS}"
IFS=$'\n'

for x in "${xs[@]}"; do
markdownLinks+=(" - [$x](https://kibana-coverage.elastic.dev/${TIME_STAMP}/${x}-combined/index.html)")
done

content=$(
cat <<-EOF
### Browse the Code Coverage Static Site
_Links are pinned to the current build number._
${markdownLinks[*]}
EOF
)

IFS="${OLDIFS}"

buildkite-agent annotate --style "info" --context 'ctx-coverage-static-site' "${content}"
}

modularize() {
collectRan
if [ -d target/ran_files ]; then
revolveBuildHashes
uniqueifyRanConfigs "${ran[@]}"
fetchArtifacts "${uniqRanConfigs[@]}"
mergeAll "${uniqRanConfigs[@]}"
archiveReports "${uniqRanConfigs[@]}"
.buildkite/scripts/steps/code_coverage/reporting/prokLinks.sh "${uniqRanConfigs[@]}"
.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh "${uniqRanConfigs[@]}"
annotateForStaticSite "${uniqRanConfigs[@]}"
.buildkite/scripts/steps/code_coverage/reporting/collectVcsInfo.sh
source .buildkite/scripts/steps/code_coverage/reporting/ingestData.sh 'elastic+kibana+code-coverage' \
"${BUILDKITE_BUILD_NUMBER}" "${BUILDKITE_BUILD_URL}" "${PREVIOUS_SHA}" \
'src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt'
ingestModular "${uniqRanConfigs[@]}"
annotateForKibanaLinks
else
echo "--- Found zero configs that ran, cancelling ingestion."
exit 11
fi
}

modularize
echo "### unique ran configs: ${uniqRanConfigs[*]}"
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/code_coverage/reporting/ingestData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ echo "### debug TEAM_ASSIGN_PATH: ${TEAM_ASSIGN_PATH}"
BUFFER_SIZE=500
export BUFFER_SIZE

annotateForKibanaLinks() {
local currentBuildNumber="$BUILDKITE_BUILD_NUMBER"
local coverageUrl="https://kibana-stats.elastic.dev/app/discover#/?_g=(filters:!(),query:(language:kuery,query:''),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))&_a=(columns:!(),filters:!(),hideChart:!f,index:'64419790-4218-11ea-b2d8-81bcbf78dfcb',interval:auto,query:(language:kuery,query:'BUILD_ID%20:%20${currentBuildNumber}'),sort:!(!('@timestamp',desc)))"
local totalCoverageUrl="https://kibana-stats.elastic.dev/app/discover#/?_g=(filters:!(),query:(language:kuery,query:''),refreshInterval:(pause:!t,value:0),time:(from:now-7d,to:now))&_a=(columns:!(),filters:!(),hideChart:!f,index:d78f9120-4218-11ea-b2d8-81bcbf78dfcb,interval:auto,query:(language:kuery,query:'BUILD_ID%20:%20${currentBuildNumber}'),sort:!(!('@timestamp',desc)))"

cat <<EOF | buildkite-agent annotate --style "info" --context 'ctx-kibana-links'
### Browse the following url(s) to visually verify in Kibana
_Links are pinned to the current build number._
- [Code Coverage]($coverageUrl)
- [Total Code Coverage]($totalCoverageUrl)
EOF

}

ingestModular() {
local xs=("$@")

Expand Down
31 changes: 23 additions & 8 deletions .buildkite/scripts/steps/functional/performance_playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ node scripts/es snapshot&

esPid=$!

# unset env vars defined in other parts of CI for automatic APM collection of
# Kibana. We manage APM config in our FTR config and performance service, and
# APM treats config in the ENV with a very high precedence.
unset ELASTIC_APM_ENVIRONMENT
unset ELASTIC_APM_TRANSACTION_SAMPLE_RATE
unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_ACTIVE
unset ELASTIC_APM_CONTEXT_PROPAGATION_ONLY
unset ELASTIC_APM_ACTIVE
unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_GLOBAL_LABELS


export TEST_ES_URL=http://elastic:changeme@localhost:9200
export TEST_ES_DISABLE_STARTUP=true

Expand All @@ -30,19 +45,19 @@ for i in "${journeys[@]}"; do

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \
node scripts/functional_tests \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail

export TEST_PERFORMANCE_PHASE=TEST

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \
node scripts/functional_tests \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
done

kill "$esPid"
21 changes: 21 additions & 0 deletions .buildkite/scripts/steps/functional/report_performance_metrics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

# TODO: Add new user and change lines accordingly
USER_FROM_VAULT="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/ci_stats_performance_metrics)"
PASS_FROM_VAULT="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/ci_stats_performance_metrics)"
APM_SERVER_URL="https://kibana-ops-e2e-perf.kb.us-central1.gcp.cloud.es.io:9243/internal/apm"
BUILD_ID=${BUILDKITE_BUILD_ID}

.buildkite/scripts/bootstrap.sh

echo "--- Extract APM metrics & report them to ci-stats"

node scripts/report_performance_metrics \
--buildId "${BUILD_ID}" \
--apm-url "${APM_SERVER_URL}" \
--apm-username "${USER_FROM_VAULT}" \
--apm-password "${PASS_FROM_VAULT}"
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
/x-pack/test/functional/apps/transform/ @elastic/ml-ui
/x-pack/test/functional/services/transform/ @elastic/ml-ui
/x-pack/test/functional_basic/apps/transform/ @elastic/ml-ui
/x-pack/packages/ml/ @elastic/ml-ui
/packages/kbn-aiops-utils @elastic/ml-ui
/examples/response_stream/ @elastic/ml-ui

Expand Down
6 changes: 5 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"bfetch": "src/plugins/bfetch",
"charts": "src/plugins/charts",
"console": "src/plugins/console",
"core": ["src/core", "packages/core/i18n/core-i18n-browser-internal"],
"core": [
"src/core",
"packages/core/i18n/core-i18n-browser-internal",
"packages/core/fatal-errors/core-fatal-errors-browser-internal"
],
"customIntegrations": "src/plugins/custom_integrations",
"dashboard": "src/plugins/dashboard",
"controls": "src/plugins/controls",
Expand Down
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**Q:** Where do I go for support?
**A:** Please join us at [discuss.elastic.co](https://discuss.elastic.co) with questions. Your problem might be a bug, but it might just be a misunderstanding, or a feature we could improve. We're also available on Freenode in #kibana

**Q:** Ok, we talked about it and its definitely a bug
**Q:** Ok, we talked about it, and it's definitely a bug
**A:** Doh, ok, let's get that fixed. File an issue on [github.com/elastic/kibana](https://github.com/elastic/kibana). I'd recommend reading the beginning of the CONTRIBUTING.md, just so you know how we'll handle the issue.

### Kibana 3 Migration
Expand Down
Loading

0 comments on commit 6803377

Please sign in to comment.