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] Align code between branches #91862

Merged
merged 9 commits into from
Feb 24, 2021

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Feb 18, 2021

This PR attempts to align the Upgrade Assistant code between master and 7.x to improve DX and the backporting process.

Related to #78923.

How to review

It may be helpful to review the changes incrementally by commit.

The steps I took:

  1. Merged all 7.x code into master. (2e4163d)
  2. Removed code that is no longer applicable. These changes were largely concentrated around APM-related code that was specific to the 6-7 upgrade. The APM team confirmed this is no longer applicable, although there will likely need to be new APM-specific logic in UA for the 7-8 upgrade (TBD). I also removed index setting fixes to beats indices, which is also specific to the 6-7 upgrade. (2e2e92f)
  3. Added conditional logic for any code remaining that is still pertinent to the 7-8 upgrade, but will be obsolete for the 8-9 upgrade. This includes conditional logic for the tests as well. (bc7ec3b)

There's not a great way to manually test this on master, as most of the new logic is behind the v7 flag. I plan to do more thorough testing on the backport PR. For the review, I'm mainly looking for feedback on the implementation and verification (to the best of your ability) that nothing was removed inadvertently that would still be applicable for the 8.0 upgrade.

@alisonelizabeth alisonelizabeth added chore v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Upgrade Assistant v7.13.0 labels Feb 18, 2021
@@ -347,6 +347,11 @@ export const reindexServiceFactory = (
await esClient.indices.open({ index: indexName });
}

const flatSettings = await actions.getFlatSettings(indexName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me why this was removed on master, but it seems like it is a valid check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point! It may have been removed in error.

@alisonelizabeth alisonelizabeth marked this pull request as ready for review February 18, 2021 18:57
@alisonelizabeth alisonelizabeth requested a review from a team as a code owner February 18, 2021 18:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really solid @alisonelizabeth ! Thanks for bringing these in line, this will greatly improve DX on upgrade assistant moving forward 🍻

* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import SemVer from 'semver/classes/semver';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this help with bundle size? Just curious ☺️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! I think I copied this from elsewhere in Kibana 😅 . I'd have to go back and compare to see how it affects the bundle size.

Comment on lines +148 to +153
id="xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail"
defaultMessage="Mapping types are no longer supported in 8.0. This index mapping does not use the
default type name, {defaultType}. Ensure no application code or scripts rely on a different type."
values={{
defaultType: <EuiCode>_doc</EuiCode>,
}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new copy? If it is, it looks good to me, but it could be worth pulling in someone from esdocs@ too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's slightly modified from 7.x 😄. I'm going to hold off on a copy review for now, as I think this UI will change as part of the redesign.

@@ -177,4 +179,24 @@ describe('getReindexWarnings', () => {
})
).toEqual([]);
});

if (mockKibanaSemverVersion.major === 7) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how the test harness is being set up, but it could be a better pattern to create a nested describe blocks for the 7 cases and 8 cases with their own test setups. WDYT?

@@ -347,6 +347,11 @@ export const reindexServiceFactory = (
await esClient.indices.open({ index: indexName });
}

const flatSettings = await actions.getFlatSettings(indexName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point! It may have been removed in error.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
upgradeAssistant 133.4KB 133.9KB +498.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alisonelizabeth alisonelizabeth merged commit fe6bd2e into elastic:master Feb 24, 2021
@alisonelizabeth alisonelizabeth deleted the ua/align_branches branch February 24, 2021 21:15
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 25, 2021
* master: (38 commits)
  Fixes Cypress flake by adding pipe, click, and should (elastic#92762)
  [Discover] Fix filtering selected sidebar fields (elastic#91828)
  [ML] Fixes positions of calendar arrow buttons in start datafeed modal (elastic#92625)
  [dev/build_ts_refs] check that commit in outDirs matches mergeBase (elastic#92513)
  add dep on `@kbn/config` so it is built first
  [Expressions] [Lens] Add id and copyMetaFrom arg to mapColumn fn + add configurable onError argument to math fn (elastic#90481)
  [Lens] Fix Workspace hidden when using Safari (elastic#92616)
  [Lens] Fixes vertical alignment validation messages (elastic#91878)
  forbid x-elastic-product-origin header in elasticsearch configuration (elastic#92359)
  [Security Solution][Detections] Set default indicator path to reduce friction with new filebeat modules (elastic#92081)
  [ILM][Accessibility] Added A11y test for ILM new policy form. (elastic#92570)
  [Security Solution][Exceptions] - Fixes exceptions builder UI where invalid values can cause overwrites of other values (elastic#90634)
  Automatically generated Api documentation (elastic#86232)
  Increase index pattern select limit to 1000 (elastic#92093)
  [core.logging] Add RewriteAppender for filtering LogMeta. (elastic#91492)
  [Security Solution][Detection Rules] Update prebuilt rule threats to match schema (elastic#92281)
  [Security Solutions][Detection Engine] Fixes bug with not being able to duplicate indicator matches (elastic#92565)
  [Dashboard] Export appropriate references from byValue panels (elastic#91567)
  [Upgrade Assistant] Align code between branches (elastic#91862)
  [Security Solution][Case] Fix alerts push (elastic#91638)
  ...
alisonelizabeth added a commit that referenced this pull request Feb 25, 2021
* [Upgrade Assistant] Align code between branches (#91862)

# Conflicts:
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
#	x-pack/plugins/upgrade_assistant/common/types.ts
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs.test.tsx
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/checkup_tab.test.tsx
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/index_table.tsx
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/__snapshots__/warning_step.test.tsx.snap
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warning_step.test.tsx
#	x-pack/plugins/upgrade_assistant/public/application/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx
#	x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts
#	x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts
#	x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts
#	x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts

* fix backport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Upgrade Assistant release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants