Skip to content

Commit

Permalink
Merge branch 'main' into remove-legacy-rules-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain authored Sep 9, 2022
2 parents 0ecb956 + 245036b commit 560bb8e
Show file tree
Hide file tree
Showing 2,820 changed files with 95,583 additions and 37,195 deletions.
12 changes: 11 additions & 1 deletion .buildkite/pipelines/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,23 @@ steps:

- command: .buildkite/scripts/steps/artifacts/cloud.sh
label: 'Cloud Deployment'
soft_fail: true
soft_fail:
- exit_status: 255
agents:
queue: n2-2
timeout_in_minutes: 30
if: "build.env('RELEASE_BUILD') == null || build.env('RELEASE_BUILD') == '' || build.env('RELEASE_BUILD') == 'false'"
retry:
automatic:
# Timeout and graceful shutdown | ecctl deployment create falure
- exit_status: 255
limit: 0

# Timeout and forced shutdown
- exit_status: '-1'
limit: 0

# Test failures
- exit_status: '*'
limit: 1

Expand Down
33 changes: 17 additions & 16 deletions .buildkite/scripts/steps/artifacts/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ mkdir -p target

download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"

node scripts/build \
--skip-initialize \
--skip-generic-folders \
--skip-platform-folders \
--skip-archives \
--docker-images \
--skip-docker-ubi \
--skip-docker-ubuntu \
--skip-docker-contexts

docker load --input target/kibana-cloud-$FULL_VERSION-docker-image.tar.gz

TAG="$FULL_VERSION-$GIT_COMMIT"
KIBANA_BASE_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$FULL_VERSION"
KIBANA_TEST_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$TAG"

docker tag "$KIBANA_BASE_IMAGE" "$KIBANA_TEST_IMAGE"

echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT

docker push "$KIBANA_TEST_IMAGE"
if docker manifest inspect $KIBANA_TEST_IMAGE &> /dev/null; then
echo "Distribution already exists, skipping build"
else
node scripts/build \
--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

docker logout docker.elastic.co

echo "--- Create deployment"
Expand Down Expand Up @@ -62,6 +62,7 @@ function shutdown {
trap "shutdown" EXIT

ecctl deployment create --track --output json --file "$DEPLOYMENT_SPEC" > "$LOGS"

CLOUD_DEPLOYMENT_USERNAME=$(jq -r --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$LOGS")
CLOUD_DEPLOYMENT_PASSWORD=$(jq -r --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$LOGS")
CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$LOGS")
Expand Down
9 changes: 8 additions & 1 deletion .buildkite/scripts/steps/checks/bazel_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ source .buildkite/scripts/common/util.sh

echo --- Check Bazel Packages Manifest
node scripts/generate packages_build_manifest

check_for_changed_files 'node scripts/generate packages_build_manifest' true

echo --- Check Codeowners Manifest
if [ -f ".github/CODEOWNERS" ]; then
node scripts/generate codeowners
check_for_changed_files 'node scripts/generate codeowners' true
else
echo "skipping, no existing .github/CODEOWNERS file found"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for i in "${scalabilityJourneys[@]}"; do
echo "Looking for JOURNEY=${JOURNEY_NAME} and BUILD_ID=${BUILD_ID} in APM traces"

node scripts/extract_performance_testing_dataset \
--config "x-pack/test/performance/journeys/${i}/config.ts" \ \
--config "x-pack/test/performance/journeys/${i}/config.ts" \
--buildId "${BUILD_ID}" \
--es-url "${ES_SERVER_URL}" \
--es-username "${USER_FROM_VAULT}" \
Expand Down
19 changes: 9 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
const Path = require('path');
const Fs = require('fs');

const globby = require('globby');
const normalizePath = require('normalize-path');
const { discoverPackageManifestPaths, Jsonc } = require('@kbn/bazel-packages');
const { REPO_ROOT } = require('@kbn/utils');

const APACHE_2_0_LICENSE_HEADER = `
/*
Expand Down Expand Up @@ -119,15 +121,10 @@ const VENN_DIAGRAM_HEADER = `
*/
`;

const packagePkgJsons = globby.sync('*/package.json', {
cwd: Path.resolve(__dirname, 'packages'),
absolute: true,
});

/** Packages which should not be included within production code. */
const DEV_PACKAGES = packagePkgJsons.flatMap((path) => {
const pkg = JSON.parse(Fs.readFileSync(path, 'utf8'));
return pkg.kibana && pkg.kibana.devOnly ? Path.dirname(Path.basename(path)) : [];
const DEV_PACKAGE_DIRS = discoverPackageManifestPaths(REPO_ROOT).flatMap((path) => {
const manifest = Jsonc.parse(Fs.readFileSync(path, 'utf8'));
return !!manifest.devOnly ? normalizePath(Path.relative(REPO_ROOT, Path.dirname(path))) : [];
});

/** Directories (at any depth) which include dev-only code. */
Expand All @@ -145,6 +142,7 @@ const DEV_DIRECTORIES = [
'integration_tests',
'manual_tests',
'mock',
'mocks',
'storybook',
'scripts',
'test',
Expand All @@ -153,6 +151,7 @@ const DEV_DIRECTORIES = [
'test_utilities',
'test_helpers',
'tests_client_integration',
'tsd_tests',
];

/** File patterns for dev-only code. */
Expand All @@ -171,7 +170,7 @@ const DEV_FILE_PATTERNS = [

/** Glob patterns which describe dev-only code. */
const DEV_PATTERNS = [
...DEV_PACKAGES.map((pkg) => `packages/${pkg}/**/*`),
...DEV_PACKAGE_DIRS.map((pkg) => `${pkg}/**/*`),
...DEV_DIRECTORIES.map((dir) => `{packages,src,x-pack}/**/${dir}/**/*`),
...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`),
'packages/kbn-interpreter/tasks/**/*',
Expand Down
Loading

0 comments on commit 560bb8e

Please sign in to comment.