Skip to content

Commit

Permalink
Merge branch 'main' into visualize-respect-managed-content
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 30, 2024
2 parents 2862791 + 0e22f75 commit 5bbd9e3
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

set -euo pipefail

# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904)
gsutil -m cp -r gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/previous.txt . || echo "### Previous Pointer NOT FOUND?"

# TODO: Activate after the above is removed
#gsutil -m cp -r gs://elastic-kibana-coverage-live/previous_pointer/previous.txt . || echo "### Previous Pointer NOT FOUND?"

if [ -e ./previous.txt ]; then
mv previous.txt downloaded_previous.txt
echo "### downloaded_previous.txt"
cat downloaded_previous.txt
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ collectPrevious() {
}
collectPrevious

gsutil cp previous.txt gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/
# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904)
gsutil cp previous.txt gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/

gsutil cp previous.txt gs://elastic-kibana-coverage-live/previous_pointer/
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ set -euo pipefail

xs=("$@")

uploadPrefix="gs://elastic-bekitzur-kibana-coverage-live/"
# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904) - also clean up usages
uploadPrefix_old="gs://elastic-bekitzur-kibana-coverage-live/"
uploadPrefixWithTimeStamp_old="${uploadPrefix}${TIME_STAMP}/"

uploadPrefix="gs://elastic-kibana-coverage-live/"
uploadPrefixWithTimeStamp="${uploadPrefix}${TIME_STAMP}/"

uploadBase() {
for x in 'src/dev/code_coverage/www/index.html' 'src/dev/code_coverage/www/404.html'; do
gsutil -m -q cp -r -a public-read -z js,css,html "${x}" "${uploadPrefix}"
gsutil -m -q cp -r -a public-read -z js,css,html "${x}" "${uploadPrefix_old}"
done
}

uploadRest() {
for x in "${xs[@]}"; do
gsutil -m -q cp -r -a public-read -z js,css,html "target/kibana-coverage/${x}-combined" "${uploadPrefixWithTimeStamp}"
gsutil -m -q cp -r -a public-read -z js,css,html "target/kibana-coverage/${x}-combined" "${uploadPrefixWithTimeStamp_old}"
done
}

Expand Down
22 changes: 14 additions & 8 deletions docs/maps/connect-to-ems.asciidoc
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
[[maps-connect-to-ems]]
== Connect to Elastic Maps Service

:ems: Elastic Maps Service
:ems-docker-repo: docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8
:ems-docker-image: {ems-docker-repo}:{version}
:ems-headers-url: https://deployment-host

https://www.elastic.co/elastic-maps-service[Elastic Maps Service (EMS)] is a service that hosts
[[maps-connect-to-ems]]
== Connect to {ems}

https://www.elastic.co/elastic-maps-service[{ems} (EMS)] is a service that hosts
tile layers and vector shapes of administrative boundaries.
If you are using Kibana's out-of-the-box settings, Maps is already configured to use EMS.

If you are on a restricted or fully air-gapped environment, you may need to configure your firewall to enable access to EMS resources. Find below details on the domains and HTTP headers used by {ems}. Alternatively, {ems} can be <<disable-ems, disabled>> or <<elastic-maps-server, installed locally>>.

[float]
=== Domains

Expand Down Expand Up @@ -57,7 +60,8 @@ include::headers/file-data.asciidoc[]


[float]
=== Disable Elastic Maps Service
[id=disable-ems]
=== Disable {ems}

You might experience EMS connection issues if your Kibana server or browser are on a private network or
behind a firewall. If this happens, you can disable the EMS connection to avoid unnecessary EMS requests.
Expand All @@ -69,11 +73,13 @@ To disable EMS, change your <<settings, kibana.yml>> file.

[float]
[id=elastic-maps-server]
=== Host Elastic Maps Service locally
=== Host {ems} locally

NOTE: Find more details about installing Elastic components in an air-gapped environment in the {stack-ref}/air-gapped-install.html[Elastic Stack documentation].

If you cannot connect to Elastic Maps Service from the {kib} server or browser clients, and your cluster has the appropriate license level, you can opt to host the service on your own infrastructure.
If you cannot connect to {ems} from the {kib} server or browser clients, and your cluster has the appropriate license level, you can opt to host the service on your own infrastructure.

{hosted-ems} is a self-managed version of Elastic Maps Service offered as a Docker image that provides both the EMS basemaps and EMS boundaries. The image is bundled with basemaps up to zoom level 8. After connecting it to your {es} cluster for license validation, you have the option to download and configure a more detailed basemaps database.
{hosted-ems} is a self-managed version of {ems} offered as a Docker image that provides both the EMS basemaps and EMS boundaries. The image is bundled with basemaps up to zoom level 8. After connecting it to your {es} cluster for license validation, you have the option to download and configure a more detailed basemaps database.

