Skip to content

Commit

Permalink
Merge branch 'main' into issue-123550-fix-broken-weak-links-on-import
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 18, 2022
2 parents 8117ced + 0f35206 commit a5809c4
Show file tree
Hide file tree
Showing 293 changed files with 5,791 additions and 1,677 deletions.
2 changes: 2 additions & 0 deletions .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ for (const testSuite of testSuites) {
concurrency_group: UUID,
concurrency_method: 'eager',
});
break;

case 'cypress':
const CYPRESS_SUITE = CI_GROUP;
const group = groups.find((group) => group.key.includes(CYPRESS_SUITE));
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/demo_env/es_and_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mkdir -p target

export ES_IMAGE="gcr.io/elastic-kibana-184716/demo/elasticsearch:$DEPLOYMENT_NAME-$(git rev-parse HEAD)"

DOCKER_EXPORT_URL=$(curl https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$DEPLOYMENT_VERSION/manifest-latest-verified.json | jq -r '.archives | .[] | select(.platform=="docker") | .url')
DOCKER_EXPORT_URL=$(curl https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$DEPLOYMENT_VERSION/manifest-latest-verified.json | jq -r '.archives | .[] | select(.url | test("docker-image")) | .url')
curl "$DOCKER_EXPORT_URL" > target/elasticsearch-docker.tar.gz
docker load < target/elasticsearch-docker.tar.gz
docker tag "docker.elastic.co/elasticsearch/elasticsearch:$DEPLOYMENT_VERSION-SNAPSHOT" "$ES_IMAGE"
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/contributing/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Please make sure you have signed the [Contributor License Agreement](http://www.

Read <<kibana-localization-best-practices>> for details on our localization practices.

Note that we cannot support accepting contributions to the translations from any source other than the translators we have engaged to do the work.
We are still to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once contributions can be supported, but for the time being, we are not able to incorporate suggestions.
Note that we cannot support accepting contributions to the translations from any source other than the translators we have engaged in doing the work.
We are yet to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once Kibana supports external contributions. Still, for the time being, we cannot incorporate suggestions.

[discrete]
[[kibana-release-notes-process]]
Expand Down Expand Up @@ -73,7 +73,7 @@ To make sure that your PR is included in the Release Notes, add the right label.
* `release_note:fix` — Fixes for bugs that existed in the previous release.
* `release_note:deprecation` — Deprecates functionality that existed in previous releases.
* `release_note:breaking` — Breaking changes that weren't present in previous releases.
* `release_note:skip` — Changes that should not appear in the Release Notes. For example, docs, build, and test fixes, or unreleased issues that are only in `master`.
* `release_note:skip` — Changes that should not appear in the Release Notes. For example, docs, build, and test fixes, or unreleased issues that are only in `main`.


include::development-github.asciidoc[leveloffset=+1]
Expand Down
24 changes: 9 additions & 15 deletions docs/developer/plugin/external-plugin-localization.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,12 @@ node scripts/i18n_check --fix --include-config ../kibana-extra/myPlugin/.i18nrc.
[discrete]
=== Implementing i18n in the UI

{kib} relies on several UI frameworks (ReactJS and AngularJS) and
requires localization in different environments (browser and NodeJS).
{kib} relies on ReactJS and requires localization in different environments (browser and NodeJS).
The internationalization engine is framework agnostic and consumable in
all parts of {kib} (ReactJS, AngularJS and NodeJS).
all parts of {kib} (ReactJS, and NodeJS).

To simplify
internationalization in UI frameworks, additional abstractions are
built around the I18n engine: `react-intl` for React and custom
components for AngularJS. https://github.com/yahoo/react-intl[React-intl]
is built around https://github.com/yahoo/intl-messageformat[intl-messageformat],
so both React and AngularJS frameworks use the same engine and the same
message syntax.
To simplify internationalization in React, an additional abstraction is
built around the I18n engine using https://github.com/yahoo/react-intl[React-intl] for React.


[discrete]
Expand All @@ -109,7 +103,7 @@ export const HELLO_WORLD = i18n.translate('hello.wonderful.world', {
});
-----------

Full details are {kib-repo}tree/master/packages/kbn-i18n#vanilla-js[here].
Full details are {kib-repo}tree/main/packages/kbn-i18n#vanilla-js[here].

[discrete]
==== i18n for React
Expand All @@ -133,14 +127,14 @@ export const Component = () => {
};
-----------

Full details are {kib-repo}tree/master/packages/kbn-i18n#react[here].
Full details are {kib-repo}tree/main/packages/kbn-i18n#react[here].

[discrete]
=== Resources

To learn more about i18n tooling, see {blob}src/dev/i18n/README.md[i18n dev tooling].
To learn more about i18n tooling, see {kib-repo}blob/{branch}src/dev/i18n/README.md[i18n dev tooling].

To learn more about implementing i18n in the UI, use the following links:

* {blob}packages/kbn-i18n/README.md[i18n plugin]
* {blob}packages/kbn-i18n/GUIDELINE.md[i18n guidelines]
* {kib-repo}blob/{branch}packages/kbn-i18n/README.md[i18n plugin]
* {kib-repo}blob/{branch}packages/kbn-i18n/GUIDELINE.md[i18n guidelines]
1 change: 1 addition & 0 deletions docs/settings/i18n-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ You do not need to configure any settings to run Kibana in English.
* English - `en` (default)
* Chinese - `zh-CN`
* Japanese - `ja-JP`
* French - `fr-FR`
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"@babel/register": "^7.17.0",
"@babel/traverse": "^7.17.3",
"@babel/types": "^7.17.0",
"@bazel/ibazel": "^0.15.10",
"@bazel/ibazel": "^0.16.2",
"@bazel/typescript": "4.0.0",
"@cypress/code-coverage": "^3.9.12",
"@cypress/snapshot": "^2.1.7",
Expand All @@ -461,7 +461,7 @@
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/github-checks-reporter": "0.0.20b3",
"@elastic/makelogs": "^6.0.0",
"@elastic/synthetics": "^1.0.0-beta.16",
"@elastic/synthetics": "^1.0.0-beta.22",
"@emotion/babel-preset-css-prop": "^11.2.0",
"@emotion/jest": "^11.3.0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ts_project(
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-ace/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"stripInternal": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [
key: 'typescript.enablePromptUseWorkspaceTsdk',
value: true,
},
{
key: 'git.autoRepositoryDetection',
value: false,
},
{
key: 'typescript.tsserver.maxTsServerMemory',
value: 4096,
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,5 +602,8 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
endpoints: {
troubleshooting: `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/ts-management.html#ts-endpoints`,
},
legal: {
privacyStatement: `${ELASTIC_WEBSITE_URL}legal/privacy-statement`,
},
});
};
3 changes: 3 additions & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,7 @@ export interface DocLinks {
readonly endpoints: {
readonly troubleshooting: string;
};
readonly legal: {
readonly privacyStatement: string;
};
}
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pageLoadAssetSize:
bfetch: 22837
kibanaUtils: 79713
data: 491273
dataViews: 42532
dataViews: 43532
expressions: 140958
fieldFormats: 65209
kibanaReact: 74422
Expand All @@ -123,4 +123,4 @@ pageLoadAssetSize:
ux: 20784
sessionView: 77750
cloudSecurityPosture: 19109
visTypeGauge: 24113
visTypeGauge: 24113
7 changes: 6 additions & 1 deletion packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8945,7 +8945,12 @@ const BootstrapCommand = {

if (forceInstall) {
await time('force install dependencies', async () => {
await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['run', '@nodejs//:yarn'], runOffline);
await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['run', '@nodejs//:yarn'], runOffline, {
env: {
SASS_BINARY_SITE: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass',
RE2_DOWNLOAD_MIRROR: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2'
}
});
});
} // build packages

