Decoupling the change detection and alerting logic#9381
Closed
MohamedBilelBesbes wants to merge 0 commit intomozilla:masterfrom
Closed
Decoupling the change detection and alerting logic#9381MohamedBilelBesbes wants to merge 0 commit intomozilla:masterfrom
MohamedBilelBesbes wants to merge 0 commit intomozilla:masterfrom
Conversation
gmierz
requested changes
Apr 13, 2026
Collaborator
gmierz
left a comment
There was a problem hiding this comment.
Good changes! Some things to fix below. I may have some more comments incoming.
76cd5c0 to
4440de3
Compare
4440de3 to
33d89c9
Compare
Contributor
Author
|
@gmierz I accidently closed the PR upo trying to sync this branch to current master, I did address the comments writtewn in this PR, I will create a new PR with the changes. |
Contributor
Author
|
Link to new PR here |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is dedicated to separate the logics of the change point detection and the alerting.
run_detectionhandles pure detection with no database side effects, andcreate_alerts_from_resultsis the sole function responsible for persisting alerts, making it possible to query the detection pipeline without triggering any alerting (meaning that Sherlock could use it).run_detectionconfigurable to operate in two modes: a voting mode (voting_strategy="equal"or"priority") that runs the full ensemble and applies a consensus strategy, and a single-method mode (voting_strategy=None) that returns change points flagged directly by one named CPD method without involving the voting system.build_cpd_methodsintogenerate_new_test_alerts_in_seriesvia thevoting_methodsparam.build_revision_dataandrun_detectionare now called explicitly and separately instead of through the previously coupledvotefunction.run_detection, using Mann Whitney U as the detector and asserting that results come exclusively from that method'schange_detectedflags with no voting involvement.