-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Enterprise Search] Added an App Search route for listing Credentials #75487
[Enterprise Search] Added an App Search route for listing Credentials #75487
Conversation
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.
Some comments addressing the type errors - if you want to test locally as well, you can run node scripts/type_check.js --project x-pack/tsconfig.json
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/app_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts
Show resolved
Hide resolved
Hmm, looks like there's even more type shenanigans going on now, sorry 😞 Let me know if want to pair or rubber ducky or anything, I can be around! The unit tests I think can be fixed by changing responseMock's |
Yeah, I was hoping that my editor would catch all the TS issues but looks like it didn't 😢 . I'll get these fixed up, thanks. |
@elasticmachine merge upstream |
merge conflict between base and head |
3716ed2
to
6b6742a
Compare
@constancecchen This is ready for a second look. |
x-pack/plugins/enterprise_search/server/__mocks__/routerDependencies.mock.ts
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
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.
Naming comments - I think we can safely change all AppSearch name references to EnterpriseSearch
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
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.
Last set of comments I think (mostly just super small nits!) Thanks so much for addressing all my feedback! 🙇♀️
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.ts
Outdated
Show resolved
Hide resolved
In addition to a route for listing Credentials, this also adds a utility function which helps create API routes which simply proxy the App Search API. The reasoning for this is as follows; 1. Creating new routes takes less effeort and cognitive load if we can simply just create proxy routes that use the APIs as is. 2. It keeps the App Search API as the source of truth. All logic is implemented in the underlying API. 3. It makes unit testing routes much simpler. We do not need to verify any connectivity to the underlying App Search API, because that is already tested as part of the utility.
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
eba1cfd
to
33b05a7
Compare
x-pack/plugins/enterprise_search/server/lib/enterprise_search_request_handler.test.ts
Outdated
Show resolved
Hide resolved
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.
Woo hoo, I think this is good to go! Thanks so much for this amazing helper again - can't wait to use it!! 🎉
Also as a quick reminder for after this PR gets merged in - you'll want to run |
💚 Build SucceededBuild metricsdistributable file count
History
To update your PR or re-run it, just comment with: |
…elastic#75487) In addition to a route for listing Credentials, this also adds a utility function which helps create API routes which simply proxy the App Search API. The reasoning for this is as follows; 1. Creating new routes takes less effort and cognitive load if we can simply just create proxy routes that use the APIs as is. 2. It keeps the App Search API as the source of truth. All logic is implemented in the underlying API. 3. It makes unit testing routes much simpler. We do not need to verify any connectivity to the underlying App Search API, because that is already tested as part of the utility.
…#75487) (#76080) In addition to a route for listing Credentials, this also adds a utility function which helps create API routes which simply proxy the App Search API. The reasoning for this is as follows; 1. Creating new routes takes less effort and cognitive load if we can simply just create proxy routes that use the APIs as is. 2. It keeps the App Search API as the source of truth. All logic is implemented in the underlying API. 3. It makes unit testing routes much simpler. We do not need to verify any connectivity to the underlying App Search API, because that is already tested as part of the utility.
Summary
http://localhost:5601/api/app_search/credentials/collection?page[current]=1
In addition to a route for listing Credentials, this also adds a
utility function which helps create API routes which simply proxy
the App Search API.
The reasoning for this is as follows;
can simply just create proxy routes that use the APIs as is.
implemented in the underlying API.
any connectivity to the underlying App Search API, because that is
already tested as part of the utility.
Checklist
Delete any items that are not applicable to this PR.
For maintainers