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

Migrate Beats Management UI to KP #65791

Merged
merged 10 commits into from
May 15, 2020
Merged

Conversation

joshdover
Copy link
Contributor

@joshdover joshdover commented May 7, 2020

Summary

This migrates the Beats Management UI to the new Management framework in the Kibana Platform.

Intentional behavioral changes:

  • The URL has changed from /app/kibana#management/beats_management to /app/kibana#management/beats/beats_management.
    • This is the enforced convention by the new Management framework.
    • This product is labelled as "beta" so I'm hoping this breaking URL change is acceptable.
  • Breadcrumbs
    • The breadcrumbs in the top nav now include the "Stack Management" crumb as the first item.
    • I fixed a bug where the breadcrumb for the root of the app would point to #/management/beats_managementundefined to #/management/beats/beats_management

Testing

This UI has no automated tests at all ⚠️ 😢 (functional or units) so this will require a good amount of manual QA. Unfortunately, I'm not too familiar with the idiosyncrasies of this UI, however comparing to master, this appears to be working. I will recruit a member of the Ingest Management team to assist with testing this PR.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@@ -53,7 +53,7 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = ({ title, path, parentBread
{context => (
<BreadcrumbManager
text={title}
href={`#${BASE_PATH}${path}`}
href={path ? `#${BASE_PATH}${path}` : `#${BASE_PATH}`}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was broken before and would result in URLs like #/management/beats_managementundefined

services.I18nContext = core.i18n.Context;
services.setBreadcrumbs = params.setBreadcrumbs;
services.dataStart = plugins.data;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the "stateful module" hack here to avoid wiring up all the services into the deeply nested components. Seems an appropriate time to use this since this product is not currently in active development.

@@ -9,4 +9,4 @@ export { INDEX_NAMES } from './index_names';
export { PLUGIN } from './plugin';
export { LICENSES, REQUIRED_LICENSES, REQUIRED_ROLES } from './security';
export { TABLE_CONFIG } from './table';
export const BASE_PATH = '/management/beats_management';
export const BASE_PATH = '/management/beats/beats_management';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way the new Management plugin works, this is unavoidable. This PR will change the URL for this UI, however since it's marked "beta" this should be fine.

@joshdover joshdover added Feature:beats-cm Feature:NP Migration Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0 labels May 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@joshdover joshdover added the release_note:skip Skip the PR/issue when compiling release notes label May 10, 2020
@joshdover joshdover marked this pull request as ready for review May 10, 2020 19:59
@@ -0,0 +1,184 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was moved, but I did delete significant amount of code here around mounting and interfacing with Angular

@justinkambic
Copy link
Contributor

@joshdover is the goal here to migrate the client first and move the server/common/etc in a follow-up?

@joshdover
Copy link
Contributor Author

@joshdover is the goal here to migrate the client first and move the server/common/etc in a follow-up?

Correct. We need to migrate the UI now in order to unblock migrating the rest of the Management UI that this plugs into. Server will be done in a different release in order to unblock removing the legacy system.

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Code changes LGTM. Had a few questions but the app seems to load up ok and I don't see any red flags.

@ph mentioned he'd review the functionality. FWIW I loaded up the app and tried enrolling a beat, but filebeat/metricbeat seem to reject the enroll command required to register beats. I haven't used these features in quite some time so it's probably better if someone familiar with those beats reviews this functionality anyway.

Please ping me if I can be helpful with the rest of this migration.

settings: this.config,
};
} catch (e) {
throw new Error(`Unexpected data structure from xpackInfoService, ${JSON.stringify(e)}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

don't think code in try can throw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is valid since it's inside the catch block. Also this was from the previous implementation, I didn't change anything here except how it reads the license.

}

public setUISettings = (key: string, value: any) => {
this.adapterService.callOrBuffer(({ config }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a bridge to the legacy angular code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, I didn't touch this (just moved). I'll double check though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly it looks like this code is just broken (and probably has been for some time). The adapter service buffers calls until its $get method is called, which I cannot find any place where that is called in the legacy implementation.

Not sure if worth fixing this now or not. I'm just too afraid of breaking things here without any tests.

@joshdover
Copy link
Contributor Author

@ph mentioned he'd review the functionality. FWIW I loaded up the app and tried enrolling a beat, but filebeat/metricbeat seem to reject the enroll command required to register beats. I haven't used these features in quite some time so it's probably better if someone familiar with those beats reviews this functionality anyway.

I believe it only works on 7.x builds? (at least that's what I was using and it worked fine with filebeat 7.3.2).

@justinkambic
Copy link
Contributor

I believe it only works on 7.x builds? (at least that's what I was using and it worked fine with filebeat 7.3.2).

Oh ok, that makes sense. I'll re-try this.

@joshdover
Copy link
Contributor Author

@elasticmachine merge upstream

@justinkambic
Copy link
Contributor

I performed another smoke test of this patch and was able to configure a Filebeat to watch logs on my system.

@joshdover joshdover requested a review from ph May 13, 2020 22:05
@joshdover
Copy link
Contributor Author

@elasticmachine merge upstream

@joshdover
Copy link
Contributor Author

Failing tests are being skipped in #66599

Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

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

LGTM, I have tested the enroll flow, create configuration, edit configuration, listing all works for both metricbeat and filebeat.

👍

@joshdover
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@joshdover joshdover merged commit 62e8214 into elastic:master May 15, 2020
@joshdover joshdover deleted the beats-cm/migrate-ui branch May 15, 2020 16:22
joshdover added a commit to joshdover/kibana that referenced this pull request May 15, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 15, 2020
* master: (191 commits)
  [Maps] Get number of categories from palette (elastic#66454)
  move oss features registration to KP (elastic#66524)
  [kbn/plugin-helpers] typescript-ify (elastic#66513)
  Add kibana-operations as codeowners for .ci/es-snapshots and vars/ (elastic#66746)
  FTR: move basic services under common folder (elastic#66563)
  Migrate Beats Management UI to KP (elastic#65791)
  [CI] Add 20 minutes to overall build timeout
  lint import from restricted zones for export exressions (elastic#66588)
  [SIEM][Detection Engine] Add validation for Rule Actions (elastic#63332)
  KP plugins shouldn't need package.json (elastic#66654)
  Replace agent metrics link with the new one (elastic#66632)
  [CI] Add one retry to setup step (elastic#66638)
  [CI] Add slack alerts to tracked branch jobs, change default channel, change formatting (elastic#66580)
  [docLinks] Add docLinks to CoreSetup. (elastic#66631)
  [DOCS] Rename monitoring collection from internal to legacy (elastic#65781)
  unskip newsfeed tests (elastic#66562)
  [NP] Migrate uiSettings owned by Kibana app (elastic#64321)
  [ML] Functional tests - stabilize typing in DFA mml input (elastic#66706)
  [Map] return bounding box for static feature collection without joins (elastic#66607)
  remove trailing slash in graph sample data links (elastic#66358)
  ...
jloleysens added a commit that referenced this pull request May 18, 2020
…ine-editor

* 'master' of github.com:elastic/kibana: (157 commits)
  [ML] fix url assertion (#66850)
  Skip failing lens test(s). #66779
  [SOM] Preserve saved object references when saving the object (#66584)
  Use ES API from start contract (#66157)
  Reorganize Management apps into Ingest, Data, Alerts and Insights, Security, Kibana, and Stack groups (#65796)
  [Uptime] Fix flaky navigation to certs page in tests (#66806)
  [Maps] Do not check count for blended layers when layer is not visible (#66460)
  [SIEM] Fixes glob patterns from directory changes recently for GraphQL
  chore(NA): bump static-fs to 1.0.2 (#66775)
  [Maps] Handle cross cluster index _settings resp (#66797)
  [SIEM][Lists] Adds 90% of the REST API and client API for exception lists and exception items
  allow any type for customResponseHeaders config (#66689)
  [APM] Disable map layout animation (#66763)
  [ML] Add linking to dataframe from job management tab (#65778)
  [Maps] Get number of categories from palette (#66454)
  move oss features registration to KP (#66524)
  [kbn/plugin-helpers] typescript-ify (#66513)
  Add kibana-operations as codeowners for .ci/es-snapshots and vars/ (#66746)
  FTR: move basic services under common folder (#66563)
  Migrate Beats Management UI to KP (#65791)
  ...

# Conflicts:
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx
#	x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:beats-cm Feature:NP Migration release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants