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

ELE-2617 - Fix disable samples for alerts #1443

Merged

Conversation

IDoneShaveIt
Copy link
Collaborator

@IDoneShaveIt IDoneShaveIt commented Mar 4, 2024

Make sure we disable the alerts samples when the flag --disable-samples is True

Copy link

linear bot commented Mar 4, 2024

Copy link
Contributor

github-actions bot commented Mar 4, 2024

👋 @IDoneShaveIt
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

Copy link
Contributor

@erikzaadi erikzaadi left a comment

Choose a reason for hiding this comment

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

@@ -183,6 +185,9 @@ def format_alert(
elementary_database_and_schema: Optional[str] = None,
global_suppression_interval: int = 0,
override_config: bool = False,
disable_samples: bool = False,
*args,
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need those? it's better to be explicit about what args and kwargs can be passed on

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The function that is using the format_alert method is calling it for 3 different type of alerts.
Each alert has different arguments for the format_alert method.
That way we can assure that each format_alert define only the arguments it needed, and not fail when we pass it extra arguments.

This is (as I see it) a valid use of args and kwargs 🙂

@IDoneShaveIt IDoneShaveIt merged commit 43b7fb5 into master Mar 4, 2024
3 checks passed
@IDoneShaveIt IDoneShaveIt deleted the ele-2617-disable-samples-at-edr-monitor-does-not-work branch March 4, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants