Skip to content

Commit

Permalink
Merge branch 'main' into navigation-embeddable
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter authored Sep 29, 2023
2 parents f4608e0 + 8a29a5e commit f3661c5
Show file tree
Hide file tree
Showing 398 changed files with 8,292 additions and 4,394 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ enabled:
- x-pack/test/saved_object_api_integration/spaces_only/config.ts
- x-pack/test/saved_object_tagging/api_integration/security_and_spaces/config.ts
- x-pack/test/saved_object_tagging/api_integration/tagging_api/config.ts
- x-pack/test/saved_object_tagging/api_integration/tagging_usage_collection/config.ts
- x-pack/test/saved_object_tagging/functional/config.ts
- x-pack/test/saved_objects_field_count/config.ts
- x-pack/test/search_sessions_integration/config.ts
Expand Down
19 changes: 9 additions & 10 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ steps:
- exit_status: '-1'
limit: 3

# TODO: Enable in #166813 after fixing types
# - command: .buildkite/scripts/steps/check_types.sh
# label: 'Check Types'
# agents:
# queue: n2-16-spot
# timeout_in_minutes: 60
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
- command: .buildkite/scripts/steps/check_types.sh
label: 'Check Types'
agents:
queue: n2-16-spot
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
label: 'Build Storybooks'
Expand Down
19 changes: 9 additions & 10 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,12 @@ steps:
- exit_status: '-1'
limit: 3

# TODO: Enable in #166813 after fixing types
# - command: .buildkite/scripts/steps/check_types.sh
# label: 'Check Types'
# agents:
# queue: n2-16-spot
# timeout_in_minutes: 60
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
- command: .buildkite/scripts/steps/check_types.sh
label: 'Check Types'
agents:
queue: n2-16-spot
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
10 changes: 0 additions & 10 deletions .buildkite/pipelines/pull_request/type_check_selective.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ steps:
build:
env:
ENVIRONMENT: ${ENVIRONMENT}
EC_ENV: qa
EC_REGION: aws-eu-west-1
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- group: ":female-detective: Security Solution Tests"
Expand Down
10 changes: 10 additions & 0 deletions .buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ steps:
NAME_PREFIX: ci_test_kibana-promotion_
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-staging.yaml)"

- label: ":pipeline::kibana::seedling: Trigger Kibana Serverless Tests for ${ENVIRONMENT}"
trigger: appex-qa-serverless-kibana-ftr-tests # https://buildkite.com/elastic/appex-qa-serverless-kibana-ftr-tests
soft_fail: true # Remove this before release or when tests stabilize
build:
env:
ENVIRONMENT: ${ENVIRONMENT}
EC_ENV: staging
EC_REGION: aws-us-east-1
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-staging.yaml)"

- wait: ~

- label: ":judge::seedling: Trigger Manual Tests Phase"
Expand Down
6 changes: 0 additions & 6 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ const uploadPipeline = (pipelineContent: string | object) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/kbn_handlebars.yml'));
}

if (GITHUB_PR_LABELS.includes('ci:hard-typecheck')) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check.yml'));
} else {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check_selective.yml'));
}

