-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution] Restructuring folders of Detection Engine + refactoring Rule Management #142950
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
Merged
banderror
merged 29 commits into
elastic:main
from
banderror:onweek-refactoring-rule-management
Oct 21, 2022
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
2eef5de
Preliminary refactoring: folder restructuring and creating API hooks
banderror 20a7de5
Further rules table refactoring
f03f3d1
Fix CI: linting errors, type errors, tests
banderror 5babefe
Restructuring common folder, take 1
banderror 4657f76
Cleanup
872394b
Update query hooks
323db29
Fix name collision
9eb427b
Restructuring common folder, take 2
banderror 87b7299
Restructuring common folder, take 3
banderror fe818a1
Fix tests
1a0f5ba
Fix tests
31c5a82
Restructuring common folder, take 4
banderror 1e79428
Restructuring common folder, take 5
banderror 4a08b8b
Restructuring common folder, take 6
banderror 5abd594
Restructuring common folder, take 7
banderror ae573dc
Fix errors
banderror 49d6f94
Update CODEOWNERS
banderror 95c0926
Fix tests
banderror 1bb6651
Fix tests
38c27c5
Test fixes
c9476c6
Fix tests
a55d91d
Fix errors after rebase
banderror cf04cf4
Fix some TODOs
25cc4f8
Update and unskip more tests
66dc2ad
Import bulk action types NOT via index.ts
banderror 0b78136
Merge main into onweek-refactoring-rule-management
banderror 8f55566
Fix post-merge errors
banderror d6363ee
Address comments
banderror df5dfd7
Merge branch 'main' into onweek-refactoring-rule-management
banderror File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import * as t from 'io-ts'; | ||
| import { From } from '../from'; | ||
|
|
||
| export type RuleInterval = t.TypeOf<typeof RuleInterval>; | ||
| export const RuleInterval = t.string; // we need a more specific schema | ||
|
|
||
| export type RuleIntervalFrom = t.TypeOf<typeof RuleIntervalFrom>; | ||
| export const RuleIntervalFrom = From; | ||
|
|
||
| /** | ||
| * TODO: Create a regular expression type or custom date math part type here | ||
| */ | ||
| export type RuleIntervalTo = t.TypeOf<typeof RuleIntervalTo>; | ||
| export const RuleIntervalTo = t.string; // we need a more specific schema |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's the reasoning behind using PascalCase for the io-ts runtime values now? In the past we've used camelCase for objects and PascalCase for types, which generally makes it simple to distinguish between types and concrete instances of that type.
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.
@marshallmain This is a TypeScript feature called aliases. In this case, it's handy because it allows to write only one JSDoc comment which will be applied to both the TS type and the io-ts schema. So when you hover over them in the IDE you will see the same comment. Without that, we'd need to either duplicate the comment or leave either the TS type or the io-ts schema uncommented. Personally, I also like the fact that it's 1 import instead of 2 when you need both (e.g. in routes).
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.
One of the examples of how JSDoc comments for rule attributes could look like:
x-pack/plugins/security_solution/common/detection_engine/rule_schema/model/common_attributes/related_integrations.ts