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

[Cases] Separate Cases SO attributes from HTTP APIs #155898

Merged
merged 10 commits into from
Apr 28, 2023

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Apr 26, 2023

This PR separates the persisted SO attributes from the fields received in the HTTP API requests.

This is to address step 2 in preparing our HTTP routes as versioned.

Issue: #153726

This PR encompasses a few PRs here which have been reviewed individually by the cases team members:

#155325 - User actions
#155440 - Attachments
#155444 - Configure, Connector Mappings
#155277 - Cases

The large number of files is because of renaming some types throughout the frontend code. There shouldn't be many functionality changes, mostly just type changes.

## Summary

This PR changes the types of the Case entity to separate the SO
attributes from the HTTP APIs.

### Notable changes
- A new server-side type is created to describe the data persistent into
ES through the SO client. It is called `CasePersistedAttributes`.
- The type `CaseResponse` is renamed to `Case`.
- The type `CasesResponse` is renamed to `Cases`.
- The type `Case` is renamed to `CaseUI`.
- The type `Cases` is renamed to `CasesUI`.

### For maintainers

- [x] 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: Jonathan Buttner <[email protected]>
@jonathan-buttner jonathan-buttner added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.9.0 labels Apr 26, 2023
jonathan-buttner and others added 3 commits April 26, 2023 11:47
…e layer (#155325)

This PR separates the http API io-ts types from the types that are used
in the cases service layer to interact with the saved object client.
This PR is specifically for the user actions it only affects the types
used when interacting with the saved object client and doesn't touch the
transformation logic yet.

Issue: #153726
This PR separates the http API io-ts types from the types that are used
in the cases service layer to interact with the saved object client.
This PR is specifically for the attachments it only affects the types
used when interacting with the saved object client and doesn't touch the
transformation logic yet.

Issue: #153726
This PR separates the http API io-ts types from the types that are used
in the cases service layer to interact with the saved object client.
This PR is splits up the remaining types within the service layer
(configure and connector mappings).

Issue: #153726
@jonathan-buttner jonathan-buttner marked this pull request as ready for review April 27, 2023 15:19
@jonathan-buttner jonathan-buttner requested review from a team as code owners April 27, 2023 15:19
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

Code owners LGTM

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

Changes LGTM 👍

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

The single explore file change LGTM! Thanks Johnny 🚀

@patrykkopycinski patrykkopycinski added the ci:skip-cypress-osquery Skips osquery cypress checks label Apr 27, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts / alerting api integration security and spaces enabled - Group 2 Alerting and Actions Telemetry telemetry should retrieve telemetry data in the expected format

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
cases 79 81 +2

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
cases 32 31 -1
Unknown metric groups

API count

id before after diff
cases 96 98 +2

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 399 402 +3
total +5

References to deprecated APIs

id before after diff
cases 90 59 -31

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 479 482 +3
total +5

History

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

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

Looks good, Nice work 👍

@jonathan-buttner jonathan-buttner merged commit 6d5e245 into main Apr 28, 2023
@jonathan-buttner jonathan-buttner deleted the cases-split-types-feature branch April 28, 2023 12:31
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 28, 2023
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 ci:skip-cypress-osquery Skips osquery cypress checks Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.