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

Sustainable Kibana Architecture: Remove dependencies between plugins that are related by _App Links_ #199492

Merged

Conversation

gsoldevila
Copy link
Contributor

@gsoldevila gsoldevila commented Nov 8, 2024

Summary

This PR introduces a Core API to check whether a given application has been registered.
Plugins can use this for their App Links, without having to depend on the referenced plugin(s) anymore.

This way, we can get rid of some inter-solution dependencies, and categorise plugins more appropriately.

@gsoldevila gsoldevila added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 8, 2024
@gsoldevila gsoldevila self-assigned this Nov 8, 2024
@@ -16,7 +16,7 @@ export const SELECTED_CONNECTOR_LOCAL_STORAGE_KEY =

export function SearchConnectorTab() {
const { application } = useKibana().services;
const url = application.getUrlForApp('enterprise_search', { path: '/content/connectors' });
const url = application.getUrlForApp('enterpriseSearch', { path: '/content/connectors' });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Am I wrong or this URL was broken?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This was briefly broken last week in the O11y Solution nav because enterprise search was disabled, but we fixed that and the link worked when I checked. But you're right that the appId should be enterpriseSearch so that is very confusing 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I confirm this is fixed externally to this PR too (noticed when rebasing).

@@ -16,7 +16,7 @@ export const SELECTED_CONNECTOR_LOCAL_STORAGE_KEY =

export function SearchConnectorTab() {
const { application } = useKibana().services;
const url = application.getUrlForApp('enterprise_search', { path: '/content/connectors' });
const url = application.getUrlForApp('enterpriseSearch', { path: '/content/connectors' });
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -114,6 +114,14 @@ export interface ApplicationStart {
*/
navigateToUrl(url: string, options?: NavigateToUrlOptions): Promise<void>;

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it might be useful to mention in the tsdocs of navigateToApp something like:

If a plugin is disabled any applications it registers won't be available either. Before rendering a UI element that a user could use to navigate to another application, first check if the destination application is actually available using the isAppRegistered API.

@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from 0e6742f to 9ef9cfa Compare November 9, 2024 14:43
@gsoldevila gsoldevila marked this pull request as ready for review November 9, 2024 14:44
@gsoldevila gsoldevila requested review from a team as code owners November 9, 2024 14:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Nov 9, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

Copy link
Contributor

github-actions bot commented Nov 9, 2024

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from 1771ae8 to 6c57443 Compare November 9, 2024 19:44
@gsoldevila gsoldevila requested a review from a team as a code owner November 9, 2024 19:44
@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from 6c57443 to cb54b2c Compare November 10, 2024 07:56
@gsoldevila gsoldevila requested a review from a team as a code owner November 10, 2024 07:56
Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

response-ops ok 👍

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Changes in Data Discovery mocks LGTM

@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from cb54b2c to 29177a9 Compare November 11, 2024 10:03
@gsoldevila gsoldevila requested a review from a team as a code owner November 11, 2024 10:03
// Could be categorised as Search in the future, but it currently needs to run in Observability too
"group": "platform",
"visibility": "shared",
"group": "search",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I believe I went too far, I made enterpriseSearch part of "Search" solution only.

This will make observability-ai-assistant-management menu entry totally useless when we have independent solution builds.

However, if we rollback the changes, we have a domino effect that forces us to expose searchPlayground as platform/shared too.

@sphilipse WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think we need to make this platform/shared for now. Exposing playground as platform/shared is fine for now IMO. We have open tickets to separate this stuff and implement better RBAC which will eventually fix all of these problems. (we need to do that for our ent-search deprecation anyway)

Copy link
Member

Choose a reason for hiding this comment

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

This will make observability-ai-assistant-management menu entry totally useless when we have independent solution builds.

Sorry, what does this mean?

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 observability-ai-assistant-management has a link to the searchPlayground.
This creates a dependency O11y=>Search that we are solving my making searchPlayground platform/shared for now.

I rollbacked the change at the root of this discussion in 0aa726b

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dgieselaar could you PTAL? TIA

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, we can keep the conflicting search plugins as search/private for now.
These plugins need to be refactored and external dependencies issues addressed before solution-specific builds.

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Fleet change 🚀

@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from 29177a9 to dbc531b Compare November 12, 2024 08:29
@gsoldevila gsoldevila changed the title Sustainable Kibana Architecture: Make enterprise-search part of Search solution Sustainable Kibana Architecture: Remove dependencies between plugins that are related by _App Links_ Nov 12, 2024
@gsoldevila gsoldevila force-pushed the kbn-team-1079-links-to-apps-are-not-deps branch from dbc531b to eba5431 Compare November 12, 2024 09:22
@gsoldevila gsoldevila enabled auto-merge (squash) November 13, 2024 15:09
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 14, 2024

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [f4af267]

History

cc @gsoldevila

@gsoldevila gsoldevila merged commit ad56ec5 into elastic:main Nov 14, 2024
31 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11836591000

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…that are related by _App Links_ (elastic#199492)

## Summary

This PR introduces a Core API to check whether a given application has
been registered.
Plugins can use this for their _App Links_, without having to depend on
the referenced plugin(s) anymore.

This way, we can get rid of some inter-solution dependencies, and
categorise plugins more appropriately.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ad56ec5)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 14, 2024
…ugins that are related by _App Links_ (#199492) (#200159)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Sustainable Kibana Architecture: Remove dependencies between plugins
that are related by _App Links_
(#199492)](#199492)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-14T11:49:21Z","message":"Sustainable
Kibana Architecture: Remove dependencies between plugins that are
related by _App Links_ (#199492)\n\n## Summary\r\n\r\nThis PR introduces
a Core API to check whether a given application has\r\nbeen
registered.\r\nPlugins can use this for their _App Links_, without
having to depend on\r\nthe referenced plugin(s) anymore.\r\n\r\nThis
way, we can get rid of some inter-solution dependencies,
and\r\ncategorise plugins more
appropriately.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"ad56ec5f1a838486d9b38c2d5aa92bbf77e127a3","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:prev-minor","Team:Obs
AI Assistant","ci:project-deploy-observability"],"title":"Sustainable
Kibana Architecture: Remove dependencies between plugins that are
related by _App
Links_","number":199492,"url":"https://github.com/elastic/kibana/pull/199492","mergeCommit":{"message":"Sustainable
Kibana Architecture: Remove dependencies between plugins that are
related by _App Links_ (#199492)\n\n## Summary\r\n\r\nThis PR introduces
a Core API to check whether a given application has\r\nbeen
registered.\r\nPlugins can use this for their _App Links_, without
having to depend on\r\nthe referenced plugin(s) anymore.\r\n\r\nThis
way, we can get rid of some inter-solution dependencies,
and\r\ncategorise plugins more
appropriately.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"ad56ec5f1a838486d9b38c2d5aa92bbf77e127a3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199492","number":199492,"mergeCommit":{"message":"Sustainable
Kibana Architecture: Remove dependencies between plugins that are
related by _App Links_ (#199492)\n\n## Summary\r\n\r\nThis PR introduces
a Core API to check whether a given application has\r\nbeen
registered.\r\nPlugins can use this for their _App Links_, without
having to depend on\r\nthe referenced plugin(s) anymore.\r\n\r\nThis
way, we can get rid of some inter-solution dependencies,
and\r\ncategorise plugins more
appropriately.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"ad56ec5f1a838486d9b38c2d5aa92bbf77e127a3"}}]}]
BACKPORT-->

Co-authored-by: Gerard Soldevila <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…that are related by _App Links_ (elastic#199492)

## Summary

This PR introduces a Core API to check whether a given application has
been registered.
Plugins can use this for their _App Links_, without having to depend on
the referenced plugin(s) anymore.

This way, we can get rid of some inter-solution dependencies, and
categorise plugins more appropriately.

---------

Co-authored-by: kibanamachine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…that are related by _App Links_ (elastic#199492)

## Summary

This PR introduces a Core API to check whether a given application has
been registered.
Plugins can use this for their _App Links_, without having to depend on
the referenced plugin(s) anymore.

This way, we can get rid of some inter-solution dependencies, and
categorise plugins more appropriately.

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Obs AI Assistant Observability AI Assistant v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants