Skip to content

Commit 408861f

Browse files
kibanamachinealvarezmelissa87jgowdyelasticelasticmachine
authored
[8.19] [ML]Inference endpoints UI: Ensure list loads when provider is custom (elastic#240189) (elastic#240540)
# Backport This will backport the following commits from `main` to `8.19`: - [[ML]Inference endpoints UI: Ensure list loads when provider is custom (elastic#240189)](elastic#240189) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Melissa Alvarez","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-24T22:34:46Z","message":"[ML]Inference endpoints UI: Ensure list loads when provider is custom (elastic#240189)\n\n## Summary\n\nThis PR ensures the inference endpoints list loads properly even when\nthe provider is not part of the internal providers list.\n\nThis will need to be backported to 8.19.7, 9.1.7, 9.2.1 \nRegression introduced\n[here](elastic#218496) so ensuring\nbackports to all relevant releases.\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: James Gowdy <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"8bb3ebc1db93b329bc210f55bdc900f9aef055ff","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","backport:version","Feature:Inference UI","v9.3.0","v8.19.7","v9.1.7","v9.2.1"],"title":"[ML]Inference endpoints UI: Ensure list loads when provider is custom","number":240189,"url":"https://github.com/elastic/kibana/pull/240189","mergeCommit":{"message":"[ML]Inference endpoints UI: Ensure list loads when provider is custom (elastic#240189)\n\n## Summary\n\nThis PR ensures the inference endpoints list loads properly even when\nthe provider is not part of the internal providers list.\n\nThis will need to be backported to 8.19.7, 9.1.7, 9.2.1 \nRegression introduced\n[here](elastic#218496) so ensuring\nbackports to all relevant releases.\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: James Gowdy <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"8bb3ebc1db93b329bc210f55bdc900f9aef055ff"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240189","number":240189,"mergeCommit":{"message":"[ML]Inference endpoints UI: Ensure list loads when provider is custom (elastic#240189)\n\n## Summary\n\nThis PR ensures the inference endpoints list loads properly even when\nthe provider is not part of the internal providers list.\n\nThis will need to be backported to 8.19.7, 9.1.7, 9.2.1 \nRegression introduced\n[here](elastic#218496) so ensuring\nbackports to all relevant releases.\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [ ] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.\n\n---------\n\nCo-authored-by: James Gowdy <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"8bb3ebc1db93b329bc210f55bdc900f9aef055ff"}},{"branch":"8.19","label":"v8.19.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Melissa Alvarez <[email protected]> Co-authored-by: James Gowdy <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 6f32d1e commit 408861f

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import React from 'react';
9+
import { render } from '@testing-library/react';
10+
import type { ServiceProviderKeys } from '@kbn/inference-endpoint-ui-common';
11+
import { ServiceProviderFilter } from './service_provider_filter';
12+
13+
describe('ServiceProviderFilter', () => {
14+
it('should render the filter with known and unknown providers', () => {
15+
const { getByTestId } = render(
16+
<ServiceProviderFilter
17+
optionKeys={[]}
18+
onChange={jest.fn}
19+
uniqueProviders={new Set(['elasticsearch', 'unknownProvider'] as ServiceProviderKeys[])}
20+
/>
21+
);
22+
expect(getByTestId('service-field-endpoints')).toBeInTheDocument();
23+
});
24+
});

x-pack/solutions/search/plugins/search_inference_endpoints/public/components/all_inference_endpoints/filter/service_provider_filter.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ export const ServiceProviderFilter: React.FC<Props> = ({
3131
});
3232
};
3333

34-
const filteredOptions = useMemo(() => {
35-
const options: any = [];
36-
uniqueProviders.forEach((provider) => {
37-
const { name } = SERVICE_PROVIDERS[provider];
38-
options.push({
39-
key: provider,
40-
label: name,
41-
});
42-
});
43-
return options;
34+
const filteredOptions = useMemo<MultiSelectFilterOption[]>(() => {
35+
return Array.from(uniqueProviders).map((provider) => ({
36+
key: provider,
37+
label: SERVICE_PROVIDERS[provider]?.name ?? provider,
38+
}));
4439
}, [uniqueProviders]);
4540

4641
return (

0 commit comments

Comments
 (0)