[Security Solution] Get rid of AlertIds schema duplication#177425
[Security Solution] Get rid of AlertIds schema duplication#177425maximpn merged 7 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
|
/ci |
648f189 to
4331037
Compare
banderror
left a comment
There was a problem hiding this comment.
LGTM 👍
@marshallmain Do you want to check this as well?
marshallmain
left a comment
There was a problem hiding this comment.
Looks fine overall, just a folder naming suggestion
.github/CODEOWNERS
Outdated
There was a problem hiding this comment.
| /x-pack/plugins/security_solution/common/api/common_schemas @elastic/security-detection-rule-management @elastic/security-detection-engine | |
| /x-pack/plugins/security_solution/common/api/model @elastic/security-detection-rule-management @elastic/security-detection-engine |
For each individual domain, shared components within the domain go into a model folder - I think we should use the same naming scheme at the top level of the /api folder as well. Shared components across the entire security solution API would be found in /api/model.
There was a problem hiding this comment.
Agree. I hesitated between model and something less generic but unified naming is much better.
5425c8e to
093c1ab
Compare
tomsonpl
left a comment
There was a problem hiding this comment.
Defend Workflows LGTM 👍 Thank you!
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @maximpn |
…77425) ## Summary This PR moves `AlertIds` schema definition to one schema to avoid duplication. ## Details OAS should as simple and straightforward as possible. Having the same entities defined in different schemas may spawn ambiguity issues. On top of that [OAS docs bundler](elastic#171526) requires unique names for shared schemas. `AlertIds` definition is duplicated in `x-pack/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yaml` and `x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml`. To get rid of this duplication `AlertIds` definition has been moved in a common `Shared Alert Schema Primitives` and referenced accordingly in the schema files it's used. Additionally `NonEmptyString` and `UUID` schemas were moved from rule schema to a common `Shared Primitives Schema` as it's not only related to the rule schema.
Summary
This PR moves
AlertIdsschema definition to one schema to avoid duplication.Details
OAS should as simple and straightforward as possible. Having the same entities defined in different schemas may spawn ambiguity issues. On top of that OAS docs bundler requires unique names for shared schemas.
AlertIdsdefinition is duplicated inx-pack/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yamlandx-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml.To get rid of this duplication
AlertIdsdefinition has been moved in a commonShared Alert Schema Primitivesand referenced accordingly in the schema files it's used. AdditionallyNonEmptyStringandUUIDschemas were moved from rule schema to a commonShared Primitives Schemaas it's not only related to the rule schema.