Skip to content

Commit

Permalink
[8.x] [Search] Add UI kbn feature flag for Inference Endpoints (elast…
Browse files Browse the repository at this point in the history
…ic#195385) (elastic#195411)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Search] Add UI kbn feature flag for Inference Endpoints
(elastic#195385)](elastic#195385)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-08T13:13:37Z","message":"[Search]
Add UI kbn feature flag for Inference Endpoints (elastic#195385)\n\nThis adds a
UI feature flag for the inference endpoints plugin.\r\n\r\nCall this to
enable:\r\n```\r\nPOST
kbn:/internal/kibana/settings/inferenceEndpointsUi:enabled\r\n{\"value\":
true}\r\n```","sha":"09ba6b91b5ffd2dbb5ad8ffd91b3d518d8129607","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","v8.16.0","backport:version"],"title":"[Search]
Add UI kbn feature flag for Inference
Endpoints","number":195385,"url":"https://github.com/elastic/kibana/pull/195385","mergeCommit":{"message":"[Search]
Add UI kbn feature flag for Inference Endpoints (elastic#195385)\n\nThis adds a
UI feature flag for the inference endpoints plugin.\r\n\r\nCall this to
enable:\r\n```\r\nPOST
kbn:/internal/kibana/settings/inferenceEndpointsUi:enabled\r\n{\"value\":
true}\r\n```","sha":"09ba6b91b5ffd2dbb5ad8ffd91b3d518d8129607"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195385","number":195385,"mergeCommit":{"message":"[Search]
Add UI kbn feature flag for Inference Endpoints (elastic#195385)\n\nThis adds a
UI feature flag for the inference endpoints plugin.\r\n\r\nCall this to
enable:\r\n```\r\nPOST
kbn:/internal/kibana/settings/inferenceEndpointsUi:enabled\r\n{\"value\":
true}\r\n```","sha":"09ba6b91b5ffd2dbb5ad8ffd91b3d518d8129607"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sander Philipse <[email protected]>
  • Loading branch information
kibanamachine and sphilipse authored Oct 8, 2024
1 parent 0c63c08 commit 861d9cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions x-pack/plugins/search_inference_endpoints/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export type {
SearchInferenceEndpointsPluginSetup,
SearchInferenceEndpointsPluginStart,
} from './types';

export const INFERENCE_ENDPOINTS_UI_FLAG = 'inferenceEndpointsUi:enabled';
8 changes: 6 additions & 2 deletions x-pack/plugins/search_inference_endpoints/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
SearchInferenceEndpointsPluginSetup,
SearchInferenceEndpointsPluginStart,
} from './types';
import { INFERENCE_ENDPOINTS_UI_FLAG } from '.';

export class SearchInferenceEndpointsPlugin
implements Plugin<SearchInferenceEndpointsPluginSetup, SearchInferenceEndpointsPluginStart>
Expand All @@ -34,8 +35,11 @@ export class SearchInferenceEndpointsPlugin
public setup(
core: CoreSetup<AppPluginStartDependencies, SearchInferenceEndpointsPluginStart>
): SearchInferenceEndpointsPluginSetup {
if (!this.config.ui?.enabled) return {};

if (
!this.config.ui?.enabled &&
!core.uiSettings.get<boolean>(INFERENCE_ENDPOINTS_UI_FLAG, false)
)
return {};
core.application.register({
id: PLUGIN_ID,
appRoute: '/app/search_inference_endpoints',
Expand Down

0 comments on commit 861d9cb

Please sign in to comment.