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

AlertFiltering: prohibit partial filtering #18197

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Dec 3, 2024

This documentation-only PR clarifies that a query should either ignore restrictAlertsTo completely or apply restrictAlertsTo filtering to all alerts. This update eliminates the ambiguity on whether a query may choose to apply restrictAlertsTo filtering to only some alerts but not others (it may not).

This documentation-only commit clarifies that a query should either
ignore restrictAlertsTo completely or apply restrictAlertsTo filtering
to all alerts.  This update eliminates the ambiguity on whether a query
may choose to apply restrictAlertsTo filtering to only some alerts but
not others (it may not).
@cklin cklin added the no-change-note-required This PR does not need a change note label Dec 3, 2024
@cklin cklin requested review from jbj and hmakholm December 3, 2024 20:34
Copy link
Contributor

@hmakholm hmakholm left a comment

Choose a reason for hiding this comment

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

LGTM.

If I were to nitpick, I might say that "completely ignore this predicate" is slightly too strong a requirement. The query is allowed to "use" the extensible in a way where it generates the same alerts using different internal computations, depending on whether a diff is specified.

But I have no idea to which degree that is even a realistic opportunity, so I'm okay with not attempting to explain that in this context.

Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

LGTM. I'll just say here, for those wondering now or in the future why we're adding the requirement, that the purpose is to avoid alert wobble on PRs. If a small code change can cause unrelated alerts to come and go, that will make the timeline view in code scanning chaotic. This is why #17648 was needed.

@jbj jbj merged commit 5285fc0 into main Dec 4, 2024
32 of 33 checks passed
@jbj jbj deleted the cklin/restrict-alerts-to-all-or-none branch December 4, 2024 09:58
@cklin
Copy link
Contributor Author

cklin commented Dec 4, 2024

LGTM. I'll just say here, for those wondering now or in the future why we're adding the requirement, that the purpose is to avoid alert wobble on PRs. If a small code change can cause unrelated alerts to come and go, that will make the timeline view in code scanning chaotic. This is why #17648 was needed.

Yes. And I realized that my PR description is incomplete:

This update eliminates the ambiguity on whether a query may choose to apply restrictAlertsTo filtering to only some alerts but not others (it may not).

In addition to that, the new requirement is also intended to ensure that a query cannot decide whether to perform filtering based on the restrictAlertsTo contents. Put another way, a query must make the decision of whether to filter independent of what is (or is not) in the restrictAlertsTo predicate.

@hmakholm
Copy link
Contributor

hmakholm commented Dec 4, 2024

Hmm, that raises another question: can a query decide to filter or not based on what's in the database?

(I'd assume no, otherwise the rule wouldn't solve any alert wobble problem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants