Skip to content

Commit

Permalink
Merge branch 'main' into remove_kbn_ace
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 10, 2024
2 parents 7967fec + 4d54cfe commit 11ba5b5
Show file tree
Hide file tree
Showing 63 changed files with 1,753 additions and 125 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}}
SLACK_TOKEN: ${{secrets.CODE_SCANNING_SLACK_TOKEN}}
CODEQL_BRANCHES: 7.17,8.x,main
CODE_SCANNING_ES_HOST: ${{secrets.CODE_SCANNING_ES_HOST}}
CODE_SCANNING_ES_API_KEY: ${{secrets.CODE_SCANNING_ES_API_KEY}}
CODE_SCANNING_BRANCHES: 7.17,8.x,main
run: |
npm ci --omit=dev
node codeql-alert
78 changes: 39 additions & 39 deletions docs/search/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The *Search* space in {kib} comprises the following features:
* <<playground,Playground>>
* https://www.elastic.co/guide/en/elasticsearch/reference/current/search-application-overview.html[Search Applications]
* https://www.elastic.co/guide/en/elasticsearch/reference/current/behavioral-analytics-overview.html[Behavioral Analytics]
* Inference Endpoints UI
* AI Assistant for Search
* <<inference-endpoints,Inference Endpoints UI>>
* <<search-assistant,AI Assistant for Search>>
* Persistent Dev Tools <<console-kibana, Console>>

[float]
Expand All @@ -19,53 +19,53 @@ The *Search* space in {kib} comprises the following features:

The Search solution and use case is made up of many tools and features across the {stack}.
As a result, the release notes for your features of interest might live in different Elastic docs.
// Use the following table to find links to the appropriate documentation, API references (if applicable), and release notes.
Use the following table to find links to the appropriate documentation, API references (if applicable), and release notes.

// [options="header"]
// |===
// | Name | API reference | Documentation | Release notes
[options="header"]
|===
| Name | API reference | Documentation | Release notes

// | Connectors
// | link:https://example.com/connectors/api[API reference]
// | link:https://example.com/connectors/docs[Documentation]
// | link:https://example.com/connectors/notes[Release notes]
| Connectors
| {ref}/connector-apis.html[API reference]
| {ref}/es-connectors.html[Elastic Connectors]
| {ref}/es-connectors-release-notes.html[Elasticsearch guide]

// | Web crawler
// | link:https://example.com/web_crawlers/api[API reference]
// | link:https://example.com/web_crawlers/docs[Documentation]
// | link:https://example.com/web_crawlers/notes[Release notes]
| Web crawler
| N/A
| {enterprise-search-ref}/crawler.html[Documentation]
| {enterprise-search-ref}/changelog.html[Enterprise Search Guide]

// | Playground
// | link:https://example.com/playground/api[API reference]
// | link:https://example.com/playground/docs[Documentation]
// | link:https://example.com/playground/notes[Release notes]
| Playground
| N/A
| {kibana-ref}/playground.html[Documentation]
| {kibana-ref}/release-notes.html[Kibana guide]

// | Search Applications
// | link:https://example.com/search_apps/api[API reference]
// | link:https://example.com/search_apps/docs[Documentation]
// | link:https://example.com/search_apps/notes[Release notes]
| Search Applications
| {ref}/search-application-apis.html[API reference]
| {enterprise-search-ref}/app-search-workplace-search.html[Documentation]
| {ref}/es-release-notes.html[Elasticsearch guide]

// | Behavioral Analytics
// | link:https://example.com/behavioral_analytics/api[API reference]
// | link:https://example.com/behavioral_analytics/docs[Documentation]
// | link:https://example.com/behavioral_analytics/notes[Release notes]
| Behavioral Analytics
| {ref}/behavioral-analytics-apis.html[API reference]
| {ref}/behavioral-analytics-start.html[Documentation]
| {ref}/es-release-notes.html[Elasticsearch guide]

// | Inference Endpoints
// | link:https://example.com/inference_endpoints/api[API reference]
// | link:https://example.com/inference_endpoints/docs[Documentation]
// | link:https://example.com/inference_endpoints/notes[Release notes]
| Inference Endpoints
| {ref}/inference-apis.html[API reference]
| {kibana-ref}/inference-endpoints.html[Documentation]
| {ref}/es-release-notes.html[Elasticsearch guide]

// | Console
// | link:https://example.com/console/api[API reference]
// | link:https://example.com/console/docs[Documentation]
// | link:https://example.com/console/notes[Release notes]
| Console
| N/A
| {kibana-ref}/console-kibana.html[Documentation]
| {kibana-ref}/release-notes.html[Kibana guide]

// | Search UI
// | link:https://www.elastic.co/docs/current/search-ui/api/architecture[API reference]
// | link:https://www.elastic.co/docs/current/search-ui/overview[Documentation]
// | link:https://example.com/search_ui/notes[Release notes]
| Search UI
| https://www.elastic.co/docs/current/search-ui/api/architecture[API reference]
| https://www.elastic.co/docs/current/search-ui[Documentation]
| https://www.elastic.co/docs/current/search-ui[Search UI]

// |===
|===

include::search-connection-details.asciidoc[]
include::playground/index.asciidoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class Router<Context extends RequestHandlerContextBase = RequestHandlerCo
if (excludeVersionedRoutes) {
return this.routes.filter((route) => !route.isVersioned);
}
return this.routes;
return [...this.routes];
}

