Skip to content

Commit

Permalink
Populate service type for deleted connectors (elastic#181614)
Browse files Browse the repository at this point in the history
## Summary

This PR updates the connectors usage collector, to populate the
`serviceType` field for deleted connectors.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
wangch079 and kibanamachine authored May 3, 2024
1 parent 389025e commit 3e32e01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const collectConnectorStats = async (
const connectorStats: ConnectorStats = {
id: connectorId,
isDeleted: true,
serviceType: orphanedSyncJobs[0].connector.service_type,
syncJobs: syncJobsStats(orphanedSyncJobs),
};
connectorStatsArray.push(connectorStats);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const orphanedSyncJob: ConnectorSyncJob = {
trigger_method: TriggerMethod.ON_DEMAND,
connector: {
id: '3',
service_type: 'github',
configuration: {
use_text_extraction_service: {
value: false,
Expand Down Expand Up @@ -581,6 +582,7 @@ export const expectedMysqlConnectorStats: ConnectorStats = {
export const expectedDeletedConnectorStats: ConnectorStats = {
id: orphanedSyncJob.connector.id,
isDeleted: true,
serviceType: 'github',
syncJobs: {
overall: {
total: 1,
Expand Down

0 comments on commit 3e32e01

Please sign in to comment.