Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"redhat.vscode-yaml"
]
}
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,17 @@
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
"python.envFile": "${workspaceFolder}/.env",
"python.testing.cwd": "${workspaceFolder}"
"python.testing.cwd": "${workspaceFolder}",
"yaml.schemas": {
"./schemas/RemovedContent.schema.json": "removed/*/*.yml",
"./schemas/Baseline.schema.json": ["baselines/*.yml", "!removed/baselines/*.yml"],
"./schemas/CSVLookup.schema.json": "lookups/csv/*.yml",
"./schemas/Dashboard.schema.json": "dashboards/*.yml",
"./schemas/DataSource.schema.json": "data_sources/*.yml",
"./schemas/EventBasedDetection.schema.json": ["detections/*.yml", "!removed/detections/*.yml"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will intentionally not keep removed content in line with updates to the spec. Removed content should only be validated based on fields required for "RemovedContent" which we already have on line 11. I believe this second path (removed/detections/*.yml) should be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When I removed the !removed/detections/*.yml, the files under e.g. removed/detections/*.yml get validated by both schema (RemovedContent.schema.json and EventBasedDetection.schema.json). Since we only want the removed content to be validated against the RemovedContent.schema.json, I explicitly specify for schema e.g. EventBasedDetection.schema.json don't validate files under removed directory.

"./schemas/KVStoreLookup.schema.json": "lookups/kvstore/*.yml",
"./schemas/Macro.schema.json": "macros/*.yml",
"./schemas/Schedule.schema.json": "schedules/*.yml",
"./schemas/Story.schema.json": ["stories/*.yml", "!removed/stories/*.yml"]
}
}
Loading