Skip to content
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

[Entity Analytics] Add return types to all our routes #189726

Merged
merged 7 commits into from
Aug 2, 2024

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Aug 1, 2024

Summary

Add return types to all of our route handlers.

Before we did things like this in some APIs:

const resBody: CreateAssetCriticalityRecordResponse = { blah : 'blah'};

And I have moved to this style:

      async (
        context,
        request,
        response
      ): Promise<IKibanaResponse<CreateAssetCriticalityRecordResponse>> => {

This keeps the API docs in sync, I saw that this is how they do it in the elastic assistant plugin and liked it. I think it is clearer to have this stuff in the route definition, near the URL and request validation.

@hop-dev hop-dev changed the title [Entity Analytics] Add return types to all apis [Entity Analytics] Add return types to all our routes Aug 2, 2024
@hop-dev hop-dev marked this pull request as ready for review August 2, 2024 09:01
@hop-dev hop-dev requested a review from a team as a code owner August 2, 2024 09:01
@hop-dev hop-dev requested a review from tiansivive August 2, 2024 09:01
@hop-dev hop-dev self-assigned this Aug 2, 2024
@hop-dev hop-dev added release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team labels Aug 2, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@hop-dev
Copy link
Contributor Author

hop-dev commented Aug 2, 2024

/ci

@hop-dev
Copy link
Contributor Author

hop-dev commented Aug 2, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #57 / dashboard sample data dashboard "before all" hook for "should launch sample flights data set dashboard"

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 20.5MB 20.5MB +431.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @hop-dev

Copy link
Contributor

@tiansivive tiansivive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small question

@hop-dev hop-dev merged commit bc79b99 into elastic:main Aug 2, 2024
44 checks passed
@hop-dev hop-dev deleted the add-return-types-to-apis branch August 2, 2024 15:58
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants