-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Connectors] Use Connector API to create a connector #183398
[Connectors] Use Connector API to create a connector #183398
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@@ -87,9 +88,10 @@ export function connectorStatusToColor(connector: Connector): 'warning' | 'dange | |||
if ( | |||
isLastSeenOld(connector) || | |||
connectorStatus === ConnectorStatus.ERROR || | |||
connector.error === SyncStatus.ERROR || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous check didn't make sense (error can be arbitrary string), I adapted to check for last sync status
connector.last_access_control_sync_error !== null | ||
connector.last_sync_status === SyncStatus.ERROR || | ||
connector.last_access_control_sync_status === SyncStatus.ERROR || | ||
connector.last_sync_error != null || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change !==
to !=
, use type coercion when checking for nulls and undefined values (it's seems to be acceptable way for ts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= null
is a common thing to check isNullish normally. But I think we have a utility to do the same to prevent misreadings. Just search for isNullish
in code you may find it and use it if it is useful.
@@ -23,19 +23,46 @@ export const createConnector = async ( | |||
name?: string; | |||
pipeline?: IngestPipelineParams; | |||
serviceType?: string | null; | |||
instant_response?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have immediate
refresh policy by default: https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/connector/ConnectorIndexService.java#L133
@elasticmachine merge upstream |
…azb/kibana into connector-create-connector-with-api
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a simple change
connector.last_access_control_sync_error !== null | ||
connector.last_sync_status === SyncStatus.ERROR || | ||
connector.last_access_control_sync_status === SyncStatus.ERROR || | ||
connector.last_sync_error != null || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= null
is a common thing to check isNullish normally. But I think we have a utility to do the same to prevent misreadings. Just search for isNullish
in code you may find it and use it if it is useful.
Summary
Use Connector API endpoint in the create connectors action. Note: elastic/elasticsearch#109248 was merged into ES very recently, you might need to pull latest ES image to get this working.
Note: some crawler features also utilise connector index, since it was agreed not to support those features in the Connector API I'm leaving crawler related logic unchanged
Validation
Stack manual tests:
Screen.Recording.2024-06-05.at.09.59.59.mov
Serveless:
Screen.Recording.2024-06-05.at.10.05.56.mov