Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecation logs created by Elastic products #121174

Merged
merged 3 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -27252,7 +27252,11 @@
"xpack.upgradeAssistant.overview.systemIndices.statusTableColumn": "ステータス",
"xpack.upgradeAssistant.overview.systemIndices.title": "システムインデックスの移行",
"xpack.upgradeAssistant.overview.systemIndices.viewSystemIndicesStatus": "移行詳細を表示",
"xpack.upgradeAssistant.overview.upgradeGuideLink": "アップグレードガイドを表示",
"xpack.upgradeAssistant.overview.upgradeStepCloudLink": "クラウドでアップグレード",
"xpack.upgradeAssistant.overview.upgradeStepDescription": "重要な問題をすべて解決し、アプリケーションの準備を確認した後に、Elastic 8.xにアップグレードできます。アップグレードする前に、必ずもう一度データをバックアップしたことを確認してください。",
"xpack.upgradeAssistant.overview.upgradeStepDescriptionForCloud": "重要な問題をすべて解決し、アプリケーションの準備を確認した後に、Elastic 8.xにアップグレードできます。アップグレードする前に、必ずもう一度データをバックアップしたことを確認してください。Elastic Cloudでデプロイをアップグレードします。",
"xpack.upgradeAssistant.overview.upgradeStepLink": "詳細",
"xpack.upgradeAssistant.overview.upgradeStepTitle": "Elastic 8.xへのアップグレード",
"xpack.upgradeAssistant.overview.verifyChanges.calloutBody": "変更した後、カウンターをリセットして監視を続け、廃止予定の機能を使用していないことを確認します。",
"xpack.upgradeAssistant.overview.verifyChanges.calloutTitle": "{previousCheck}以降{warningsCount, plural, =0 {0} other {{warningsCount}}}件の廃止予定{warningsCount, plural, other {件の問題}}",
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -27717,7 +27717,11 @@
"xpack.upgradeAssistant.overview.systemIndices.statusTableColumn": "状态",
"xpack.upgradeAssistant.overview.systemIndices.title": "迁移系统索引",
"xpack.upgradeAssistant.overview.systemIndices.viewSystemIndicesStatus": "查看迁移详情",
"xpack.upgradeAssistant.overview.upgradeGuideLink": "查看升级指南",
"xpack.upgradeAssistant.overview.upgradeStepCloudLink": "在 Cloud 上升级",
"xpack.upgradeAssistant.overview.upgradeStepDescription": "解决所有紧急问题并确认您的应用程序就绪后,便可以升级到 Elastic 8.x。在升级之前,请确保再次备份您的数据。",
"xpack.upgradeAssistant.overview.upgradeStepDescriptionForCloud": "解决所有紧急问题并确认您的应用程序就绪后,便可以升级到 Elastic 8.x。在升级之前,请确保再次备份您的数据。在 Elastic Cloud 上升级您的部署。",
"xpack.upgradeAssistant.overview.upgradeStepLink": "了解详情",
"xpack.upgradeAssistant.overview.upgradeStepTitle": "升级到 Elastic 8.x",
"xpack.upgradeAssistant.overview.verifyChanges.calloutBody": "做出更改后,请重置计数器并继续监测,以确认您不再使用过时功能。",
"xpack.upgradeAssistant.overview.verifyChanges.calloutTitle": "自 {previousCheck} 以来出现 {warningsCount, plural, other {{warningsCount}}} 个弃用{warningsCount, plural, other {问题}} ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
DEPRECATION_LOGS_INDEX,
DEPRECATION_LOGS_SOURCE_ID,
DEPRECATION_LOGS_COUNT_POLL_INTERVAL_MS,
APPS_WITH_DEPRECATION_LOGS,
DEPRECATION_LOGS_ORIGIN_FIELD,
} from '../../../common/constants';