Expand Down
9 changes: 8 additions & 1 deletion packages/kbn-pm/src/commands/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ export const BootstrapCommand: ICommand = {

if (forceInstall) {
await time('force install dependencies', async () => {
await runBazel(['run', '@nodejs//:yarn'], runOffline);
await runBazel(['run', '@nodejs//:yarn'], runOffline, {
env: {
SASS_BINARY_SITE:
'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass',
RE2_DOWNLOAD_MIRROR:
'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2',
},
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AutocompleteFieldWildcardComponent } from '.';
import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete';
import { fields, getField } from '../fields/index.mock';
import { autocompleteStartMock } from '../autocomplete/index.mock';
import { FILENAME_WILDCARD_WARNING, FILEPATH_WARNING } from '@kbn/securitysolution-utils';

jest.mock('../hooks/use_field_value_autocomplete');

Expand Down Expand Up @@ -276,4 +277,116 @@ describe('AutocompleteFieldWildcardComponent', () => {
selectedField: getField('file.path.text'),
});
});

test('it does not invoke "onWarning" when no warning exists', () => {
const mockOnWarning = jest.fn();
wrapper = mount(
<AutocompleteFieldWildcardComponent
autocompleteService={autocompleteStartMock}
indexPattern={{
fields,
id: '1234',
title: 'logs-endpoint.events.*',
}}
isClearable={false}
isDisabled={false}
isLoading={false}
onChange={jest.fn()}
onError={jest.fn()}
onWarning={mockOnWarning}
placeholder="Placeholder text"
selectedField={getField('file.path.text')}
selectedValue="invalid path"
/>
);

act(() => {
(
wrapper.find(EuiComboBox).props() as unknown as {
onBlur: () => void;
}
).onBlur();
});

expect(mockOnWarning).not.toHaveBeenCalledWith(true);
});

test('it invokes "onWarning" when warning exists', () => {
const mockOnWarning = jest.fn();
wrapper = mount(
<AutocompleteFieldWildcardComponent
autocompleteService={autocompleteStartMock}
indexPattern={{
fields,
id: '1234',
title: 'logs-endpoint.events.*',
}}
isClearable={false}
isDisabled={false}
isLoading={false}
onChange={jest.fn()}
onError={jest.fn()}
onWarning={mockOnWarning}
placeholder="Placeholder text"
selectedField={getField('file.path.text')}
selectedValue="invalid path"
warning={FILEPATH_WARNING}
/>
);

act(() => {
(
wrapper.find(EuiComboBox).props() as unknown as {
onBlur: () => void;
}
).onBlur();
});

expect(mockOnWarning).toHaveBeenCalledWith(true);
expect(
wrapper
.find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText')
.at(0)
.text()
).toEqual(FILEPATH_WARNING);
});

test('it invokes "onWarning" when warning exists and is wildcard warning', () => {
const mockOnWarning = jest.fn();
wrapper = mount(
<AutocompleteFieldWildcardComponent
autocompleteService={autocompleteStartMock}
indexPattern={{
fields,
id: '1234',
title: 'logs-endpoint.events.*',
}}
isClearable={false}
isDisabled={false}
isLoading={false}
onChange={jest.fn()}
onError={jest.fn()}
onWarning={mockOnWarning}
placeholder="Placeholder text"
selectedField={getField('file.path.text')}
selectedValue="invalid path"
warning={FILENAME_WILDCARD_WARNING}
/>
);

act(() => {
(
wrapper.find(EuiComboBox).props() as unknown as {
onBlur: () => void;
}
).onBlur();
});

expect(mockOnWarning).toHaveBeenCalledWith(true);
const helpText = wrapper
.find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText')
.at(0);
expect(helpText.text()).toEqual(FILENAME_WILDCARD_WARNING);
expect(helpText.find('.euiToolTipAnchor')).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { paramIsValid } from '../param_is_valid';

const SINGLE_SELECTION = { asPlainText: true };

type Warning = string | React.ReactNode;
interface AutocompleteFieldWildcardProps {
placeholder: string;
selectedField: DataViewFieldBase | undefined;
Expand All @@ -43,7 +44,7 @@ interface AutocompleteFieldWildcardProps {
onChange: (arg: string) => void;
onError: (arg: boolean) => void;
onWarning: (arg: boolean) => void;
warning?: string;
warning?: Warning;
}

export const AutocompleteFieldWildcardComponent: React.FC<AutocompleteFieldWildcardProps> = memo(
Expand Down Expand Up @@ -103,7 +104,7 @@ export const AutocompleteFieldWildcardComponent: React.FC<AutocompleteFieldWildc
);

const handleWarning = useCallback(
(warn: string | undefined): void => {
(warn: Warning | undefined): void => {
onWarning(warn !== undefined);
},
[onWarning]
Expand Down Expand Up @@ -194,9 +195,7 @@ export const AutocompleteFieldWildcardComponent: React.FC<AutocompleteFieldWildc
if (onError != null) {
onError(false);
}
if (onWarning != null) {
onWarning(false);
}
onWarning(false);
}, [selectedField, onError, onWarning]);

const defaultInput = useMemo((): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { i18n } from '@kbn/i18n';

export const FILENAME_WILDCARD_WARNING = i18n.translate('utils.filename.wildcardWarning', {
defaultMessage: `A wildcard in the filename will affect the endpoint's performance`,
defaultMessage: `Using wildcards in file paths can impact Endpoint performance`,
});

export const FILEPATH_WARNING = i18n.translate('utils.filename.pathWarning', {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a5809c4

Please sign in to comment.