-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 181542-dataset-quality-dataset-is-not-marked…
…-as-part-of-the-integration
- Loading branch information
Showing
1,579 changed files
with
12,286 additions
and
10,919 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
.buildkite/pipeline-resource-definitions/kibana-fips-daily.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Resource | ||
metadata: | ||
name: bk-kibana-fips-daily | ||
description: Run Kibana FIPS smoke tests | ||
links: | ||
- title: Pipeline link | ||
url: https://buildkite.com/elastic/kibana-fips | ||
spec: | ||
type: buildkite-pipeline | ||
owner: group:kibana-operations | ||
system: buildkite | ||
implementation: | ||
apiVersion: buildkite.elastic.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: kibana / fips | ||
description: Run Kibana FIPS smoke tests | ||
spec: | ||
env: | ||
SLACK_NOTIFICATIONS_CHANNEL: "#kibana-operations-alerts" | ||
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "true" | ||
repository: elastic/kibana | ||
branch_configuration: main | ||
default_branch: main | ||
pipeline_file: ".buildkite/pipelines/fips.yml" | ||
provider_settings: | ||
trigger_mode: none | ||
schedules: | ||
daily: | ||
branch: main | ||
cronline: 0 9 * * * America/New_York | ||
teams: | ||
kibana-operations: | ||
access_level: MANAGE_BUILD_AND_READ | ||
everyone: | ||
access_level: READ_ONLY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
env: | ||
DISABLE_CI_STATS_SHIPPING: "true" | ||
steps: | ||
- command: .buildkite/scripts/steps/build_kibana.sh | ||
label: Build Kibana Distribution and Plugins | ||
agents: | ||
image: family/kibana-ubuntu-2004 | ||
imageProject: elastic-images-qa | ||
provider: gcp | ||
machineType: n2-standard-16 | ||
preemptible: true | ||
key: build | ||
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''" | ||
timeout_in_minutes: 60 | ||
retry: | ||
automatic: | ||
- exit_status: "-1" | ||
limit: 3 | ||
|
||
- wait | ||
|
||
- command: TEST_PACKAGE=fips .buildkite/scripts/steps/package_testing/test.sh | ||
label: "Smoke testing for FIPS" | ||
agents: | ||
image: family/kibana-ubuntu-2004 | ||
imageProject: elastic-images-qa | ||
provider: gcp | ||
enableNestedVirtualization: true | ||
localSsds: 1 | ||
localSsdInterface: nvme | ||
machineType: n2-standard-4 | ||
timeout_in_minutes: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...es/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "No target script from the package.json file, is supplied" | ||
exit 1 | ||
fi | ||
|
||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
.buildkite/scripts/bootstrap.sh | ||
|
||
export JOB=kibana-defend-workflows-serverless-cypress | ||
|
||
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" | ||
|
||
source .buildkite/scripts/pipelines/security_solution_quality_gate/prepare_vault_entries.sh | ||
|
||
cd x-pack/plugins/security_solution | ||
set +e | ||
|
||
export BK_ANALYTICS_API_KEY=$(vault_get security-solution-quality-gate serverless-cypress-defend-workflows) | ||
|
||
echo "--- Running the tests for target $1" | ||
BK_ANALYTICS_API_KEY=$BK_ANALYTICS_API_KEY yarn $1; status=$?; yarn junit:merge || :; exit $status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
echo "--- Publish API Docs" | ||
|
||
buildkite-agent artifact download "api_docs_changes.diff" . | ||
|
||
if [[ -s "api_docs_changes.diff" ]]; then | ||
echo "Changes detected in API Docs" | ||
git apply api_docs_changes.diff | ||
rm api_docs_changes.diff | ||
else | ||
echo "No changes detected in API Docs" | ||
exit 0 | ||
fi | ||
|
||
git config --global user.name kibanamachine | ||
git config --global user.email '[email protected]' | ||
|
||
branch="api_docs_$(date +%F_%H-%M-%S)" | ||
git checkout -b "$branch" | ||
git add ./*.docnav.json | ||
git add api_docs | ||
git commit -m "[api-docs] Daily api_docs build" | ||
|
||
git push origin "$branch" | ||
|
||
prUrl=$(gh pr create --repo elastic/kibana --base main --head "$branch" --title "[api-docs] $(date +%F) Daily api_docs build" --body "Generated by $BUILDKITE_BUILD_URL" --label "release_note:skip" --label "docs") | ||
echo "Opened PR: $prUrl" | ||
gh pr merge --repo elastic/kibana --auto --squash "$prUrl" | ||
|
||
GH_TOKEN="$KIBANA_CI_GITHUB_TOKEN" gh pr review --repo elastic/kibana --approve -b "Automated review from $BUILDKITE_BUILD_URL" "$prUrl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import * as glob from 'glob'; | ||
import axios from 'axios'; | ||
|
||
const CDN_URL_PREFIX = process.argv[2]; | ||
const CDN_ASSETS_FOLDER = process.argv[3]; | ||
|
||
async function main() { | ||
const allAssets = glob.sync('**/*', { cwd: CDN_ASSETS_FOLDER, nodir: true }); | ||
const totalAssetCount = allAssets.length; | ||
let assetsProcessed = 0; | ||
let assetsFound = 0; | ||
|
||
const batchSize = 50; | ||
|
||
console.log(`Starting CDN asset validation for ${totalAssetCount} assets...`); | ||
|
||
while (assetsProcessed < totalAssetCount) { | ||
const batch = allAssets.slice(assetsProcessed, assetsProcessed + batchSize); | ||
const results = await Promise.all(batch.map((url) => headAssetUrlWithRetry(url))); | ||
assetsProcessed += results.length; | ||
results.forEach((result) => { | ||
if (result.status === 200) { | ||
console.log(`Testing ${result.assetPath}...${result.status}`); | ||
assetsFound++; | ||
} else { | ||
console.error(`Testing ${result.assetPath}...${result.status} (${result.testUrl})`); | ||
} | ||
}); | ||
} | ||
|
||
return { | ||
totalAssetCount, | ||
assetsProcessed, | ||
assetsFound, | ||
assetsNotFound: totalAssetCount - assetsFound, | ||
}; | ||
} | ||
|
||
async function headAssetUrl(assetPath: string) { | ||
const testUrl = `${CDN_URL_PREFIX}/${assetPath}`; | ||
const response = await axios.head(testUrl, { | ||
timeout: 1000, | ||
}); | ||
return { | ||
status: response.status, | ||
testUrl, | ||
assetPath, | ||
}; | ||
} | ||
|
||
async function headAssetUrlWithRetry( | ||
assetPath: string, | ||
retries = 5 | ||
): Promise<{ | ||
status: number; | ||
testUrl: string; | ||
assetPath: string; | ||
}> { | ||
const result = await headAssetUrl(assetPath); | ||
if (result.status === 200) { | ||
return result; | ||
} else if (retries > 0) { | ||
console.log(`Retrying ${assetPath}...(retries left: ${retries})`); | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
return headAssetUrlWithRetry(assetPath, retries - 1); | ||
} else { | ||
return { | ||
status: result.status || 0, | ||
testUrl: result.testUrl, | ||
assetPath, | ||
}; | ||
} | ||
} | ||
|
||
main() | ||
.then(({ totalAssetCount, assetsNotFound }) => { | ||
if (assetsNotFound) { | ||
console.error(`Couldn't find ${assetsNotFound} assets on CDN.`); | ||
process.exit(1); | ||
} else { | ||
console.log(`All ${totalAssetCount} found on CDN.`); | ||
process.exit(0); | ||
} | ||
}) | ||
.catch((error) => { | ||
console.error(error.message); | ||
process.exit(1); | ||
}); |
Empty file.
Oops, something went wrong.