-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[9.0][Security Assistant] Add space id provider #225033
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
077d05d
add space id provider
angorayc 53e3255
unit tests
angorayc 9db92d6
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine cb16778
update unit tests
angorayc 829f0b8
unit tests
angorayc 856f7b1
unit tests
angorayc 270b0cb
align code with main
angorayc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to modify this test file so that it does not mock AssistantSettingsManagement? Alternatively, it would be great if we could add a test that would fail if is removed by accident in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could try to do that by wrapping assistant settings management component into the
AssistantSpaceIdProviderwithin the plugin setup if we have access to active space id from there https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/plugin.tsx#L214. This way we would avoid usinguseSpaceIdhook completely.But if that is too much work (+ I guess this is an urgent fix), I think we can also go with the current solution and update it later if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the implementation on the main branch:
AssistantSpaceIdProvider was introduced but was accidentally dropped during its 9.0 backport
x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.tsx:
https://github.com/elastic/kibana/pull/221566/files#diff-09e012f07b9ef5bd3559d3e05261436872407428a0fa8d1e2b4651b8f887cabc
I applied the same fix for its test file but some tests failed, I'm still trying to figure out:
x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.test.tsx:
https://github.com/elastic/kibana/pull/221566/files#diff-14290c240aafc6f614c221dbde3b575f627f0ab8484b7186ed4d8e029fc9c3b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Thank you for the fix - tested locally and it worked. Will leave approval to @KDKHD
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found another line dropped during the backport: https://github.com/elastic/kibana/pull/221566/files#diff-09e012f07b9ef5bd3559d3e05261436872407428a0fa8d1e2b4651b8f887cabcR16
I'd keep
AssistantSettingsManagementto align with the code with the main branch:https://github.com/elastic/kibana/pull/221566/files#diff-14290c240aafc6f614c221dbde3b575f627f0ab8484b7186ed4d8e029fc9c3b7
and added scenarios for both space id is available and unavailable.
I'll also re-think the error display for the
AssistantSpaceIdProviderand try not to let it blocks the UI (I'll do the enhancement in a new PR and do the code change from the main branch).