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

Upgrade assistant - Phase 1 #25168

Merged
merged 103 commits into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from 102 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
dfbca71
Get basic scaffolding working
joshdover Nov 5, 2018
6272b61
Wire up cluster checkup data
joshdover Nov 6, 2018
96fee8b
Add types for elasticsearch plugin
joshdover Nov 8, 2018
c85ea7b
Implement basics of checkup tab
joshdover Nov 8, 2018
bc68417
Update style of deprecations
joshdover Nov 8, 2018
c837c2d
Add copy and reload button to checkup
joshdover Nov 8, 2018
35b8fa7
Add filtering by warning level
joshdover Nov 8, 2018
8850f0c
Add deprecation logging tab
joshdover Nov 9, 2018
2e4cdac
Copy updates and cleanup
joshdover Nov 9, 2018
6b4ef02
Type cleanup
joshdover Nov 9, 2018
056cf1f
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 13, 2018
3f46e59
Move deprecation logging to overview tab
joshdover Nov 13, 2018
014f67b
Make filters togglable
joshdover Nov 13, 2018
2d37317
Move sections into tabs and add support for grouping
joshdover Nov 14, 2018
dec8827
Cleanup and add clearer labels
joshdover Nov 14, 2018
f463bf2
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 14, 2018
f104f68
Use tables for message grouping
joshdover Nov 15, 2018
a952bb2
Cleanup and small fixes
joshdover Nov 19, 2018
f003202
Allow console to load relative URLs
joshdover Nov 20, 2018
ac3b633
Add reindex in console button to reindex tasks
joshdover Nov 20, 2018
05c0419
Merge documentation UI and uiButtons
joshdover Nov 20, 2018
f2affaa
Fix tests
joshdover Nov 20, 2018
ce840cf
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 20, 2018
2a48c1e
Filter bar tweaks
joshdover Nov 21, 2018
0bbc132
Filter out index settings that can't be set
joshdover Nov 21, 2018
e8fa376
Fix types
joshdover Nov 21, 2018
35b6436
Add tests for deprecation_logging
joshdover Nov 21, 2018
8960f21
Add tests for reindex templates
joshdover Nov 26, 2018
8210908
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 26, 2018
cca12f8
Make KibanaConfig generic
joshdover Nov 26, 2018
c71a49d
Simplify integration test
joshdover Nov 26, 2018
2e42ce9
Finish backend unit tests
joshdover Nov 26, 2018
9ac3400
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 27, 2018
9f3f375
Fixup types
joshdover Nov 27, 2018
678350f
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Nov 28, 2018
e684f13
Fix uiButton updating for reindex items
joshdover Nov 28, 2018
51a7f89
Fixed background color stretching
cchaos Nov 27, 2018
faca627
Pulling tabs out and re-ordering filter buttons
cchaos Nov 27, 2018
87ddc3d
Making accordions more item-list like
cchaos Nov 27, 2018
f7cf82d
Turned Healths into Badges
cchaos Nov 28, 2018
6d25d9b
Fix overflow issue
cchaos Nov 28, 2018
65cebe8
Optional filter and expand/collapse controls
cchaos Nov 28, 2018
4e0c998
Reorganizing
cchaos Nov 28, 2018
3fe14fe
Putting `Deprecation logging` in a `EuiDescribedFormGroup`
cchaos Nov 28, 2018
89f63ca
Added some stats, empty prompts, and all clear prompt
cchaos Nov 29, 2018
666a284
Added docs link
cchaos Nov 29, 2018
3e81185
Cleaned up sass files
cchaos Nov 29, 2018
30207df
Revert changes to fake_deprecations
cchaos Nov 29, 2018
bcb8732
Merge pull request #25 from cchaos/joshdover-upgrade-checkup
joshdover Dec 3, 2018
08b4de6
Update blacklisted settings
joshdover Nov 28, 2018
80e659b
wip
joshdover Nov 29, 2018
55a3f62
Move data fetching and tab control
joshdover Dec 3, 2018
984c045
Wire up overview summary
joshdover Dec 3, 2018
0b43077
Cleanup docs/uiButtons + move actions to index table
joshdover Dec 3, 2018
290f761
Add expand/collapse all functionality
joshdover Dec 3, 2018
d34ba14
Wire up search box
joshdover Dec 3, 2018
87c2270
Wire up severity indicators
joshdover Dec 3, 2018
830b658
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 4, 2018
44a8479
Fix types
joshdover Dec 4, 2018
504157a
Round out functional tests
joshdover Dec 4, 2018
76092e8
Fix fake data
joshdover Dec 5, 2018
713d089
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 5, 2018
a300b5c
Remove info deprecation level
joshdover Dec 5, 2018
9619480
Fix extra space on cluster tab control bar
joshdover Dec 5, 2018
6131ce6
Cleanup code and localize majority of UI controls
joshdover Dec 5, 2018
516ffd3
Change overview tab to steps layout
joshdover Dec 6, 2018
cc168fd
Update copy
joshdover Dec 6, 2018
fc948ed
Localize overview tab
joshdover Dec 7, 2018
6b5cc41
Complete localization of checkup tabs
joshdover Dec 7, 2018
ec222b7
Make ES version dynamic based on branch
joshdover Dec 7, 2018
95ea08b
Add pagination to checkup tabs
joshdover Dec 7, 2018
870b1a9
Rename checkup -> assistant
joshdover Dec 7, 2018
ca3e70b
Cleanup filter and group by bars
joshdover Dec 7, 2018
09b7140
WIP UI unit tests
joshdover Dec 7, 2018
ed73bac
Copy tweaks
joshdover Dec 10, 2018
051a424
Fix i18n formatting issues
joshdover Dec 10, 2018
4b2495c
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 10, 2018
a2609b4
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 10, 2018
8accf12
Update tests for copy
joshdover Dec 10, 2018
1161d9f
Add tests for remaining UI
joshdover Dec 10, 2018
167b744
Fix pagination w/ filter changes + table button color
joshdover Dec 11, 2018
633df15
Small cleanup
joshdover Dec 11, 2018
cf0ab7e
Add reindex button to old index deprecations
joshdover Dec 11, 2018
224ec00
Add shrunken indices setting to copy settings blacklist for #18469
joshdover Dec 11, 2018
b367b93
Add next steps to overview tab + update copy
joshdover Dec 12, 2018
affd460
Remove usage of migration assistance API
joshdover Dec 12, 2018
da2b2cd
Use all/critical toggle for filter buttons
joshdover Dec 12, 2018
0077a50
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 12, 2018
c03ae9b
Cloud upgrade copy
joshdover Dec 12, 2018
d92e2ad
Translate reindex button
joshdover Dec 12, 2018
30d592c
Remove hacked EUI type
joshdover Dec 13, 2018
98a6f63
Show incomplete banner on all tabs
joshdover Dec 13, 2018
a72f3b9
Update copy for waiting for next version
joshdover Dec 13, 2018
6d7c35f
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 13, 2018
605d62f
Review comments
joshdover Dec 14, 2018
a45b0e5
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 14, 2018
ecfa180
Update deprecation level type
joshdover Dec 14, 2018
c386377
Update checkup tab snapshots
joshdover Dec 14, 2018
b620615
Remove dependencies on types from #25168
joshdover Dec 17, 2018
42ddd6e
Merge remote-tracking branch 'upstream/master' into upgrade-checkup
joshdover Dec 17, 2018
338299c
Use types from new global type defs
joshdover Dec 17, 2018
685d336
Remove 'Reindex in Console' button
joshdover Dec 18, 2018
e056575
Remove unused variable
joshdover Dec 18, 2018
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
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"xpack.searchProfiler": "x-pack/plugins/searchprofiler",
"xpack.security": "x-pack/plugins/security",
"xpack.spaces": "x-pack/plugins/spaces",
"xpack.upgradeAssistant": "x-pack/plugins/upgrade_assistant",
"xpack.watcher": "x-pack/plugins/watcher"
},
"exclude": [
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/elasticsearch/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export interface CallClusterWithRequest {
<T = any>(
request: Request,
endpoint: string,
clientParams: GenericParams,
clientParams: any,
options?: CallClusterOptions
): Promise<T>;
}
Expand Down
2 changes: 2 additions & 0 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { kueryAutocomplete } from './plugins/kuery_autocomplete';
import { canvas } from './plugins/canvas';
import { infra } from './plugins/infra';
import { rollup } from './plugins/rollup';
import { upgradeAssistant } from './plugins/upgrade_assistant';

module.exports = function (kibana) {
return [
Expand Down Expand Up @@ -57,5 +58,6 @@ module.exports = function (kibana) {
kueryAutocomplete(kibana),
infra(kibana),
rollup(kibana),
upgradeAssistant(kibana),
];
};
2 changes: 2 additions & 0 deletions x-pack/plugins/__mocks__/ui/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function getInjected(key) {
return 'apm*';
case 'mlEnabled':
return true;
case 'isCloudEnabled':
return false;
default:
throw new Error(`Unexpected config key: ${key}`);
}
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/infra/types/eui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ declare module '@elastic/eui' {
rel?: string;
target?: string;
type?: string;
hasActiveFilters?: boolean;
numFilters?: number;
};
export const EuiFilterButton: React.SFC<EuiFilterButtonProps>;

Expand Down
14 changes: 14 additions & 0 deletions x-pack/plugins/upgrade_assistant/common/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import pkg from '../../../package.json';

// Extract version information
const currentVersionNum = pkg.version as string;
const matches = currentVersionNum.match(/^([1-9]+)\.([0-9]+)\.([0-9]+)$/)!;

export const CURRENT_MAJOR_VERSION = matches[1];
export const NEXT_MAJOR_VERSION = (parseInt(CURRENT_MAJOR_VERSION, 10) + 1).toString();
32 changes: 32 additions & 0 deletions x-pack/plugins/upgrade_assistant/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Server } from 'hapi';
import Joi from 'joi';
import { resolve } from 'path';
import { initServer } from './server';

export function upgradeAssistant(kibana: any) {
return new kibana.Plugin({
id: 'upgrade_assistant',
require: ['elasticsearch'],
uiExports: {
managementSections: ['plugins/upgrade_assistant'],
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
},
publicDir: resolve(__dirname, 'public'),

config() {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default();
},

init(server: Server) {
// Add server routes and initialize the plugin here
initServer(server);
},
});
}
4 changes: 4 additions & 0 deletions x-pack/plugins/upgrade_assistant/public/_app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
upgrade-assistant {
flex-grow: 1;
background-color: $euiColorLightestShade;
}
36 changes: 36 additions & 0 deletions x-pack/plugins/upgrade_assistant/public/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { EuiPage, EuiPageBody, EuiPageHeader, EuiPageHeaderSection, EuiTitle } from '@elastic/eui';
import { FormattedMessage, injectI18nProvider } from '@kbn/i18n/react';

import { NEXT_MAJOR_VERSION } from '../common/version';
import { UpgradeAssistantTabs } from './components/tabs';

export const RootComponentUI: React.StatelessComponent = () => (
<EuiPage restrictWidth data-test-subj="upgradeAssistantRoot">
<EuiPageBody>
<EuiPageHeader>
<EuiPageHeaderSection>
<EuiTitle size="l">
<h1>
<FormattedMessage
id="xpack.upgradeAssistant.appTitle"
defaultMessage="{version} Upgrade Assistant"
values={{ version: `${NEXT_MAJOR_VERSION}.0` }}
/>
</h1>
</EuiTitle>
</EuiPageHeaderSection>
</EuiPageHeader>
<UpgradeAssistantTabs />
</EuiPageBody>
</EuiPage>
);

export const RootComponent = injectI18nProvider(RootComponentUI);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './tabs/checkup/index';
@import './tabs/overview/index';
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { EuiCallOut, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { CURRENT_MAJOR_VERSION, NEXT_MAJOR_VERSION } from '../../common/version';

export const LatestMinorBanner: React.StatelessComponent = () => (
<EuiCallOut
title={
<FormattedMessage
id="xpack.upgradeAssistant.tabs.incompleteCallout.calloutTitle"
defaultMessage="Issues list might be incomplete"
/>
}
color="warning"
iconType="help"
>
<p>
<FormattedMessage
id="xpack.upgradeAssistant.tabs.incompleteCallout.calloutBody.calloutDetail"
defaultMessage="The complete list of {breakingChangesDocButton} in Elasticsearch {nextEsVersion}
will be available in the final {currentEsVersion} minor release. When the list
is complete, this warning will go away."
values={{
breakingChangesDocButton: (
<EuiLink
href="https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes.html"
target="_blank"
>
<FormattedMessage
id="xpack.upgradeAssistant.tabs.incompleteCallout.calloutBody.breackingChangesDocButtonLabel"
defaultMessage="deprecations and breaking changes"
/>
</EuiLink>
),
nextEsVersion: `${NEXT_MAJOR_VERSION}.x`,
currentEsVersion: `${CURRENT_MAJOR_VERSION}.x`,
}}
/>
</p>
</EuiCallOut>
);
61 changes: 61 additions & 0 deletions x-pack/plugins/upgrade_assistant/public/components/tabs.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { mountWithIntl } from 'test_utils/enzyme_helpers';

jest.mock('axios', () => ({
get: jest.fn(),
}));

import { UpgradeAssistantTabs } from './tabs';
import { LoadingState } from './types';

import axios from 'axios';
import { OverviewTab } from './tabs/overview';

// Used to wait for promises to resolve and renders to finish before reading updates
const promisesToResolve = () => new Promise(resolve => setTimeout(resolve, 0));

describe('UpgradeAssistantTabs', () => {
test('renders loading state', async () => {
// @ts-ignore
axios.get.mockReturnValue(
new Promise(resolve => {
/* never resolve */
})
);
const wrapper = mountWithIntl(<UpgradeAssistantTabs />);
// Should pass down loading status to child component
expect(wrapper.find(OverviewTab).prop('loadingState')).toEqual(LoadingState.Loading);
});

test('successful data fetch', async () => {
// @ts-ignore
axios.get.mockResolvedValue({
data: {
cluster: [],
indices: [],
},
});
const wrapper = mountWithIntl(<UpgradeAssistantTabs />);
expect(axios.get).toHaveBeenCalled();
await promisesToResolve();
wrapper.update();
// Should pass down success status to child component
expect(wrapper.find(OverviewTab).prop('loadingState')).toEqual(LoadingState.Success);
});

test('network failure', async () => {
// @ts-ignore
axios.get.mockRejectedValue(new Error(`oh no!`));
const wrapper = mountWithIntl(<UpgradeAssistantTabs />);
await promisesToResolve();
wrapper.update();
// Should pass down error status to child component
expect(wrapper.find(OverviewTab).prop('loadingState')).toEqual(LoadingState.Error);
});
});
Loading