if (
(await doAnyChangesMatch([
/^src\/plugins\/controls/,
Expand Down
4 changes: 4 additions & 0 deletions .buildkite/scripts/steps/check_types_commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -euo pipefail

# This script will collect typescript projects and run typecheck on projects between the given 2 parameters
# Could be used for selective typechecking on projects that might be affected for a given PR.
# (The accuracy for finding related projects is not a 100%)

if [[ "${CI-}" == "true" ]]; then
.buildkite/scripts/bootstrap.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,37 @@ echo "--- Promoting ${SOURCE_IMAGE_OR_TAG} to ':latest-verified'"
echo "Re-tagging $SOURCE_IMAGE -> $TARGET_IMAGE"

echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
docker pull "$SOURCE_IMAGE"
docker tag "$SOURCE_IMAGE" "$TARGET_IMAGE"
docker push "$TARGET_IMAGE"

ORIG_IMG_DATA=$(docker inspect "$SOURCE_IMAGE")
docker manifest inspect "$SOURCE_IMAGE" | tee manifests.json

ARM_64_DIGEST=$(jq -r '.manifests[] | select(.platform.architecture == "arm64") | .digest' manifests.json)
AMD_64_DIGEST=$(jq -r '.manifests[] | select(.platform.architecture == "amd64") | .digest' manifests.json)

echo docker pull --platform linux/arm64 "$SOURCE_IMAGE@$ARM_64_DIGEST"
docker pull --platform linux/arm64 "$SOURCE_IMAGE@$ARM_64_DIGEST"
echo linux/arm64 image pulled, with digest: $ARM_64_DIGEST

echo docker pull --platform linux/amd64 "$SOURCE_IMAGE@$AMD_64_DIGEST"
docker pull --platform linux/amd64 "$SOURCE_IMAGE@$AMD_64_DIGEST"
echo linux/amd64 image pulled, with digest: $AMD_64_DIGEST

docker tag "$SOURCE_IMAGE@$ARM_64_DIGEST" "$TARGET_IMAGE-arm64"
docker tag "$SOURCE_IMAGE@$AMD_64_DIGEST" "$TARGET_IMAGE-amd64"

docker push "$TARGET_IMAGE-arm64"
docker push "$TARGET_IMAGE-amd64"

docker manifest rm "$TARGET_IMAGE" || echo "Nothing to delete"

docker manifest create "$TARGET_IMAGE" \
--amend "$TARGET_IMAGE-arm64" \
--amend "$TARGET_IMAGE-amd64"

docker manifest push "$TARGET_IMAGE"

docker manifest inspect "$TARGET_IMAGE"

ORIG_IMG_DATA=$(docker inspect "$SOURCE_IMAGE@$ARM_64_DIGEST")
ELASTIC_COMMIT_HASH=$(echo $ORIG_IMG_DATA | jq -r '.[].Config.Labels["org.opencontainers.image.revision"]')

docker logout docker.elastic.co
Expand All @@ -37,7 +63,7 @@ echo "Image push to $TARGET_IMAGE successful."
echo "Promotion successful! Henceforth, thou shall be named Sir $TARGET_IMAGE"

MANIFEST_UPLOAD_PATH="Skipped"
if [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ && "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then
if [[ "${UPLOAD_MANIFEST:-}" =~ ^(1|true)$ && "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then
echo "--- Uploading latest-verified manifest to GCS"
cat << EOT >> $MANIFEST_FILE_NAME
{
Expand All @@ -58,10 +84,12 @@ EOT
gsutil acl ch -u AllUsers:R "gs://$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME"
MANIFEST_UPLOAD_PATH="<a href=\"https://storage.googleapis.com/$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME\">$MANIFEST_FILE_NAME</a>"

elif [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ ]]; then
elif [[ "${UPLOAD_MANIFEST:-}" =~ ^(1|true)$ ]]; then
echo "--- Skipping upload of latest-verified manifest to GCS, ES Serverless build tag is not pointing to a hash"
elif [[ "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then
echo "--- Skipping upload of latest-verified manifest to GCS, flag was not provided"
else
echo "--- Skipping upload of latest-verified manifest to GCS, no flag and hash provided"
fi

echo "--- Annotating build with info"
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ packages/kbn-managed-vscode-config @elastic/kibana-operations
packages/kbn-managed-vscode-config-cli @elastic/kibana-operations
packages/kbn-management/cards_navigation @elastic/platform-deployment-management
src/plugins/management @elastic/platform-deployment-management
packages/kbn-management/settings/components/field_category @elastic/platform-deployment-management
packages/kbn-management/settings/components/field_input @elastic/platform-deployment-management
packages/kbn-management/settings/components/field_row @elastic/platform-deployment-management
packages/kbn-management/settings/components/form @elastic/platform-deployment-management
Expand Down
3 changes: 1 addition & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|{kib-repo}blob/{branch}/x-pack/plugins/asset_manager/README.md[assetManager]
|This plugin provides access to the asset data stored in assets-* indices, primarily
for inventory and topology purposes.
|This plugin provides access to observed asset data, such as information about hosts, pods, containers, services, and more.
|{kib-repo}blob/{branch}/x-pack/plugins/banners/README.md[banners]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@
"@kbn/logstash-plugin": "link:x-pack/plugins/logstash",
"@kbn/management-cards-navigation": "link:packages/kbn-management/cards_navigation",
"@kbn/management-plugin": "link:src/plugins/management",
"@kbn/management-settings-components-field-category": "link:packages/kbn-management/settings/components/field_category",
"@kbn/management-settings-components-field-input": "link:packages/kbn-management/settings/components/field_input",
"@kbn/management-settings-components-field-row": "link:packages/kbn-management/settings/components/field_row",
"@kbn/management-settings-components-form": "link:packages/kbn-management/settings/components/form",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface LoadingIndicatorProps {
loadingCount$: ReturnType<HttpStart['getLoadingCount$']>;
showAsBar?: boolean;
customLogo?: string;
maxAmount?: number;
valueAmount?: string | number;
}

export class LoadingIndicator extends React.Component<LoadingIndicatorProps, { visible: boolean }> {
Expand Down Expand Up @@ -62,8 +64,6 @@ export class LoadingIndicator extends React.Component<LoadingIndicatorProps, { v
? 'globalLoadingIndicator'
: 'globalLoadingIndicator-hidden';

const ariaHidden = !this.state.visible;

const ariaLabel = i18n.translate('core.ui.loadingIndicatorAriaLabel', {
defaultMessage: 'Loading content',
});
Expand Down Expand Up @@ -107,8 +107,8 @@ export class LoadingIndicator extends React.Component<LoadingIndicatorProps, { v
<EuiProgress
className={className}
data-test-subj={testSubj}
aria-hidden={ariaHidden}
aria-label={ariaLabel}
max={this.props.maxAmount}
value={this.props.valueAmount}
position="fixed"
color="accent"
size="xs"
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,9 @@
},
"updatedBy": {
"type": "text"
},
"savedSearchId": {
"type": "text"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-management/settings/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These packages comprise the Management Advanced Settings application. The sourc

## Notes

**Be aware**: the functional flow logic we've adopted for these components is not one I would encourage, specifically, using "drilled" onChange handlers and utilizing a composing-component-based store. Ideally, we'd use a Redux store, or, at the very least, a React reducer.
**Be aware**: the functional flow logic we've adopted for these components is not one I would encourage, specifically, using "drilled" onFieldChange handlers and utilizing a composing-component-based store. Ideally, we'd use a Redux store, or, at the very least, a React reducer.

In the interest of time and compatibility, we've opted to use the pattern from the original components in `advancedSettings`. We plan to revisit the state management and prop-drilling when `advancedSettings` is refactored with these components.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: management/settings/components/fieldCategory
slug: /management/settings/components/field-category
title: Management Settings Field Category Component
description: A package containing components for rendering field rows in collections organized by their category.
tags: ['management', 'settings']
date: 2023-10-25
---

## Description

This package contains a component for rendering field rows of `UiSetting` objects in collections organized by their category. It's used primarily by the `Form` component.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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 React from 'react';
import type { ComponentMeta, Story } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { FieldCategories as Component } from '../categories';
import { Params, useCategoryStory } from './use_category_story';
import { FieldCategoryProvider } from '../services';

export default {
title: 'Settings/Field Category/Categories',
description: '',
args: {
isFiltered: false,
isSavingEnabled: true,
},
argTypes: {
isFiltered: {
control: {
type: 'boolean',
},
},
isSavingEnabled: {
control: {
type: 'boolean',
},
},
},
parameters: {
backgrounds: {
default: 'ghost',
},
},
} as ComponentMeta<typeof Component>;

export const Categories: Story<Params> = (params) => {
const { onClearQuery, isSavingEnabled, onFieldChange, unsavedChanges, categorizedFields } =
useCategoryStory(params);

return (
<FieldCategoryProvider
showDanger={action('showDanger')}
links={{ deprecationKey: 'link/to/deprecation/docs' }}
>
<Component
{...{ categorizedFields, onFieldChange, unsavedChanges, onClearQuery, isSavingEnabled }}
/>
</FieldCategoryProvider>
);
};
Loading

0 comments on commit f3661c5

Please sign in to comment.