You can use +docker pull+ to download the {hosted-ems} image from the Elastic Docker registry.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@
"pretty-ms": "6.0.0",
"prop-types": "^15.8.1",
"proxy-from-env": "1.0.0",
"puppeteer": "21.5.2",
"puppeteer": "21.9.0",
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.9.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import React, { useCallback, useEffect, useMemo, useState } from 'react';

import { i18n } from '@kbn/i18n';
import { SettingType } from '@kbn/management-settings-types';
import { getFieldInputValue, useUpdate } from '@kbn/management-settings-utilities';

Expand Down Expand Up @@ -55,6 +56,24 @@ export const CodeEditorInput = ({
async (newValue: string, onUpdateFn) => {
const isJsonArray = Array.isArray(JSON.parse(defaultValue || '{}'));
const parsedValue = newValue || (isJsonArray ? '[]' : '{}');

// Validate JSON syntax
if (field.type === 'json') {
try {
JSON.parse(parsedValue);
} catch (e) {
onUpdateFn({
type: field.type,
unsavedValue: newValue,
isInvalid: true,
error: i18n.translate('management.settings.field.codeEditorSyntaxErrorMessage', {
defaultMessage: 'Invalid JSON syntax',
}),
});
return;
}
}

const validationResponse = await validateChange(field.id, parsedValue);
if (validationResponse.successfulValidation && !validationResponse.valid) {
onUpdateFn({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ describe('JsonEditorInput', () => {
);
});

it('calls the onInputChange prop with an error when the object value changes to invalid JSON', async () => {
const { getByTestId } = render(wrap(<CodeEditorInput {...defaultProps} />));
const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`);
fireEvent.change(input, { target: { value: '{"bar" "foo"}' } });

await waitFor(() =>
expect(defaultProps.onInputChange).toHaveBeenCalledWith({
type: 'json',
unsavedValue: '{"bar" "foo"}',
error: 'Invalid JSON syntax',
isInvalid: true,
})
);
});

it('calls the onInputChange prop when the array value changes', async () => {
const props = { ...defaultProps, defaultValue: '["bar", "foo"]', value: undefined };
const { getByTestId } = render(wrap(<CodeEditorInput {...props} />));
Expand Down Expand Up @@ -117,4 +132,20 @@ describe('JsonEditorInput', () => {
expect(defaultProps.onInputChange).toHaveBeenCalledWith({ type: 'json', unsavedValue: '' })
);
});

it('calls the onInputChange prop with an array when the array value changes to invalid JSON', async () => {
const props = { ...defaultProps, defaultValue: '["bar", "foo"]', value: undefined };
const { getByTestId } = render(wrap(<CodeEditorInput {...props} />));
const input = getByTestId(`${TEST_SUBJ_PREFIX_FIELD}-${id}`);
fireEvent.change(input, { target: { value: '["bar", "foo" | "baz"]' } });

await waitFor(() =>
expect(defaultProps.onInputChange).toHaveBeenCalledWith({
type: 'json',
unsavedValue: '["bar", "foo" | "baz"]',
error: 'Invalid JSON syntax',
isInvalid: true,
})
);
});
});
5 changes: 2 additions & 3 deletions test/examples/expressions_explorer/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
const find = getService('find');
const browser = getService('browser');

// FLAKY: https://github.com/elastic/kibana/issues/156780
describe.skip('', () => {
describe('', () => {
it('runs expression', async () => {
await retry.try(async () => {
const text = await testSubjects.getVisibleText('expressionResult');
Expand Down Expand Up @@ -54,7 +53,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
await find.clickByCssSelector(selector);
await retry.try(async () => {
const text = await browser.getCurrentUrl();
expect(text).to.contain('https://www.google.com/');
expect(text).to.contain('https://www.google.com');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,32 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve

cy.getBySel(RESPONSE_ACTIONS_ERRORS).within(() => {
cy.contains('Query is a required field');
cy.contains('Timeout value must be greater than 60 seconds.').should('not.exist');
cy.contains('The timeout value must be 60 seconds or higher.').should('not.exist');
});

// check if changing error state of one input doesn't clear other errors - START
cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => {
cy.contains('Advanced').click();
cy.getBySel('timeout-input').clear();
cy.contains('Timeout value must be greater than 60 seconds.');
cy.contains('The timeout value must be 60 seconds or higher.');
});

cy.getBySel(RESPONSE_ACTIONS_ERRORS).within(() => {
cy.contains('Query is a required field');
cy.contains('Timeout value must be greater than 60 seconds.');
cy.contains('The timeout value must be 60 seconds or higher.');
});

cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => {
cy.getBySel('timeout-input').type('6');
cy.contains('Timeout value must be greater than 60 seconds.');
cy.contains('The timeout value must be 60 seconds or higher.');
});
cy.getBySel(RESPONSE_ACTIONS_ERRORS).within(() => {
cy.contains('Query is a required field');
cy.contains('Timeout value must be greater than 60 seconds.');
cy.contains('The timeout value must be 60 seconds or higher.');
});
cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => {
cy.getBySel('timeout-input').type('6');
cy.contains('Timeout value must be greater than 60 seconds.').should('not.exist');
cy.contains('The timeout value must be 60 seconds or higher.').should('not.exist');
});
cy.getBySel(RESPONSE_ACTIONS_ERRORS).within(() => {
cy.contains('Query is a required field');
Expand All @@ -105,7 +105,7 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve
});
cy.getBySel(RESPONSE_ACTIONS_ERRORS).within(() => {
cy.contains('Query is a required field');
cy.contains('Timeout value must be greater than 60 seconds.').should('not.exist');
cy.contains('The timeout value must be 60 seconds or higher.').should('not.exist');
});
// check if changing error state of one input doesn't clear other errors - END

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/osquery/cypress/e2e/all/live_query.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ describe('ALL - Live Query', { tags: ['@ess', '@serverless'] }, () => {
getAdvancedButton().click();
fillInQueryTimeout('910');
submitQuery();
cy.contains('Timeout value must be lower than 900 seconds.');
cy.contains('The timeout value must be 900 seconds or or lower.');
fillInQueryTimeout('890');
submitQuery();
cy.contains('Timeout value must be lower than 900 seconds.').should('not.exist');
cy.contains('The timeout value must be 900 seconds or or lower.').should('not.exist');
typeInOsqueryFieldInput('days{downArrow}{enter}');
submitQuery();
cy.contains('ECS field is required.');
Expand Down
11 changes: 6 additions & 5 deletions x-pack/plugins/osquery/public/form/timeout_field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ const TimeoutFieldComponent = ({ euiFieldProps }: TimeoutFieldProps) => {
validate: (currentValue: number) => {
if (currentValue < QUERY_TIMEOUT.DEFAULT || isNaN(currentValue)) {
return i18n.translate('xpack.osquery.pack.queryFlyoutForm.timeoutFieldMinNumberError', {
defaultMessage: 'Timeout value must be greater than {than} seconds.',
values: { than: QUERY_TIMEOUT.DEFAULT },
defaultMessage: 'The timeout value must be {timeoutInSeconds} seconds or higher.',
values: { timeoutInSeconds: QUERY_TIMEOUT.DEFAULT },
});
}

if (currentValue > QUERY_TIMEOUT.MAX) {
return i18n.translate('xpack.osquery.pack.queryFlyoutForm.timeoutFieldMaxNumberError', {
defaultMessage: 'Timeout value must be lower than {than} seconds.',
values: { than: QUERY_TIMEOUT.MAX },
defaultMessage: 'The timeout value must be {timeoutInSeconds} seconds or or lower. ',
values: { timeoutInSeconds: QUERY_TIMEOUT.MAX },
});
}
},
Expand All @@ -61,7 +61,8 @@ const TimeoutFieldComponent = ({ euiFieldProps }: TimeoutFieldProps) => {
<EuiFlexItem grow={false}>
<EuiIconTip
content={i18n.translate('xpack.osquery.liveQuery.timeoutHint', {
defaultMessage: 'Maximum time to wait for query results, default is 60 seconds.',
defaultMessage:
'The default and minimum timeout period is 60 seconds. Increase this value if your query needs more time to run.',
})}
/>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('headless webgl arm mac workaround', () => {
// please double-check that the --use-angle flag is still needed for arm macs
// instead of --use-angle you may need --enable-gpu
expect(getChromiumPackage().binaryChecksum).toBe(
'a8556ed7ac2a669fa81f752f7d18a9d1e9b99b05d3504f6bbc08e3e0b02ff71e'
'2b5c892e3125eecd31b651f4632cbafabee3a31c02728dcddafee8d462ab075d'
); // just putting this here so that someone updating the chromium version will see this comment
});
});
34 changes: 17 additions & 17 deletions x-pack/plugins/screenshotting/server/browsers/chromium/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export class ChromiumArchivePaths {
platform: 'darwin',
architecture: 'x64',
archiveFilename: 'chrome-mac.zip',
archiveChecksum: '35261c7a88f1797d27646c340eeaf7d7d70727f0c4ae884e8400240ed66d7192',
binaryChecksum: 'ca90fe7573ddb0723d633fe526acf0fdefdda570a549f35e15c111d10f3ffc0d',
archiveChecksum: '2577b515b871b507a9c830cdf5a360e6a966dc058e07307ad1a21a22ae681d4c',
binaryChecksum: '80287437016fd444f78822017c3dba939984b627c18cba57b052136323aa82ef',
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
revision: 1204244, // 1204232 is not available for Mac Intel
revision: 1233115, // 1233107 is not available for Mac Intel
location: 'common',
archivePath: 'Mac',
isPreInstalled: false,
Expand All @@ -56,44 +56,44 @@ export class ChromiumArchivePaths {
platform: 'darwin',
architecture: 'arm64',
archiveFilename: 'chrome-mac.zip',
archiveChecksum: '1ed375086a9505ee6bc9bc1373bebd79e87e5b27af5a93258ea25ffb6f71f03c',
binaryChecksum: 'a8556ed7ac2a669fa81f752f7d18a9d1e9b99b05d3504f6bbc08e3e0b02ff71e',
archiveChecksum: 'c2219ea9dea838eef2ea350c4d2591fc91090fd7a920dfa010fa44d8c31db515',
binaryChecksum: '2b5c892e3125eecd31b651f4632cbafabee3a31c02728dcddafee8d462ab075d',
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
revision: 1204255, // 1204232 is not available for Mac_Arm
revision: 1233124, // 1233107 is not available for Mac_Arm
location: 'common',
archivePath: 'Mac_Arm',
isPreInstalled: false,
},
{
platform: 'linux',
architecture: 'x64',
archiveFilename: 'chromium-38c7255-locales-linux_x64.zip',
archiveChecksum: 'bf07734366ece771a85b2452fd63e5981b1abc234ef0ed1c7d0774b8a7b5c6a9',
binaryChecksum: '87a991c412ad333549a58524b6be23f2a1ff56af61bb1a1b10c1f4a0206edc2a',
archiveFilename: 'chromium-3f98d69-locales-linux_x64.zip',
archiveChecksum: '251e4cf450bfab59154a2a366e724db65df521016d3fc651e9fe5cbe6970b7b0',
binaryChecksum: 'cd888114440b25c29a653563e56a29dc1ae2cebbf335e557f99100c5402bc302',
binaryRelativePath: 'headless_shell-linux_x64/headless_shell',
revision: 1204232,
revision: 1233107,
location: 'custom',
isPreInstalled: true,
},
{
platform: 'linux',
architecture: 'arm64',
archiveFilename: 'chromium-38c7255-locales-linux_arm64.zip',
archiveChecksum: '11c1cd2398ae3b57a72e7746e1f1cbbd2c2d18d1b83dec949dc81a3c690688f0',
binaryChecksum: '4d914034d466b97c438283dbc914230e087217c25028f403dfa3c933ea755e94',
archiveFilename: 'chromium-3f98d69-locales-linux_arm64.zip',
archiveChecksum: '87e59ba3fb20649301a27f56d3328d970812ecb473b23ad216f9122739a40bf0',
binaryChecksum: '2a44c60e7f85e47533beace3d5dc6271803f87e8fc2083e8cdc612e8cf4366b9',
binaryRelativePath: 'headless_shell-linux_arm64/headless_shell',
revision: 1204232,
revision: 1233107,
location: 'custom',
isPreInstalled: true,
},
{
platform: 'win32',
architecture: 'x64',
archiveFilename: 'chrome-win.zip',
archiveChecksum: 'd6f5a21973867115435814c2c46d49edd9a0a2ad6da14b4724746374cad80e47',
binaryChecksum: '9c0d2404004bd7c4ada649049422de6958460ecf6cec53460a478c6d8c33e444',
archiveChecksum: 'b7c04da4d51ee03eca5ffa6c440c951375147d913647375e30bd52e9d67c6caf',
binaryChecksum: '52fe4b81323c73d48cb50e80d16e61e1aced809e19d984d9df20169efdf63b5b',
binaryRelativePath: path.join('chrome-win', 'chrome.exe'),
revision: 1204234, // 1204232 is not available for win
revision: 1233121, // 1233107 is not available for win
location: 'common',
archivePath: 'Win',
isPreInstalled: true,
Expand Down
Loading

0 comments on commit 5bbd9e3

Please sign in to comment.