-
Notifications
You must be signed in to change notification settings - Fork 935
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
[OSCI] Fix type errors in Multiple Data Sources #5546
Conversation
Signed-off-by: CMDWillYang <[email protected]>
…als/logos Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
Co-authored-by: Josh Romero <[email protected]> Signed-off-by: CMDWillYang <[email protected]>
data_source_saved_objects_client_wrapper.ts: Signed-off-by: CMDWillYang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5546 +/- ##
==========================================
+ Coverage 66.98% 67.02% +0.03%
==========================================
Files 3294 3294
Lines 63296 63308 +12
Branches 10066 10075 +9
==========================================
+ Hits 42398 42430 +32
+ Misses 18500 18432 -68
- Partials 2398 2446 +48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
...blic/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...blic/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...blic/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
src/plugins/data_source/server/legacy/configure_legacy_client.ts
Outdated
Show resolved
Hide resolved
src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: SuZhou-Joe <[email protected]> Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
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.
Thank you for your patient to continuously improve this PR, I left a few more comment 👍
const client = new LegacyClient({ | ||
connectionClass: HttpAmazonESConnector, | ||
awsConfig: new Config({ | ||
region, | ||
credentials: new Credentials({ accessKeyId: accessKey, secretAccessKey: secretKey }), | ||
}), | ||
service, | ||
|
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.
I understand that service
is NOT a known property of ConfigOptions
, but maybe you want to make sure that service
is not needed and can be safely removed :)
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.
I believe it is not needed. The only usage of getAWSClient
in the repo is line 120. const awsClient
is used in addClientToPool
and callAPI.bind(null, awsClient)
which getQueryClient
then returns. None of them should use service to my knowledge/investigation, and also type legacyClient
/ class Client
does not have this service property so that should be a good indication.
OpenSearch-Dashboards/src/plugins/data_source/server/legacy/configure_legacy_client.ts
Line 120 in bca1dcf
const awsClient = rootClient ? rootClient : getAWSClient(awsCredential, clientOptions); |
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.
Thanks for the clarification!
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.
I did notice, however, that there is a test expecting service
to still be included.
I have yet to figure out why this might be needed. still researching.
OpenSearch-Dashboards/src/plugins/data_source/server/legacy/configure_legacy_client.test.ts
Lines 167 to 179 in bca1dcf
test('configure client with auth.type == sigv4 and service param, should call new Client() with service param', async () => { | |
savedObjectsMock.get.mockReset().mockResolvedValueOnce({ | |
id: DATA_SOURCE_ID, | |
type: DATA_SOURCE_SAVED_OBJECT_TYPE, | |
attributes: { | |
...dataSourceAttr, | |
auth: { | |
type: AuthType.SigV4, | |
credentials: { ...sigV4AuthContent, service: 'aoss' }, | |
}, | |
}, | |
references: [], | |
}); |
src/plugins/data_source/server/saved_objects/data_source_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
…_source/components/edit_form/edit_data_source_form.tsx Co-authored-by: Yulong Ruan <[email protected]> Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
src/plugins/data_source/server/legacy/configure_legacy_client.ts
Outdated
Show resolved
Hide resolved
src/plugins/data_source/server/legacy/configure_legacy_client.ts
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
...management/public/components/edit_data_source/components/edit_form/edit_data_source_form.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
Signed-off-by: CMDWillYang <[email protected]>
Closing this since this is quite old and a lot has changed since. Thanks for the PR @CMDWillYang |
Description
Fixed type errors found in several data source files:
Issues Resolved
Fixes several errors outlined in issue #3026
Screenshot
https://docs.google.com/document/d/1EUXvMTZCUQYPzHRl2fgUGFCgc9KWJUH0p82zaR9UpQI/edit?usp=sharing
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration