forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Assistant cypress #18
Closed
Closed
Conversation
This file contains 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
PR Summary
|
stephmilovic
requested review from
MadameSheema and
patrykkopycinski
as code owners
August 21, 2024 15:03
…ic#190028) ## Summary This PR is a precursor to elastic#189871, as part of the spaces improvement initiative there's a need to be able to share the user privilege assignment component between the roles experience and the new spaces experience to prevent duplication of business logic and cohesiveness in the privilege assignment experience. The aforementioned PR extracts the required component into it's own package so it might be consumed as needed, this PR is particularly concerned with extracting business logic said UI component depends on that exists still within the security plugin. For context; the security plugin already depends on the spaces plugin, so having the spaces plugin in turn statically depend on the security plugin creates a cyclic dependency. That being said to complement the eventual state of said component so it might be imported elsewhere outside of the security plugin there's a need to extract further logic into standalone packages, so that the spaces plugin can consume this plugin without the afore mentioned cyclic dependency problem. #### Visually; ##### Problem; ![image](https://github.com/user-attachments/assets/6be85fb0-3ba3-4d5f-b614-3c0ff2cf7c69) ##### Proposal ![image](https://github.com/user-attachments/assets/5c4f423d-4ad4-48f4-b5bd-2ea0a99b196e)[^legend] [^legend]: items marked in blue are the packages created in this PR, whilst the entire diagram is the proposed future state <!--### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…le on keyboard focus (elastic#187861) Closes: elastic/observability-accessibility#43 Closes: elastic/observability-accessibility#18 ## Description - elastic/observability-accessibility#43: The Observability Inventory map view has a grid of map tiles that each accept a mouse event to show a tooltip. This tooltip must also be available when the tile receives keyboard focus. - elastic/observability-accessibility#18: The Inventory > Kubernetes Pods popover stays open when I click "Create Inventory Rule" and the modal dialog opens. This creates an odd stacking order and obscures content for users at smaller viewport width. ## Steps to recreate 1. Open [Inventory Hosts map view](https://keep-serverless-fyzdg-f07c50.kb.eu-west-1.aws.qa.elastic.cloud/app/metrics/inventory?inventoryViewId=%270%27&waffleFilter=(expression:%27%27,kind:kuery)&waffleTime=(currentTime:1719523489979,isAutoReloading:!f)&waffleOptions=(accountId:%27%27,autoBounds:!t,boundsOverride:(max:1,min:0),customMetrics:!(),customOptions:!(),groupBy:!(),legend:(palette:cool,reverseColors:!f,steps:10),metric:(type:cpu),nodeType:host,region:%27%27,sort:(by:name,direction:desc),timelineOpen:!f,view:map)&assetDetailsFlyout=(assetType:!n,detailsItemId:!n)&assetDetails=!n) 2. Change Hosts to Kubernetes Clusters 3. Try to select specific node using the keyboard ## Screens https://github.com/user-attachments/assets/9ab3b20d-1144-48ed-9760-363f43bafb4b https://github.com/user-attachments/assets/e41bba9f-f3c5-4ce7-bba4-98cf26a2137a
…stic#190857) ## Summary While investigating some issues with the alertsClient, I realized that we weren't writing out any rule information for the logged messages. This made debugging quite difficult, as I wanted to see the rule, so had to search through the alerts indices for the specified alert to get it's rule id, rule type, etc. As an example, see elastic#190376 This PR adds that kind of rule info to the logged messages in alertsClient, as well as the typical sort of tags we write out (rule id, rule type, module).
… hosts list (elastic#191063) Closes [elastic#190418](elastic#190418) ## Summary This PR adds a popover for the hosts that are not monitored by the system integration to help users troubleshoot the problem ## Testing A way to check it is to have a host that is monitored by system integration (I am using metricbeat) and sythtrace hosts - there we should have both (I am using `node scripts/synthtrace infra_hosts_with_apm_hosts --scenarioOpts.numInstances=50 --live`) - Go to hosts view and check the table - The hosts that are **not** monitored by the system integration should have an icon before the host name which opens the popover with some explanation and documentation links - The hosts that are monitored by the system integration should not have an icon before the host name <img width="961" alt="Screenshot 2024-08-22 at 12 02 27" src="https://github.com/user-attachments/assets/a3330f3f-33df-41ae-8135-71aea98e2660"> ![image](https://github.com/user-attachments/assets/b28474d4-2272-4372-b70d-6370aa8e2a9d)
…acity based claiming (elastic#189431) Resolves elastic#189111 ## Summary Adds jest integration test to test cost capacity based claiming with the `mget` claim strategy. Using this integration test, we can exclude running other tasks other than our test types. We register a normal cost task and an XL cost task. We test both that we can claim tasks up to 100% capacity and that we will stop claiming tasks if the next task puts us over capacity, even if that means we're leaving capacity on the table. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
) ## Summary Settings add config to enable default rules !! separated out of elastic#186585 !! <img width="1725" alt="image" src="https://github.com/user-attachments/assets/3fc18d13-d0fe-4f08-8e19-ae43fcb83228"> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dominique Belcher <dominique.clarke@elastic.co>
## Summary Using plural from `react-intl` in the Session View for `Show N alerts` text - part of elastic/security-team#10316 - fixes elastic#189880
…tic#191080) ## Summary It ain't much but it's honest work - fixes elastic#181641 - part pf elastic/security-team#10316 ## Screencast tbh before is not as bad as in the linked ticket, so we can also leave it as it is until we do responsiveness on this page properly. before [screencast-localhost_5601-2024.08.22-15_14_34.webm](https://github.com/user-attachments/assets/4f119203-6a91-4a52-9514-3489789649ce) after [screencast-localhost_5601-2024.08.22-15_05_32.webm](https://github.com/user-attachments/assets/36276e71-8d2d-4095-b2b6-e5524f6d0692)
… if no assignees exist (elastic#190937) ## Summary Addresses elastic#177864 Disables the unassign alert action if no assignees exist.
…t data source (elastic#190438) ## Summary Implements elastic/logs-dev#169. This uses the new central log sources setting as the default data source in the Logs Explorer. The `AllSelection` is now amended to use a set of indices, this `AllSelection` can be defined by the consumer (or falls back to a default). In the case of the Observability Logs Explorer this value is resolved from the setting and used as the `AllSelection` passed to the Logs Explorer controller.
## Summary Epic link: elastic/kibana-team#785 The Spaces Management `SectionPanel` component has been updated to make `title` an optional prop. This PR takes a small change out of a larger PR to be delivered next: elastic#184697. Currently, `title` is shown consistently for all `SectionPanel` elements in the Edit Space screen. In the new design, the panels will appear on a tabbed interface. Observe how the new design implemented in the larger/next PR will leave the `SectionPanel` title empty (this screenshot was taken when running Kibana in the branch for the next PR): <img width="1076" alt="image" src="https://github.com/user-attachments/assets/ba2d70f0-e8be-4885-bc2b-17e5cd3bdf9d"> The current design will still be used for the Create Space interface. As a reminder, here is how the current design looks: <img width="945" alt="image" src="https://github.com/user-attachments/assets/4009bbfc-20fd-41cd-b89f-14bb52be4522">
## Summary This PR moves code that is usually impacted by a Puppeteer/Chromium upgrade to a package. The same work is happening to a lesser degree in the 7.17 branch. Together, these changes will ease the manual labor of backporting the upgrades from main to 7.17. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch.
…190999) Refactor control group settings tests 1. move non-functional test cases to unit tests 2. use pre-built dashboard to avoid time of building dashboard in test ### Before Tests take 4 minutes to run locally <img width="400" alt="Screenshot 2024-08-21 at 3 12 31 PM" src="https://github.com/user-attachments/assets/96cf584c-2b32-4281-86ee-9791544bd5fa"> ### After Tests take 1 minute to run locally <img width="400" alt="Screenshot 2024-08-21 at 2 53 37 PM" src="https://github.com/user-attachments/assets/853a6f3a-74c5-4ca8-a488-99dd24477b1e"> --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary **NOTE** I will need help testing this before we merge it! I spoke with @spong about an upcoming PR we have here: elastic#190426 which bumps the langgraph version from 0.0.31 to 0.0.34, unfortunately this caused a lot of type errors in the default assistant. After some more discussion we proposed to open a PR that removes some of the more complex layers and to fix up the type issues. Though I have not worked on this graph before, the changes hopefully makes sense 👍 Graph flow: ![image](https://github.com/user-attachments/assets/911190c1-2cdc-429f-bd1b-2b4a6a343729) The PR changes the below items to remove some of the abstractions and resolve some of the type issues, also adds a few improvements in general: - Moves `llmType`, `bedrockChatEnabled`, `isStream` and `conversationId` to be invoke parameters rather than compile parameters. This allows them to be used in state, and removes the need to pass them everywhere as parameters. Adding them to the state also allows them to be available in langsmith. - Removes the constants defining each node with wrappers and rather expose them directly as async functions. This removes a lot of the boilerplate code and it makes reading the stacktraces much easier. - Moved to a single `stepRouter` used for the current conditional edges. This allows one to very easily extend the routing between either existing or new nodes, and makes it much easier to understand what conditions are routed where. - Exports a common `NodeType` object constant (no need for the extra compile overhead of Enums here, we are only using strings), to make the node name strings auto-complete and prevent hardcoded names for the router. - Added a `modelInput` node to be the starter node. This was first because adding nodes inside if conditions usually create errors, so it was created to be able to set the `hasRespondStep` state. However this node is nice to have as an entrypoint in which you find yourself wanting to change the state based on the invoke parameters or other conditions retrieved from other parts of the stack etc before it continues to any of the other nodes. - Added a `yarn draw-graph` command, that outputs to `docs/img/default_assistant_graph.png`. This is then also included in the readme. This makes it better for changes by other teams (like me) to understand the intended graph workflows easier. ### Checklist Delete any items that are not applicable to this PR. - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Close elastic/elasticsearch#111544 Follow-on to elastic/elasticsearch#111544
## Summary Fixes elastic#153477. Fixes elastic#153476. Part of elastic#187772 (technical debt). Part of elastic#153288 (migrate enzyme tests to react-testing-lib). Removes dependency cache. The major culprit making this PR large and not easy to split is that `getHttp()` from the dependency cache was used throughout the code base for services like `mlJobService` and `ml/mlApiServices` which then themselves were directly imported and not part of React component lifecycles. - For functional components this means mostly migrating to hooks that allow accessing services. - We still have a bit of a mix of usage of `withKibana` and `context` for class based React components. This was not consolidated in this PR, I took what's there and adjusted how services get used. These components access services via `this.props.kibana.services.*` or `this.context.services.*`. - Functions no longer access the global services provided via dependency cache but were updated to receive services via arguments. - Stateful services like `mlJobService` are exposed now via a factory that makes sure the service gets instantiated only once. - Some tests where the mocks needed quite some refactoring were ported to `react-testing-lib`. They no longer make use of snapshots or call component methods which should be considered implementation details. - We have a mix of usage of the plain `toasts` via `useMlKibana` and our own `toastNotificationServices` that wraps `toasts`. I didn't consolidate this in this PR but used what's available for the given code. - For class based components, service initializations were moved from `componentDidMount()` to `constructor()` where I spotted it. - We have a bit of a mix of naming: `ml`, `mlApiServices`, `useMlApiContext()` for the same thing. I didn't consolidate the naming in this PR, to avoid making this PR even larger. This can be done in a follow up, once this PR is in this should be more straightforward and less risky. - Turns out `explorer_chart_config_builder.js` is no longer used anywhere so I deleted it. - `jobs/jobs_list/components/utils.d.ts` was missing some definitions, tried to fix them. - Moved `stashJobForCloning` to be a method of `mlJobService`. - The `MetricSelector` component was an exact copy besides the i18n label, consolidated that so anomaly detection wizards use the same component. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
…is (elastic#191192) Changing the default selection from `1 week` to `No minimum`. For indices with very large doc counts, it is safer not to query a week's worth of data by default, but rather use the time range selected in the time picker.
elastic#191490) ## Summary Fixes elastic#190303 In 8.15 we disabled a request that showed a spinner while React Query's `isLoading` was true. `isLoading` remains true as long as no data has been received. Because the request was disabled, `isLoading` stayed true the entire time, causing the spinner to be displayed instead of the form that would have activated the request. The fix uses another React Query state called `isFetching`, which is only true while the request is actively being made, so initially, no spinner is shown. ## Release Note Fix endless loading spinner when wanting to add a assignee to a case from the cases list
…chart (elastic#191057) ## Summary Fixes elastic#190765 ![metric_title_fix](https://github.com/user-attachments/assets/9cd88722-7d12-4473-a216-10718a2dc7a6)
## Summary closes elastic#190520 https://github.com/user-attachments/assets/7adce001-3a39-412e-aeeb-adc11e5be72e --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…c#191706) ## Summary Follow up to elastic#187993 Fix missing features in serverless API integration tests
- Fix header and message on DARK Mode - Update python code example <img width="1404" alt="image" src="https://github.com/user-attachments/assets/34ef7b19-acf9-4dfd-af31-e742fba6901f">
…tic#191223) ## Summary Inference endpoints were ignoring different deployments, only looking at the first deployment. This is wrong: we should be checking the specific inference endpoint's trained model reference deployment. This fixes that.
…191727) ## Summary Inserts brackets where necessary, if binary expressions have different precedence. For example: ``` FROM a | WHERE (1 + 2) * (3 - 4) ``` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
When a trial license expires, the license falls into a state where it is not seen as being a valid basic license, but rather an "expired" license. The license is still valid and our `isMinimumLicense` check needs to return true in this situation to allow the ML app to redirect to the expired license page. Before (ML page fails to load): ![image](https://github.com/user-attachments/assets/0e73b2a5-0645-4253-9737-1393fe58f8a1) After (we redirect to the license page): ![image](https://github.com/user-attachments/assets/3f579c1e-ee7f-45e8-87d3-258caa5d42c2)
…h only optional keys (elastic#191709) `io-ts` and `zod` have differences in how they usually define optional keys. In `io-ts`, we usually define a union between a type and a partial, and if all keys are optional we only provide the partial type. While in `zod` if all keys are optional, it's more common to simply put each key as optional while the wrapping object is not. The way the type inference works in the route repository leads to this two cases having different results. For `io-ts`, when it sees a partial, it marks the query/path/body and thus params object as fully optional, while for `zod` since query/path/body are **not** optional but all their keys are, the chain is still marked as required. This PR aims to align these behaviours by checking if the `zod` schema only specifies optional field, and if it does it marks the query/path/body level as optional so that params also can become optional. This way, when calling the API via the client, if all params are optional, the second options argument can be omitted. Similarly, the types in the handler are marked correctly as possibly undefined to prevent bugs. The PR also adds a little `isHttpFetchError` helper with slightly better type support than what the Core version has. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…tional-[ui-]services/* (elastic#189051) ## Summary Moving common services to respective new homes. Resolves: elastic#188541 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Issue: elastic#191060 ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios.
… quality gate (elastic#187266) ## Summary Once this PR is merged, when the Kibana QA quality gate is triggered the following tests are going to be executed: - API tests tagged with `@serverlessQA` - Cypress tests tagged with `@serverlessQA` Currently there are only a few that have been extensively tested and are passing on MKI environments. The current and future tests: - Cover critical paths of the Security Solution application - Test behaviours that if broken SDH or blocker issues might be reported by customers. We have created a run book that has been shared with all the team members of Security Solution and can be found in our internal docs with the title `Security Serverless Kibana QA Quality Gate Failure Run Book` Some of the most important points mentioned in the run book: Below are the channels/groups to be contacted should a test fail: * Detection Engine tests: * #security-detection-engine * @security-detection-engine-team * Entity Analytics tests: * #security-entity-analytics * @security-entity-analytics-team * Explore tests: * #threat-hunting-explore * @security-threat-hunting-explore * Investigations tests: * #security-threat-hunting-investigations * @threat-hunting-investigations * Gen AI tests: * #security-gen-ai-sharing * @security-generative-ai-team * Rule Management tests: * #security-detection-rule-management * @security-detection-rule-management-team * Defend Workflows tests: * #security-defend-workflows * @defend-workflows * Geneve detection rules tests: * #sec-eng-productivity * @sec-eng-prod & `@Dom` If nobody responds within 30 minutes: Post the issue in the #security-unified-app channel with the message that team X is not responding and assistance is needed. Tag @sec-eng-prod as well. Should a failure occur, the Release Manager (RM) will post in the team channell and @ the team responsible. The team, unless in the middle of responding to an SDH Sev1-2, must respond immediately and begin investigation with the RM. Serverless test failures in the Production Quality Release Pipeline are BLOCKING for the entire Kibana Serverless release. --------- Co-authored-by: Robert Oskamp <traeluki@gmail.com>
## Summary Add telemetry to favorites feature elastic#189285 - Adds UI usage counter telemetry, increase the counter when favorite / unfavorite is clicked - Add snapshot telemetry: - total "favorite" object in the deployment - total users+spaces count combination who have used the favorites feature - avg per user per space (only counts those users who favorited at least once) - max favorites objects per user per space Unfortunately, for snapshot telemetry, I had to add fields to kibana mapping. We didn't need them for a feature, but I didn't realize that will have to add them to a mapping. Not sure if there is a better way
…91232) ## Summary Requires elastic#191520. Resolves elastic#188266. Prior to this PR, when polling on an async ES|QL request, we would log the response to every polling request. This PR only logs when the request is complete. Before: ![image](https://github.com/user-attachments/assets/fe9a763d-ef43-4f46-a096-0e08e1805f47) After: ![image](https://github.com/user-attachments/assets/5d59f016-8b0e-4a3f-b044-17b5de97739f) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ([build](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6823))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Cypress for Elastic Assistant in Security Solution. Dependent on elastic#190151
Adds the following Cypress tests for AI Assistant:
AI Assistant - Basic License
AI Assistant Conversations
AI Assistant Prompts
AI Assistant Messages