[Search] Fix integration id overlap for connectors (#184353)

## Summary

Connectors registered as custom integrations use the value in
`connector.serviceType` as an id. However, there are some connectors
that share a service type. This causes an error when running Kibana due
to the id clash.

This PR changes the id into a concatenation of `serviceType` and `name`
to ensure all ids are unique.

Errors before change (these no longer recur after the changes):

```log
[2024-05-28T12:06:10.514+00:00][ERROR][plugins.customIntegrations] Integration with id=confluence already exists.
[2024-05-28T12:06:10.516+00:00][ERROR][plugins.customIntegrations] Integration with id=jira already exists.
[2024-05-28T12:06:10.517+00:00][ERROR][plugins.customIntegrations] Integration with id=jira already exists.
[2024-05-28T12:06:10.518+00:00][ERROR][plugins.customIntegrations] Integration with id=salesforce already exists
```
This commit is contained in:
Navarone Feekery 2024-05-28 18:50:23 +02:00 committed by GitHub
parent 49925a3c4e
commit ef7677341b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.body).to.be.an('array');
expect(resp.body.length).to.be(51);
expect(resp.body.length).to.be(55);
// Test for sample data card
expect(resp.body.findIndex((c: { id: string }) => c.id === 'sample_data_all')).to.be.above(

View file

@ -97,7 +97,7 @@ export const registerEnterpriseSearchIntegrations = (
type: 'svg',
},
],
id: connector.serviceType,
id: `${connector.serviceType}-${connector.name}`,
isBeta: connector.isBeta,
shipper: 'enterprise_search',
title: connector.name,