public handleLegacyErrors = wrapErrors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ export const ConnectorConfigurationForm: React.FC<ConnectorConfigurationForm> =
items={category.configEntries}
hasDocumentLevelSecurityEnabled={hasDocumentLevelSecurity}
setConfigEntry={(key, value) => {
const entry = localConfig[key];
if (entry && !isCategoryEntry(entry)) {
const newConfiguration: ConnectorConfiguration = {
...localConfig,
[key]: { ...entry, value },
};
setLocalConfig(newConfiguration);
}

const categories = configView.categories;
categories[index] = { ...categories[index], [key]: value };
setConfigView({
Expand Down Expand Up @@ -136,6 +145,15 @@ export const ConnectorConfigurationForm: React.FC<ConnectorConfigurationForm> =
items={configView.advancedConfigurations}
hasDocumentLevelSecurityEnabled={hasDocumentLevelSecurity}
setConfigEntry={(key, value) => {
const entry = localConfig[key];
if (entry && !isCategoryEntry(entry)) {
const newConfiguration: ConnectorConfiguration = {
...localConfig,
[key]: { ...entry, value },
};
setLocalConfig(newConfiguration);
}

setConfigView({
...configView,
advancedConfigurations: configView.advancedConfigurations.map((config) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('storeCounter', () => {
],
Object {
"namespace": "default",
"refresh": false,
"upsertAttributes": Object {
"counterName": "b",
"counterType": "c",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const storeCounter = async ({ metric, soRepository }: StoreCounterParams)
counterType,
source,
},
refresh: false,
}
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ describe('UsageCountersService', () => {
},
],
Object {
"refresh": false,
"upsertAttributes": Object {
"counterName": "counterA",
"counterType": "count",
Expand All @@ -175,6 +176,7 @@ describe('UsageCountersService', () => {
},
],
Object {
"refresh": false,
"upsertAttributes": Object {
"counterName": "counterB",
"counterType": "count",
Expand Down
115 changes: 115 additions & 0 deletions x-pack/plugins/fleet/cypress/e2e/integrations_automatic_import.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { deleteIntegrations } from '../tasks/integrations';
import {
UPLOAD_PACKAGE_LINK,
ASSISTANT_BUTTON,
TECH_PREVIEW_BADGE,
CREATE_INTEGRATION_LANDING_PAGE,
BUTTON_FOOTER_NEXT,
INTEGRATION_TITLE_INPUT,
INTEGRATION_DESCRIPTION_INPUT,
DATASTREAM_TITLE_INPUT,
DATASTREAM_DESCRIPTION_INPUT,
DATASTREAM_NAME_INPUT,
DATA_COLLECTION_METHOD_INPUT,
LOGS_SAMPLE_FILE_PICKER,
EDIT_PIPELINE_BUTTON,
SAVE_PIPELINE_BUTTON,
VIEW_INTEGRATION_BUTTON,
INTEGRATION_SUCCESS_SECTION,
SAVE_ZIP_BUTTON,
} from '../screens/integrations_automatic_import';
import { cleanupAgentPolicies } from '../tasks/cleanup';
import { login, logout } from '../tasks/login';
import { createBedrockConnector, deleteConnectors } from '../tasks/api_calls/connectors';
import {
ecsResultsForJson,
categorizationResultsForJson,
relatedResultsForJson,
} from '../tasks/api_calls/graph_results';

describe('Add Integration - Automatic Import', () => {
beforeEach(() => {
login();

cleanupAgentPolicies();
deleteIntegrations();

// Create a mock connector
deleteConnectors();
createBedrockConnector();
// Mock API Responses
cy.intercept('POST', '/api/integration_assistant/ecs', {
statusCode: 200,
body: {
results: ecsResultsForJson,
},
});
cy.intercept('POST', '/api/integration_assistant/categorization', {
statusCode: 200,
body: {
results: categorizationResultsForJson,
},
});
cy.intercept('POST', '/api/integration_assistant/related', {
statusCode: 200,
body: {
results: relatedResultsForJson,
},
});
});

afterEach(() => {
deleteConnectors();
cleanupAgentPolicies();
deleteIntegrations();
logout();
});

it('should create an integration', () => {
cy.visit(CREATE_INTEGRATION_LANDING_PAGE);

cy.getBySel(ASSISTANT_BUTTON).should('exist');
cy.getBySel(UPLOAD_PACKAGE_LINK).should('exist');
cy.getBySel(TECH_PREVIEW_BADGE).should('exist');

// Create Integration Assistant Page
cy.getBySel(ASSISTANT_BUTTON).click();
cy.getBySel(BUTTON_FOOTER_NEXT).click();

// Integration details Page
cy.getBySel(INTEGRATION_TITLE_INPUT).type('Test Integration');
cy.getBySel(INTEGRATION_DESCRIPTION_INPUT).type('Test Integration Description');
cy.getBySel(BUTTON_FOOTER_NEXT).click();

// Datastream details page
cy.getBySel(DATASTREAM_TITLE_INPUT).type('Audit');
cy.getBySel(DATASTREAM_DESCRIPTION_INPUT).type('Test Datastream Description');
cy.getBySel(DATASTREAM_NAME_INPUT).type('audit');
cy.getBySel(DATA_COLLECTION_METHOD_INPUT).type('file stream');
cy.get('body').click(0, 0);

// Select sample logs file and Analyze logs
cy.fixture('teleport.ndjson', null).as('myFixture');
cy.getBySel(LOGS_SAMPLE_FILE_PICKER).selectFile('@myFixture');
cy.getBySel(BUTTON_FOOTER_NEXT).click();

// Edit Pipeline
cy.getBySel(EDIT_PIPELINE_BUTTON).click();
cy.getBySel(SAVE_PIPELINE_BUTTON).click();

// Deploy
cy.getBySel(BUTTON_FOOTER_NEXT).click();
cy.getBySel(INTEGRATION_SUCCESS_SECTION).should('exist');
cy.getBySel(SAVE_ZIP_BUTTON).should('exist');

// View Integration
cy.getBySel(VIEW_INTEGRATION_BUTTON).click();
});
});
Loading

0 comments on commit 11ba5b5

Please sign in to comment.