// Once the logs team register the kibana locators in their app, we should be able
Expand Down Expand Up @@ -171,9 +173,15 @@ describe('ES deprecation logs', () => {
component.update();

expect(exists('viewObserveLogs')).toBe(true);
expect(find('viewObserveLogs').props().href).toBe(
`/app/logs/stream?sourceId=${DEPRECATION_LOGS_SOURCE_ID}&logPosition=(end:now,start:'${MOCKED_TIME}')`
const sourceId = DEPRECATION_LOGS_SOURCE_ID;
const logPosition = `(end:now,start:'${MOCKED_TIME}')`;
const logFilter = encodeURI(
`(language:kuery,query:'not ${DEPRECATION_LOGS_ORIGIN_FIELD} : (${APPS_WITH_DEPRECATION_LOGS.join(
' or '
)})')`
);
const queryParams = `sourceId=${sourceId}&logPosition=${logPosition}&logFilter=${logFilter}`;
expect(find('viewObserveLogs').props().href).toBe(`/app/logs/stream?${queryParams}`);
});

test(`Doesn't show observability app link if infra app is not available`, async () => {
Expand All @@ -197,8 +205,18 @@ describe('ES deprecation logs', () => {

const decodedUrl = decodeURIComponent(find('viewDiscoverLogs').props().href);
expect(decodedUrl).toContain('discoverUrl');
['"language":"kuery"', '"query":"@timestamp+>'].forEach((param) => {
expect(decodedUrl).toContain(param);
[
'"language":"kuery"',
'"query":"@timestamp+>',
'filters=',
DEPRECATION_LOGS_ORIGIN_FIELD,
...APPS_WITH_DEPRECATION_LOGS,
].forEach((param) => {
try {
expect(decodedUrl).toContain(param);
} catch (e) {
throw new Error(`Expected [${param}] not found in ${decodedUrl}`);
}
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,29 @@ import { breadcrumbService } from '../../../public/application/lib/breadcrumbs';
import { dataPluginMock } from '../../../../../../src/plugins/data/public/mocks';
import { cloudMock } from '../../../../../../x-pack/plugins/cloud/public/mocks';

const data = dataPluginMock.createStartContract();
const dataViews = { ...data.dataViews };
const findDataView = (id: string) =>
Promise.resolve([
{
id,
title: id,
getFieldByName: jest.fn((name: string) => ({
name,
})),
},
]);

const servicesMock = {
api: apiService,
breadcrumbs: breadcrumbService,
data: dataPluginMock.createStartContract(),
data: {
...data,
dataViews: {
...dataViews,
find: findDataView,
},
},
};

// We'll mock these values to avoid testing the locators themselves.
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,35 @@
import { act } from 'react-dom/test-utils';

import { OverviewTestBed, setupOverviewPage } from '../overview.helpers';
import { setupEnvironment, kibanaVersion } from '../../helpers';
import { setupEnvironment } from '../../helpers';
import { systemIndicesMigrationStatus } from './mocks';

if (kibanaVersion.major >= 8 || kibanaVersion.minor > 16) {
describe('Overview - Migrate system indices - Flyout', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();
describe('Overview - Migrate system indices - Flyout', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();

beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(systemIndicesMigrationStatus);
beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(systemIndicesMigrationStatus);

await act(async () => {
testBed = await setupOverviewPage();
});

testBed.component.update();
await act(async () => {
testBed = await setupOverviewPage();
});

afterAll(() => {
server.restore();
});
testBed.component.update();
});

test('shows correct features in flyout table', async () => {
const { actions, table } = testBed;
afterAll(() => {
server.restore();
});

await actions.clickViewSystemIndicesState();
test('shows correct features in flyout table', async () => {
const { actions, table } = testBed;

const { tableCellsValues } = table.getMetaData('flyoutDetails');
await actions.clickViewSystemIndicesState();

expect(tableCellsValues.length).toBe(systemIndicesMigrationStatus.features.length);
expect(tableCellsValues).toMatchSnapshot();
});
const { tableCellsValues } = table.getMetaData('flyoutDetails');

expect(tableCellsValues.length).toBe(systemIndicesMigrationStatus.features.length);
expect(tableCellsValues).toMatchSnapshot();
});
} else {
test(`System indices migration is disabled for ${kibanaVersion.version}`, () => undefined);
}
});
Loading