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

Fix missing colon on schema.yml and add unit test on it #866

Merged
merged 5 commits into from
May 27, 2022
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Upgrade stomp 8.0.0 to 8.0.1 - [#832](https://github.com/jertel/elastalert2/pull/832) - @jertel
- Add support for Kibana 8.2 for Kibana Discover, Upgrade Pytest 7.1.1 to 7.1.2, Upgrade pylint 2.13.5 to 2.13.8, Upgrade Jinja2 3.1.1 to 3.1.2 - [#840](https://github.com/jertel/elastalert2/pull/840) - @nsano-rururu
- Add the possibility to use rule and match fields in the description of TheHive alerts - [#855](https://github.com/jertel/elastalert2/pull/855) - @luffynextgen
- Fix missing colon on schema.yml and add unit test on it - [#866](https://github.com/jertel/elastalert2/pull/866) - @Isekai-Seikatsu

# 2.5.0

Expand Down
12 changes: 6 additions & 6 deletions elastalert/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@ properties:
mattermost_author_name: {type: string}
mattermost_author_link: {type: string}
mattermost_author_icon: {type: string}
mattermost_attach_kibana_discover_url {type: boolean}
mattermost_kibana_discover_color {type: string}
mattermost_kibana_discover_title {type: string}
mattermost_attach_kibana_discover_url: {type: boolean}
mattermost_kibana_discover_color: {type: string}
mattermost_kibana_discover_title: {type: string}

### Microsoft Teams
ms_teams_webhook_url: *arrayOfString
Expand Down Expand Up @@ -590,9 +590,9 @@ properties:
rocket_chat_msg_color: {enum: [good, warning, danger]}
rocket_chat_text_string: {type: string}
rocket_chat_proxy: {type: string}
rocket_chat_attach_kibana_discover_url {type: boolean}
rocket_chat_kibana_discover_color {type: string}
rocket_chat_kibana_discover_title {type: string}
rocket_chat_attach_kibana_discover_url: {type: boolean}
rocket_chat_kibana_discover_color: {type: string}
rocket_chat_kibana_discover_title: {type: string}
rocket_chat_ca_certs: {type: boolean}
rocket_chat_ignore_ssl_errors: {type: boolean}
rocket_chat_timeout: {type: integer}
Expand Down
13 changes: 11 additions & 2 deletions tests/loaders_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
import elastalert.ruletypes
from elastalert.alerters.email import EmailAlerter
from elastalert.config import load_conf
from elastalert.loaders import FileRulesLoader
from elastalert.loaders import RulesLoader
from elastalert.loaders import (
FileRulesLoader,
RulesLoader,
load_rule_schema,
)

from elastalert.util import EAException


Expand Down Expand Up @@ -622,3 +626,8 @@ def test_load_yaml_imports_modified():
'rule_file': rule_path,
}
assert len(rules_loader.import_rules) == 0


def test_load_rule_schema():
validator = load_rule_schema()
validator.check_schema(validator.schema)