[8.17] Disable Inference Connector experimental feature (#196036) (#202538)

# Backport

This will backport the following commits from `main` to `8.17`:
- [Disable Inference Connector experimental feature
(#196036)](https://github.com/elastic/kibana/pull/196036)

<!--- Backport version: 9.6.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Yuliia
Naumenko","email":"jo.naumenko@gmail.com"},"sourceCommit":{"committedDate":"2024-10-14T20:21:35Z","message":"Disable
Inference Connector experimental feature
(#196036)","sha":"10622964efa74ce26e361c85adaa815981ff148c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.0.0","8.16
candidate","v8.16.0"],"title":"Disable Inference Connector experimental
feature","number":196036,"url":"https://github.com/elastic/kibana/pull/196036","mergeCommit":{"message":"Disable
Inference Connector experimental feature
(#196036)","sha":"10622964efa74ce26e361c85adaa815981ff148c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196036","number":196036,"mergeCommit":{"message":"Disable
Inference Connector experimental feature
(#196036)","sha":"10622964efa74ce26e361c85adaa815981ff148c"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"url":"https://github.com/elastic/kibana/pull/197496","number":197496,"branch":"8.16","state":"MERGED","mergeCommit":{"sha":"0fa7788ea542d905ae529ed4bb9df1719a110e41","message":"[8.16]
Disable Inference Connector experimental feature (#196036)
(#197496)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.16`:\n- [Disable Inference Connector experimental
feature\n(#196036)](https://github.com/elastic/kibana/pull/196036)\n\n<!---
Backport version: 9.6.1 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Yuliia\nNaumenko\",\"email\":\"jo.naumenko@gmail.com\"},\"sourceCommit\":{\"committedDate\":\"2024-10-14T20:21:35Z\",\"message\":\"Disable\nInference
Connector experimental
feature\n(#196036)\",\"sha\":\"10622964efa74ce26e361c85adaa815981ff148c\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"backport:skip\",\"v9.0.0\",\"8.16\ncandidate\",\"v8.16.0\"],\"title\":\"Disable
Inference Connector
experimental\nfeature\",\"number\":196036,\"url\":\"https://github.com/elastic/kibana/pull/196036\",\"mergeCommit\":{\"message\":\"Disable\nInference
Connector experimental
feature\n(#196036)\",\"sha\":\"10622964efa74ce26e361c85adaa815981ff148c\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.16\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/196036\",\"number\":196036,\"mergeCommit\":{\"message\":\"Disable\nInference
Connector experimental
feature\n(#196036)\",\"sha\":\"10622964efa74ce26e361c85adaa815981ff148c\"}},{\"branch\":\"8.x\",\"label\":\"v8.16.0\",\"branchLabelMappingKey\":\"^v8.16.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->"}}]}]
BACKPORT-->
This commit is contained in:
Yuliia Naumenko 2024-12-02 12:11:37 -08:00 committed by GitHub
parent 42666739f4
commit 1ff48d4d3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 23 additions and 357 deletions

View file

@ -5731,353 +5731,6 @@ Object {
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 1`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"input": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 2`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"input": Object {
"flags": Object {
"default": Array [],
"error": [Function],
"presence": "optional",
},
"items": Array [
Object {
"flags": Object {
"error": [Function],
"presence": "optional",
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
],
"type": "array",
},
"query": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 3`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"input": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 4`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"input": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
"inputType": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 5`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"input": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 6`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"inferenceId": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
"provider": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
"providerConfig": Object {
"flags": Object {
"default": Object {},
"error": [Function],
"presence": "optional",
"unknown": true,
},
"keys": Object {},
"preferences": Object {
"stripUnknown": Object {
"objects": false,
},
},
"type": "object",
},
"taskType": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
"taskTypeConfig": Object {
"flags": Object {
"default": Object {},
"error": [Function],
"presence": "optional",
"unknown": true,
},
"keys": Object {},
"preferences": Object {
"stripUnknown": Object {
"objects": false,
},
},
"type": "object",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 7`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"providerSecrets": Object {
"flags": Object {
"default": Object {},
"error": [Function],
"presence": "optional",
"unknown": true,
},
"keys": Object {},
"preferences": Object {
"stripUnknown": Object {
"objects": false,
},
},
"type": "object",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .inference 8`] = `
Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
},
"keys": Object {
"subAction": Object {
"flags": Object {
"error": [Function],
},
"rules": Array [
Object {
"args": Object {
"method": [Function],
},
"name": "custom",
},
],
"type": "string",
},
"subActionParams": Object {
"flags": Object {
"default": Object {
"special": "deep",
},
"error": [Function],
"presence": "optional",
"unknown": true,
},
"keys": Object {},
"preferences": Object {
"stripUnknown": Object {
"objects": false,
},
},
"type": "object",
},
},
"type": "object",
}
`;
exports[`Connector type config checks detect connector type changes for: .jira 1`] = `
Object {
"flags": Object {

View file

@ -32,7 +32,6 @@ export const connectorTypes: string[] = [
'.thehive',
'.sentinelone',
'.crowdstrike',
'.inference',
'.cases',
'.observability-ai-assistant',
];

View file

@ -15,7 +15,7 @@ export const allowedExperimentalValues = Object.freeze({
isMustacheAutocompleteOn: false,
sentinelOneConnectorOn: true,
crowdstrikeConnectorOn: true,
inferenceConnectorOn: true,
inferenceConnectorOn: false,
});
export type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;

View file

@ -16,7 +16,9 @@ const ACTION_TYPE_ID = '.inference';
let actionTypeModel: ActionTypeModel;
beforeAll(() => {
ExperimentalFeaturesService.init({ experimentalFeatures: experimentalFeaturesMock });
ExperimentalFeaturesService.init({
experimentalFeatures: { ...experimentalFeaturesMock, inferenceConnectorOn: true } as any,
});
const connectorTypeRegistry = new TypeRegistry<ActionTypeModel>();
registerConnectorTypes({ connectorTypeRegistry, services: registrationServicesMock });
const getResult = connectorTypeRegistry.get(ACTION_TYPE_ID);

View file

@ -9,6 +9,12 @@ import { PluginInitializerContext } from '@kbn/core/server';
import { coreMock } from '@kbn/core/server/mocks';
import { StackConnectorsPlugin } from './plugin';
import { actionsMock } from '@kbn/actions-plugin/server/mocks';
import { experimentalFeaturesMock } from '../public/mocks';
import { parseExperimentalConfigValue } from '../common/experimental_features';
jest.mock('../common/experimental_features');
const mockParseExperimentalConfigValue = parseExperimentalConfigValue as jest.Mock;
describe('Stack Connectors Plugin', () => {
describe('setup()', () => {
@ -18,6 +24,11 @@ describe('Stack Connectors Plugin', () => {
beforeEach(() => {
context = coreMock.createPluginInitializerContext();
mockParseExperimentalConfigValue.mockReturnValue({
...experimentalFeaturesMock,
inferenceConnectorOn: true,
});
plugin = new StackConnectorsPlugin(context);
coreSetup = coreMock.createSetup();
});

View file

@ -106,10 +106,6 @@ Array [
"cost": 1,
"taskType": "actions:.crowdstrike",
},
Object {
"cost": 1,
"taskType": "actions:.inference",
},
Object {
"cost": 1,
"taskType": "actions:.cases",

View file

@ -53,7 +53,6 @@ export default function createRegisteredConnectorTypeTests({ getService }: FtrPr
'.gen-ai',
'.bedrock',
'.gemini',
'.inference',
'.sentinelone',
'.cases',
'.crowdstrike',

View file

@ -36,7 +36,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.task_manager.monitored_aggregated_stats_refresh_rate=5000',
'--xpack.task_manager.ephemeral_tasks.enabled=false',
'--xpack.task_manager.ephemeral_tasks.request_capacity=100',
`--xpack.stack_connectors.enableExperimental=${JSON.stringify(['crowdstrikeConnectorOn'])}`,
`--xpack.stack_connectors.enableExperimental=${JSON.stringify([
'crowdstrikeConnectorOn',
'inferenceConnectorOn',
])}`,
...findTestPluginPaths(path.resolve(__dirname, 'plugins')),
],
},

View file

@ -33,7 +33,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.task_manager.ephemeral_tasks.enabled=false',
'--xpack.task_manager.ephemeral_tasks.request_capacity=100',
'--xpack.task_manager.metrics_reset_interval=40000',
`--xpack.stack_connectors.enableExperimental=${JSON.stringify(['crowdstrikeConnectorOn'])}`,
`--xpack.stack_connectors.enableExperimental=${JSON.stringify([
'crowdstrikeConnectorOn',
'inferenceConnectorOn',
])}`,
...findTestPluginPaths(path.resolve(__dirname, 'plugins')),
],
},