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

Remove dashboard embeddable with lens #198714

Closed

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Nov 1, 2024

No description provided.

mikecote and others added 25 commits November 1, 2024 12:03
elastic#198226)

## Summary

Added a Duplicate dashboards page for the general duplicating process
and then mentioned the new popover for duplicating managed dashboards.
Linked to this page from other relevant mentions.
…c#197745)

Closes elastic#176299

## Summary

### Problem

When a chat is started from contextual insights, `initialMessages` are
being populated from the temp conversation created from the error.
Because the `initialMessages` are present, when an old conversation is
clicked, the conversation ID of that conversation and the
`initalMessages` from the temp chat are passed to the conversation. This
throws an error, as there is a condition which restricts both of these
being passed to `useConversation` which is used by the `ChatBody`.
- Only one of these should be passed (not both)

### Solution
With the current implementation, even though not passing
`initialMessages` allows the user to open previous conversations
successfully, it doesn't allow the user to start a new chat because as
long as initial messages are set, they will be loaded when the New Chat
button is clicked instead of showing a blank conversation. Clearing
initial messages requires re-architecting how the Chat uses the
conversation.

Therefore, as the solution, when a chat is opened from contextual
insights, the ConversationList will be hidden. The user can interact
with the AI Assistant on the opened chat with initial messages from
contextual insights.
…ructions test (elastic#196026)

Closes elastic#192222

## Summary

### Problem
The "when creating private and public user instructions" test has been
marked as flaky and has been skipped.
Based on the error recorded in the ticket, 2 possible scenarios could be

- **Race Conditions**: When multiple instructions are created
asynchronously, the instructions might not be assigned to the right user
or role. Data could be overwritten.
- **Data Fetching Issues**: The API might return inconsistent data if
the knowledge base is not properly cleared between tests, or if the
instructions are not properly isolated per user.

### Solution
When running the test locally, the actual output and expected outcome
are the same, therefore the test passes. The flaky test runner didn't
output anything meaningful either.

However, in order to resolve any missing entries, the before hook was
updated to retry adding only the missing entries. Hopefully, this will
help resolve the flakiness.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated 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
Resolves: elastic/response-ops-team#209 

This PR is a follow-on of elastic#186804.

Creates a new task that runs every 1 hour to push the total
connector-request-body-bytes that have been saved in the event log to
usage-api.
## Summary

The test no longer appears flaky based on the flaky test runner. In
addition to this PR there's also
elastic#197563 for 400+ passes. It should
be noted that in one run 25 runs were skipped and one run failed due to
an unrelated test.

Closes elastic#193868
## Summary

Removes the Canvas sample data from `main` (9.0).

Some async feedback
[here](elastic#197733 (comment))

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
## Summary
Hello, this is a follow up PR to elastic#192234 . The previous PR added
simplistic logging to the saved objects importer. The goal now is to
enhance the logs with information on the saved objects being imported,
how they are imported, and by displaying any errors.

#### `import_saved_objects.ts`:
- Logs specific types being imported
- Logs size limit and overwrite status
- Logs Success/Fail messages

#### Changes to `saved_objects_importer.ts`:
- Passes the logger to `importSavedObjectsFromStream` 
- Removes "starting import"

#### Changes to `import_saved_objects.test.ts`:
- Updates it for the new logger parameter

#### Changes to `import.test.ts`:
- Uses the mock logger provided by core, instead of using a custom one

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Alejandro Fernández Haro <[email protected]>
…stic#198378)

## Summary
 
Fixes: elastic#198407

### Checklist

Delete any items that are not applicable to this PR.

- [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#_add_your_labels)
## Summary

At the moment, all inference API related types and utilities
(`chatComplete`, `output` and more) are living inside the `inference`
plugin's common folder.

This is somewhat problematic because it forces any consumers of those
types to explicitly depends on the `inference` plugin (via plugin dep or
ts ref), which could lead to any kind of cyclic dependency issues, in
addition to being overall a bad design pattern.

This also makes it more complicated that it should to try to split the
inference logic / task framework / task implementation into distinct
packages or plugins, due to some (concrete) utilities living in the
inference plugin's code.

It's also a bad experience for consumers, as it's quite difficult to
easily resolve imports they need (we're mixing internal and public
exports atm, plus not all types are exported from a single entry point,
making it very tedious to find the right path for each individual import
we need to consume the inference APIs)

This PR addresses most of those points, by introducing a new
`@kbn/inference-common` package and moving all the low level types and
utilities to it, while exposing all of them from the package's
entrypoint.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
…rd party data compatibility (elastic#198635)

## Summary

This PR enhances the solution proposed by [this
PR](elastic#195702), by picking only the
fields that are currently not mapped by the current Third Party
integrations, this fixes performance degradation identified during the
QA cycle of 8.16.0.

Fixes:
- elastic/security-team#11034

### Misconfiguration Runtime fields

- **rule.benchmark.rule_number**: runtime mapping kept because this
field is missing on `security_solution-aws.misconfiguration_latest-v1`
causing filtering out data when sorting by **Rule Number** column on the
Misconfigurations Data Table.
- **rule.section**: runtime mapping kept because this field is missing
on `security_solution-aws.misconfiguration_latest-v1` causing filtering
out data when sorting by **Framework Section** column on the
Misconfigurations Data Table.
- **resource.sub_type**: runtime mapping kept because this field is
missing on `security_solution-aws.misconfiguration_latest-v1` causing
filtering out data when sorting by **Resource Type** column on the
Misconfigurations Data Table.
- **orchestrator.cluster.name**: runtime mapping kept because this field
is missing on `security_solution-wiz.misconfiguration_latest-v1` causing
filtering out data when grouping by **Kubernetes Cluster** column on the
Misconfigurations page.
- **cloud.account.name**: runtime mapping kept because this field is
missing on `security_solution-aws.misconfiguration_latest-v1` causing
filtering out data when grouping by **Kubernetes Cluster** column on the
Misconfigurations page.


### Vulnerability Runtime Fields:

- **observer.vendor**: runtime mapping added because this field is
mapped as `text` on `security_solution-wiz.vulnerability_latest-v1`
causing filtering out when sorting by the **Vendor** column on the
Vulnerability Data Table
- **cloud.provider**: runtime mapping added because this field is mapped
as `text` on `security_solution-wiz.vulnerability_latest-v1` causing
filtering out when grouping by **Cloud Account** on the Vulnerability
page. (This field is needed in order to retrieve the Cloud Provider name
and icon)


## Screenshot - Left: After the changes / Right: Current



https://github.com/user-attachments/assets/2cbdd8b7-131c-42e4-a881-632f8cd3854b


https://github.com/user-attachments/assets/4372feb6-4c01-4047-a90a-d6728f9400fe



https://github.com/user-attachments/assets/b9e32514-f2ee-4e4d-ba5f-ea3e20d4d0b2
## Summary

Closes elastic#198258

### Checklist

- [ ] [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

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Julia Rechkunova <[email protected]>
…ic#198380)

### Authz API migration for authorized routes

This PR migrates `access:<privilege>` tags used in route definitions to
new security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before migration:**
Access control tags were defined in the `options` object of the route:

```ts
router.get({
  path: '/api/path',
  options: {
    tags: ['access:<privilege_1>', 'access:<privilege_2>'],
  },
  ...
}, handler);
```

### **After migration:**
Tags have been replaced with the more robust
`security.authz.requiredPrivileges` field under `security`:

```ts
router.get({
  path: '/api/path',
  security: {
    authz: {
      requiredPrivileges: ['<privilege_1>', '<privilege_2>'],
    },
  },
  ...
}, handler);
```

### What to do next?
1. Review the changes in this PR.
2. You might need to update your tests to reflect the new security
configuration:
  - If you have tests that rely on checking `access` tags.
  - If you have snapshot tests that include the route definition.
- If you have FTR tests that rely on checking unauthorized error
message. The error message changed to also include missing privileges.

## Any questions?
If you have any questions or need help with API authorization, please
reach out to the `@elastic/kibana-security` team.

---------

Co-authored-by: Elena Shostak <[email protected]>
…stopped (elastic#198645)

## Summary

Fix the dashboard page when the entity store state is stopped
Previously, the EntityStoreDashboardPanels component didn't account for
the installed but disabled state (stopped).

I made the minimum changes necessary to fix the bug, but this component
needs to be refactored, unit-tested, and written in a storybook with all
possible states. Technical debt Issue:
elastic/security-team#11035
…stic#198416)

In this PR, I'm removing the count of stale tasks from the number of
conflicts during the claiming cycle. I am also adding a new property to
the task manager health report (`claim_stale_tasks`) so we can track
those separately to ensure we have the proper page size.

## To verify
Apply the following diff, observe the new `claim_stale_tasks` in the TM
health API and that conflicts are 0
```
diff --git a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts
index 4e74454e8c9..35d7fd872d8 100644
--- a/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts
+++ b/x-pack/plugins/task_manager/server/task_claimers/strategy_mget.ts
@@ -145,6 +145,7 @@ async function claimAvailableTasks(opts: TaskClaimerOpts): Promise<ClaimOwnershi
     }

     if (
+      false &&
       searchVersion.seqNo === latestVersion.seqNo &&
       searchVersion.primaryTerm === latestVersion.primaryTerm
     ) {
```
…ble !! (elastic#198599)

## Summary

Fixes elastic#198593

Added error track trace to status/tls rule context variable !!

<img width="1725" alt="image"
src="https://github.com/user-attachments/assets/d04fb6f3-7505-4a01-8a6f-b1b27d50ecdd">
## Summary

Fixes elastic#196425.

It turns out the reason `yarn draw-graphs` produced the three-box graphs
was because `.withConfig` creates an instance of RunnableInput which does 
not have a good way to draw itself other than as three boxes.

The solution was to makes sure we are calling the original version
without `.withConfig` when drawing the graphs. We still call the new
version when invoking them, as demonstrated by the run names here.

We are now able to generate the correct graphs for all chains.

---------

Co-authored-by: Elastic Machine <[email protected]>
…ing-explore (elastic#198339)

### Authz API migration for unauthorized routes

This PR migrates unauthorized routes owned by your team to a new
security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before migration:**
```ts
router.post({
  path: '/api/path',
  ...
}, handler);
```

### **After migration:**
```ts
router.post({
  path: '/api/path',
  access: 'internal',
  security: {
        authz: {
          requiredPrivileges: ['securitySolution'],
        },
      },
  ...
}, handler);
```

### What to do next?
1. Review the changes in this PR.
2. Elaborate on the reasoning to opt-out of authorization.
3. Routes without a compelling reason to opt-out of authorization should
plan to introduce them as soon as possible.
2. You might need to update your tests to reflect the new security
configuration:
  - If you have snapshot tests that include the route definition.

## Any questions?
If you have any questions or need help with API authorization, please
reach out to the `@elastic/kibana-security` team.

---------

Co-authored-by: Angela Chuang <[email protected]>
Co-authored-by: Angela Chuang <[email protected]>
## Summary

Part of elastic#195418

This PR moves the `STATS` completion logic to its own home.

There are also a few changes in behavior. I am open for feedback on any
of these.
- the cursor is automatically advanced after accepting a comma
suggestion
- variables from previous `EVAL` commands are no longer suggested (e.g.
`...| EVAL foo = 1 | STATS /`). I'm not sure about this change, but it
seemed potentially unintended to suggest variables but no other columns
such as field names.
- a new variable is suggested for new expressions in the `BY` clause.
Formerly, new variables were only suggested in the `STATS` clause.
- `+` and `-` are no longer suggested after a completed function call
within an assignment in the `BY` clause (e.g. `... | STATS ... BY var1 =
BUCKET(dateField, 1 day) /`. This behavior was encoded in our tests, but
it feels unintended to me, especially since it only applied when the
result of the function was assigned to a new variable in the `BY`
clause.

### 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

---------

Co-authored-by: Stratoula Kalafateli <[email protected]>
@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@nreese
Copy link
Contributor Author

nreese commented Nov 1, 2024

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 1, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / Dashboard App test that the expanded panel behavior subject and history is called when passed as a prop to the DashboardApp
  • [job] [logs] Jest Tests #5 / Dashboard App test that the expanded panel behavior subject and history is called when passed as a prop to the DashboardApp
  • [job] [logs] FTR Configs #36 / dashboard drilldowns Explore underlying data - panel action "after all" hook: set back default index pattern and clean-up custom time range on panel for "carries over panel time range"
  • [job] [logs] FTR Configs #36 / dashboard drilldowns Explore underlying data - panel action "after all" hook: set back default index pattern and clean-up custom time range on panel for "carries over panel time range"
  • [job] [logs] FTR Configs #36 / dashboard drilldowns Explore underlying data - panel action action exists in panel context menu
  • [job] [logs] FTR Configs #36 / dashboard drilldowns Explore underlying data - panel action action exists in panel context menu
  • [job] [logs] FTR Configs #17 / Dashboard save a search sessions Restore using non-existing sessionId errors out. Refresh starts a new session and completes. Back button restores a session.
  • [job] [logs] FTR Configs #17 / Dashboard save a search sessions Restore using non-existing sessionId errors out. Refresh starts a new session and completes. Back button restores a session.
  • [job] [logs] FTR Configs #58 / data plugin Session management Dashboard starts a session on refresh
  • [job] [logs] FTR Configs #58 / data plugin Session management Dashboard starts a session on refresh

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 675 674 -1
inference 15 22 +7
lens 1468 1493 +25
securitySolution 6144 6146 +2
unifiedSearch 359 361 +2
total +35

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ai-assistant 63 64 +1
@kbn/es-types 29 30 +1
@kbn/inference-common - 39 +39
@kbn/presentation-containers 80 75 -5
@kbn/presentation-publishing 188 192 +4
fleet 1301 1300 -1
inference 44 28 -16
lens 590 547 -43
ruleRegistry 248 226 -22
total -42

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 552.6KB 552.7KB +45.0B
apm 3.4MB 3.4MB +45.0B
canvas 1.1MB 1.1MB +17.0B
cases 492.2KB 492.3KB +167.0B
cloudSecurityPosture 509.7KB 509.2KB -516.0B
dashboard 647.2KB 630.1KB -17.0KB
dataVisualizer 616.0KB 616.0KB +45.0B
discover 828.6KB 828.6KB +45.0B
enterpriseSearch 2.6MB 2.6MB +634.0B
eventAnnotationListing 227.7KB 227.7KB -23.0B
exploratoryView 182.7KB 182.7KB +13.0B
fileUpload 951.4KB 951.4KB +13.0B
fleet 1.7MB 1.7MB +6.0B
imageEmbeddable 69.0KB 69.1KB +45.0B
lens 1.5MB 1.5MB +18.1KB
links 52.4KB 52.4KB +45.0B
maps 3.0MB 3.0MB +71.0B
ml 4.5MB 4.5MB +399.0B
observabilityAIAssistant 19.1KB 19.1KB +24.0B
observabilityAIAssistantApp 239.0KB 239.1KB +97.0B
searchAssistant 161.9KB 161.9KB +30.0B
securitySolution 21.0MB 21.0MB +969.0B
slo 856.0KB 856.0KB +45.0B
synthetics 1.1MB 1.1MB +88.0B
unifiedHistogram 70.1KB 70.0KB -83.0B
total +3.2KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/presentation-containers 0 1 +1
dashboard 14 13 -1
inference 15 4 -11
lens 63 60 -3
ruleRegistry 11 10 -1
total -15

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cloudExperiments 92.1KB 92.2KB +124.0B
dashboard 51.8KB 51.5KB -242.0B
data 419.9KB 419.9KB +71.0B
enterpriseSearch 54.5KB 53.3KB -1.3KB
fleet 173.1KB 173.0KB -110.0B
inference 5.8KB 5.7KB -128.0B
infra 56.2KB 56.3KB +45.0B
kbnUiSharedDeps-srcJs 3.4MB 3.4MB +580.0B
lens 50.8KB 49.0KB -1.8KB
maps 54.4KB 54.4KB +45.0B
observabilityAIAssistant 47.0KB 47.1KB +49.0B
unifiedHistogram 10.1KB 10.2KB +26.0B
visualizations 71.0KB 71.0KB +45.0B
total -2.6KB
Unknown metric groups

API count

id before after diff
@kbn/ai-assistant 63 64 +1
@kbn/es-types 29 30 +1
@kbn/inference-common - 99 +99
@kbn/presentation-containers 92 87 -5
@kbn/presentation-publishing 224 228 +4
fleet 1426 1423 -3
inference 49 33 -16
lens 692 646 -46
ruleRegistry 285 263 -22
total +13

async chunk count

id before after diff
dashboard 15 12 -3
lens 23 26 +3
total -0

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 731 730 -1
dashboard 16 11 -5
fleet 48 47 -1
lens 17 21 +4
total -3

References to deprecated APIs

id before after diff
dashboard 34 27 -7
lens 84 80 -4
ruleRegistry 6 5 -1
total -12

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 756 755 -1
dashboard 16 11 -5
fleet 60 59 -1
lens 17 21 +4
total -3

Unreferenced deprecated APIs

id before after diff
embeddable 0 2 +2

History

@nreese
Copy link
Contributor Author

nreese commented Dec 11, 2024

Closing, both PRs merged

@nreese nreese closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.