Skip to content

[8.x] Remove TS reference from `stack_connectors` to `dashboard` (#208165)#208604

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-208165
Jan 28, 2025
Merged

[8.x] Remove TS reference from `stack_connectors` to `dashboard` (#208165)#208604
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-208165

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…08165)

## Summary

In elastic#159075 was introduced a reference from the `stack_connectors` plugin
to the `dashboard` plugin. This dependency was made so that the logic
creating the GenAI dashboard has proper typing for the dashboard SO
attributes type.

However, that is a bad isolation of concerns, introducing a high risk of
cyclic dependencies: the `dashboard` plugin, or any of its dependencies,
can't depend on `stack_connectors`, or any plugin depending on
stack_connectors.

This is especially problematic because of another bad design decision of
having `dashboard` depending on `observability_ai_assistant`, as it
increases the risk of circular dependencies.

This PR addresses it by removing the few usages we have of the dashboard
plugin's type in stack_connectors. Of course the ideal fix would be to
extract the type from the dashboard plugin instead, but those types
we're using here are inferred from config schema concrete objects,
making it complicated, so I went the pragmatic road even if it means
loosing a bit of type safety.

(cherry picked from commit 5b62617)
@kibanamachine kibanamachine merged commit b7f67ea into elastic:8.x Jan 28, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @pgayvallet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants