Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
99e6dd4
Updates KB ES schema, OAS and API to support index entries
spong Jun 20, 2024
f5e89d1
Adds API integration tests, http client files and minor schema updates
spong Jun 21, 2024
7b79c2e
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Jun 21, 2024
ea3ab72
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 21, 2024
575389a
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Jun 24, 2024
92b2596
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Aug 27, 2024
4f51c29
Re-adding test configs
spong Aug 27, 2024
ed79185
Fixing linting and mapping errors and moved files from main
spong Aug 27, 2024
d64fad8
Programmatically generate tools based on IndexEntries
spong Aug 29, 2024
e488146
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Aug 29, 2024
13f6db6
Adds support for inputSchema and outputFields for retrieval query gen
spong Aug 30, 2024
921beb7
Remove console logs
spong Aug 30, 2024
e7c0c1c
tsconfig update
spong Aug 30, 2024
e38fdcc
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Aug 30, 2024
332ff76
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Aug 30, 2024
75d14c4
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 30, 2024
4360f1d
Adds v2 field mapping, removes ml hook fix, and skip integration test…
spong Aug 31, 2024
830ce0b
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Aug 31, 2024
d98c344
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Sep 3, 2024
e1bde2c
Merge branch 'main' into kb-index-entry-update
spong Sep 4, 2024
248911e
Merge branch 'kb-index-entry-update' of github.com:spong/kibana into …
spong Sep 4, 2024
a0de4d1
Updates http file headers to use variables
spong Sep 4, 2024
094d9f6
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Sep 4, 2024
07c1ba3
Notes from review
spong Sep 4, 2024
435f8c1
Merge branch 'main' into kb-index-entry-update
spong Sep 5, 2024
9989998
Merge branch 'main' into kb-index-entry-update
spong Sep 9, 2024
3d34832
Thoroughly supporting v1 and v2 kb schemas for backwards compatibility
spong Sep 9, 2024
da779e2
Parse legacy docs as DocumentEntries when fetching from ES
spong Sep 10, 2024
29a5efa
Updates destination field for embeddings in new pipeline
spong Sep 10, 2024
f4116b9
Merge branch 'main' of github.com:elastic/kibana into kb-index-entry-…
spong Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/nlp_cleanup_task/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/nlp_cleanup_task/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Watcher {
ignore: [
'**/{node_modules,target,public,coverage,__*__}/**',
'**/*.{test,spec,story,stories}.*',
'**/*.{md,sh,txt}',
'**/*.{http,md,sh,txt}',
'**/debug.log',
],
}
Expand Down
3 changes: 2 additions & 1 deletion src/dev/build/tasks/copy_legacy_source_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ export const CopyLegacySource: Task = {
'!**/jest*',
'!**/*.{story,stories}.{js,ts}',
'!**/{test_mocks,stubs}.ts',
'!**/*.{scss,console,d.ts,sh,md,mdx,asciidoc,docnav.json}',
'!**/*.{scss,console,d.ts,sh,md,mdx,asciidoc,docnav.json,http}',
'!**/*.{test,test.mocks,mock,mocks,spec}.*',
'!**/{packages,dev_docs,docs,public,__stories__,storybook,.storybook,ftr_e2e,e2e,scripts,test,tests,test_resources,test_data,__tests__,manual_tests,__jest__,__snapshots__,__mocks__,mock_responses,mocks,fixtures,__fixtures__,cypress,integration_tests}/**',
'!**/http-client.env.json',

// explicitly exclude every package directory outside of the root packages dir
...getPackages(config.resolveFromRepo('.')).flatMap((p) =>
Expand Down
3 changes: 3 additions & 0 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export const IGNORE_FILE_GLOBS = [

// ecs templates
'**/ecs/fields/**/*',

// Support for including http-client.env.json configurations
'**/http-client.env.json',
];

/**
Expand Down
2 changes: 2 additions & 0 deletions x-pack/packages/kbn-elastic-assistant-common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Private configs for .http files
http-client.private.env.json
33 changes: 33 additions & 0 deletions x-pack/packages/kbn-elastic-assistant-common/env/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
With https://github.com/elastic/kibana/pull/186566, we've introduced a few sample `*.http` files for easier development/testing. These files are supported out of the box in JetBrains IDE's or in VSCode with the [httpyac](https://httpyac.github.io/) (and many other) extensions. Since the configuration for these files includes a `-` in the name, a few @elastic/kibana-operations files have been updated to exclude them from checks and being included in the distribution.

You can read more about `http` files [here](https://www.jetbrains.com/help/webstorm/http-client-in-product-code-editor.html) and for the spec see this repo [here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md). If we find these useful, we could add support to our [OpenAPI Generator](https://openapi-generator.tech/docs/generators/jetbrains-http-client) to create these automatically. They currently live co-located next to the OAS and generated schema files here:

```
x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http
x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http
```

and the main config here in this directory:

```
x-pack/packages/kbn-elastic-assistant-common/env/http-client.env.json
```

The `x-pack/packages/kbn-elastic-assistant-common/.gitignore` has been updated to ignore `http-client.private.env.json` files locally, which is how you can override the config as you'd like. This is helpful to add variables like `basePath` as below:

```
{
"dev": {
"basePath": "/kbn"
}
}
```

To use them, just open the corresponding `*.http` for the API you want to test, and click `Send`, and the response will open in another tab. Here is what that looks like for creating one of the new `IndexEntry` KB documents that have been introduced in the initial PR:

<p align="center">
<img width="500" src="https://github.com/user-attachments/assets/c9e70d1a-28d2-4eb3-9853-ab6d8e1c7acf" />
</p>


For continuing this effort, https://github.com/elastic/kibana/issues/192386 has been created.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"dev": {
"host": "localhost",
"port": "5601",
"basePath": "",
"elasticApiVersion": "1",
"auth": {
"username": "elastic",
"password": "changeme"
},
"appContext": {
"security": "%7B%22type%22%3A%22application%22%2C%22name%22%3A%22securitySolutionUI%22%2C%22url%22%3A%22%2Fkbn%2Fapp%2Fsecurity%22%7D"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export * from './actions_connector/post_actions_connector_execute_route.gen';

// Knowledge Base Schemas
export * from './knowledge_base/crud_kb_route.gen';
export * from './knowledge_base/bulk_crud_knowledge_base_route.gen';
export * from './knowledge_base/common_attributes.gen';
export * from './knowledge_base/crud_knowledge_base_route.gen';
export * from './knowledge_base/find_knowledge_base_entries_route.gen';
export * from './knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen';
export * from './knowledge_base/entries/common_attributes.gen';
export * from './knowledge_base/entries/crud_knowledge_base_entries_route.gen';
export * from './knowledge_base/entries/find_knowledge_base_entries_route.gen';

export * from './prompts/find_prompts_route.gen';
export { PromptResponse, PromptTypeEnum } from './prompts/bulk_crud_prompts_route.gen';

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Empty Bulk Action
POST http://{{host}}:{{port}}{{basePath}}/internal/elastic_assistant/knowledge_base/entries/_bulk_action
kbn-xsrf: "true"
Content-Type: application/json
Elastic-Api-Version: {{elasticApiVersion}}
Authorization: Basic {{auth.username}} {{auth.password}}
X-Kbn-Context: {{appContext.security}}

{
"delete": {},
"create": [],
"update": []
}
Loading